|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hypergraphdb.cache.SimpleCache<Key,Value>
public class SimpleCache<Key,Value>
| Constructor Summary | |
|---|---|
SimpleCache()
|
|
| Method Summary | |
|---|---|
void |
clear()
Clear (i.e. |
Value |
get(Key key)
Retrieve an element from the cache. |
Value |
getIfLoaded(Key key)
Retrieve and return an element from the cache if it's already there or return null otherwise. |
RefResolver<Key,Value> |
getResolver()
Return the RefResolver used to load data in the cache. |
boolean |
isLoaded(Key key)
Return true if the element with the given key is currently in the
cache and false otherwise. |
void |
remove(Key key)
Force removal of an element from the cache. |
void |
setResolver(RefResolver<Key,Value> resolver)
Set the RefResolver to be used to load data in the cache. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleCache()
| Method Detail |
|---|
public Value get(Key key)
HGCacheRetrieve an element from the cache. If the element is already in the cache,
it is simply returned. Otherwise, the RefResolver will be used to
obtain it automatically from permanent storage.
get in interface HGCache<Key,Value>key - The key of the element.
public Value getIfLoaded(Key key)
HGCacheRetrieve and return an element from the cache if it's already there or
return null otherwise. This method will not call the
RefResolver when the element is not found in the cache.
getIfLoaded in interface HGCache<Key,Value>key - The key of the element.
null is it's not found in the cache.public boolean isLoaded(Key key)
HGCacheReturn true if the element with the given key is currently in the
cache and false otherwise.
isLoaded in interface HGCache<Key,Value>public void remove(Key key)
HGCacheForce removal of an element from the cache. This method is generally used when the data has been (or is being) removed from the permanent storage as well.
remove in interface HGCache<Key,Value>key - The key of the element.public RefResolver<Key,Value> getResolver()
HGCacheReturn the RefResolver used to load data in the cache.
getResolver in interface HGCache<Key,Value>public void setResolver(RefResolver<Key,Value> resolver)
HGCacheSet the RefResolver to be used to load data in the cache.
setResolver in interface HGCache<Key,Value>public void clear()
HGCacheClear (i.e. force removal of) all elements from the cache.
clear in interface HGCache<Key,Value>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||