Protege 3.3.1

edu.stanford.smi.protege.util.transaction
Class CacheImpl<V,R>

java.lang.Object
  extended by edu.stanford.smi.protege.util.transaction.CacheImpl<V,R>
All Implemented Interfaces:
Cache<V,R>

public class CacheImpl<V,R>
extends Object
implements Cache<V,R>


Constructor Summary
CacheImpl()
           
 
Method Summary
 boolean isCached(V var)
          determines if the variable var is cached in the global cache.
 R readCache(V var)
          If the variable var is cached then this returns the cached value.
 void removeCacheEntry(V var)
          Invalidates the global cache for the variable var.
 void writeCache(V var, R result)
          Writes the value result to the global cache for the variable var.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheImpl

public CacheImpl()
Method Detail

isCached

public boolean isCached(V var)
Description copied from interface: Cache
determines if the variable var is cached in the global cache. isCached(var) should always be checked before calling read(var).

Specified by:
isCached in interface Cache<V,R>
Parameters:
var - a variable
Returns:
whether the variable is cached.

readCache

public R readCache(V var)
Description copied from interface: Cache
If the variable var is cached then this returns the cached value. It can be null.

Specified by:
readCache in interface Cache<V,R>
Parameters:
var - a variable
Returns:
the value in the cache for the variable var.

writeCache

public void writeCache(V var,
                       R result)
Description copied from interface: Cache
Writes the value result to the global cache for the variable var.

Specified by:
writeCache in interface Cache<V,R>
Parameters:
var - a variable
result - the cached value for the variable.

removeCacheEntry

public void removeCacheEntry(V var)
Description copied from interface: Cache
Invalidates the global cache for the variable var.

Specified by:
removeCacheEntry in interface Cache<V,R>
Parameters:
var - a variable

Protege 3.3.1

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2007 Stanford University.