|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractMap | +--java.util.HashMap | +--java.util.LinkedHashMap | +--org.enhydra.dods.cache.LRUCache
LRUCache class implements LRU cache for storing DO objects.
Nested Class Summary |
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Field Summary | |
protected int |
maxEntries
Maximal number of entries in LRUCache. |
Constructor Summary | |
LRUCache()
Constructs an empty access-ordered LRUCache instance with a default capacity (16) and load factor (0.75). |
|
LRUCache(int maxEnt)
Constructs an empty access-ordered LRUCache instance with a default capacity (16) and load factor (0.75) and with maximal number of entries. |
|
LRUCache(int initialCapacity,
float loadFactor)
Constructs an empty access-ordered LRUCache instance with the specified initial capacity and load factor. |
|
LRUCache(int initialCapacity,
float loadFactor,
int maxEnt)
Constructs an empty access-ordered LRUCache instance with the specified initial capacity, load factor and maximal number of entries. |
|
LRUCache(java.util.Map m)
Constructs an access-ordered LRUCache instance with the same mappings as the specified map. |
|
LRUCache(java.util.Map m,
int maxEnt)
Constructs an access-ordered LRUCache instance with the same mappings as the specified map. |
Method Summary | |
java.lang.Object |
add(java.lang.Object key,
java.lang.Object value)
Adds a pair (key, value) to the cache. |
int |
getMaxEntries()
Returns maximal number of entries in LRUCache. |
void |
setMaxEntries(int max)
Sets maximal number of entries in LRUCache. |
java.lang.String |
toString()
For debug reason. |
Methods inherited from class java.util.LinkedHashMap |
clear, containsValue, get, removeEldestEntry |
Methods inherited from class java.util.HashMap |
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
protected int maxEntries
Constructor Detail |
public LRUCache(int initialCapacity, float loadFactor, int maxEnt)
initialCapacity
- the initial capacity.loadFactor
- the load factor.maxEnt
- maximal number of entries in LRUCache.public LRUCache(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity.loadFactor
- the load factor.public LRUCache(int maxEnt)
maxEnt
- maximal number of entries in LRUCache.public LRUCache()
public LRUCache(java.util.Map m, int maxEnt)
m
- the map whose mappings are to be placed in this map.maxEnt
- maximal number of entries in LRUCache.public LRUCache(java.util.Map m)
m
- the map whose mappings are to be placed in this map.Method Detail |
public java.lang.Object add(java.lang.Object key, java.lang.Object value)
key
- key asociated with the value.value
- value that will be added to the cache.
public int getMaxEntries()
public void setMaxEntries(int max)
max
- new value of maximal number of entries in LRU Cache.public java.lang.String toString()
toString
in class java.util.AbstractMap
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |