|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pnuts.lang.Cache
An implementation of LRU cache
Constructor Summary | |
protected |
Cache()
|
|
Cache(int size)
|
|
Cache(int size,
boolean compareID)
|
Method Summary | |
java.lang.Object |
get(java.lang.Object key)
If key is in the cache it returns value, otherwise null. |
void |
put(java.lang.Object key,
java.lang.Object value)
Register key and its value into the cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Cache()
public Cache(int size)
size
- cache sizepublic Cache(int size, boolean compareID)
size
- cache sizecompareID
- If true keys are compared by their object IDs,
otherwise by Object.equals().Method Detail |
public java.lang.Object get(java.lang.Object key)
public void put(java.lang.Object key, java.lang.Object value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |