|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.hp.hpl.mesa.rdf.jena.rdb.SimpleCache
Trivial implementation of the generic cache interface used to cache literals and resources. This implementation simple flushes the cache when the threshold limit is exceeded.
| Constructor Summary | |
SimpleCache(int threshold)
Create an empty cache with the given threshold limit. |
|
| Method Summary | |
java.lang.Object |
get(IDBID id)
Retreive an object from the cache |
int |
getLimit()
Return the current threshold limit for the cache size. |
void |
put(IDBID id,
java.lang.Object val)
Add an entry to the cache |
void |
setLimit(int threshold)
Set a threshold for the cache size in terms of the count of cache entries. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimpleCache(int threshold)
threshold - the cache size limit, use 0 for no cache, -1 for
unlimited cache growth; any other number indicates the number of cache entries| Method Detail |
public void put(IDBID id,
java.lang.Object val)
put in interface ICacheid - the database ID to be used as an indexval - the literal or resources to be storedpublic java.lang.Object get(IDBID id)
get in interface ICacheid - the database ID of the object to be retrieved
public void setLimit(int threshold)
setLimit in interface ICachethreshold - the cache size limit, use 0 for no cache, -1 for
unlimited cache growth; any other number indicates the number of cache entriespublic int getLimit()
getLimit in interface ICache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||