|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sadun.util.Cache
A simple cache object, which holds at most n references.
Constructor Summary | |
Cache(int max)
Constructor for Cache. |
Method Summary | |
boolean |
containsKey(java.lang.Object key)
Return true if the cache contains the given key. |
java.lang.Object |
get(java.lang.Object key)
Find an object into the cache. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Put an object in the cache. |
java.lang.Object |
remove(java.lang.Object key)
Remove an object from the cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Cache(int max)
max
- the maximum number of references to hold.Method Detail |
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
public java.lang.Object remove(java.lang.Object key)
public java.lang.Object get(java.lang.Object key)
key
- the key of the object to get.
public boolean containsKey(java.lang.Object key)
Note that this not guarantees that the corresponding
object will actually exist in the cache in a later call
to get(Object)
.
key
- the value to verify
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |