|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mancrd.ahah.commons.LRUCache
public class LRUCache
A specialized LRUCache where only keys are put into it. The values associated with the keys are managed internally.
Constructor Summary | |
---|---|
LRUCache(int cacheSize)
Constructor |
Method Summary | |
---|---|
Collection<Map.Entry<String,Integer>> |
getAll()
Returns a Collection that contains a copy of all cache entries. |
LinkedHashMap<String,Integer> |
getMap()
get the internal key/value (Signature/Lables) map of the CAM |
boolean |
isFull()
check if the CAM is full |
boolean |
isReassign()
Returns whether or not the last insert was an overwrite or not. |
int |
maxSize()
check the max size of the CAM |
Integer |
put(String signature)
Adds an entry to this cache. |
void |
reset()
resets everything to new state |
String |
reverseLookup(Integer label)
given a label, return the signature |
int |
size()
Returns the number of used entries in the cache. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LRUCache(int cacheSize)
cacheSize
- the maximum number of entries that will be kept in this cache.Method Detail |
---|
public Integer put(String signature)
signature
- - the key with which the specified value is to be associated. This is usually a String or an Integerpublic boolean isReassign()
public void reset()
public int size()
public boolean isFull()
public int maxSize()
public LinkedHashMap<String,Integer> getMap()
public Collection<Map.Entry<String,Integer>> getAll()
Collection
that contains a copy of all cache entries.
Collection
with a copy of the cache content.public String reverseLookup(Integer label)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |