|
|||||||||||
| 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
|
+--com.opencms.flex.util.CmsLruHashMap
A hash table based implementation of the Map interface with limited size and a "last-recently-used" cache policy of the mapped key/values.
CmsFlexLruCache,
I_CmsFlexLruCacheObject,
Serialized Form| Constructor Summary | |
CmsLruHashMap()
Creates a LRU hash map with an initial capacity of (16), a load factor of (0.75), and a max. size of cacheable objects of (36). |
|
CmsLruHashMap(int initialCapacity)
Creates a LRU hash map with a given initial capacity, a load factor of (0.75), and a max. size of cacheable objects of (initialCapacity*3*0.75). |
|
CmsLruHashMap(int initialCapacity,
float loadFactor)
Creates a LRU hash map with a given initial capacity, a given load factor, and a max. size of cacheable objects of (initialCapacity*3*loadFactor). |
|
CmsLruHashMap(int initialCapacity,
float loadFactor,
int maxLruSize)
Creates a LRU hash map with a given initial capacity, a given load factor, and a given max. size of cacheable objects. |
|
CmsLruHashMap(int initialCapacity,
int maxLruSize)
Creates a LRU hash map with a given initial capacity, a load factor of (0.75), and a given max. size of cacheable objects. |
|
| Method Summary | |
void |
clear()
Removes all objects from this map. |
protected void |
finalize()
Clears any allocated resources during finalization. |
Object |
get(Object key)
Returns the value to which the specified key is mapped in this identity hash map, or null if the map contains no mapping for this key. |
CmsFlexLruCache |
getLruCache()
Returns the internal cache used for the LRU policy. |
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map. |
void |
putAll(Map t)
Copies all of the mappings from the specified map to this map. |
Object |
remove(Object key)
Removes the mapping for this key from this map if present. |
| Methods inherited from class java.util.HashMap |
clone, containsKey, containsValue, entrySet, isEmpty, keySet, size, values |
| Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode |
| Constructor Detail |
public CmsLruHashMap()
public CmsLruHashMap(int initialCapacity)
initialCapacity - the initial capacity of the hash map
public CmsLruHashMap(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity of the hash maploadFactor - the load factor of the hash map before it is rehashed
public CmsLruHashMap(int initialCapacity,
int maxLruSize)
initialCapacity - the initial capacity of the hash mapmaxLruSize - the max. count of cacheable objects
public CmsLruHashMap(int initialCapacity,
float loadFactor,
int maxLruSize)
initialCapacity - the initial capacity of the hash maploadFactor - the load factor of the hash map before it is rehashedmaxLruSize - the max. count of cacheable objects| Method Detail |
public void clear()
clear in interface Mapclear in class HashMap
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic Object get(Object key)
A return value of null does not necessarily indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to null. The containsKey method may be used to distinguish these two cases.
get in interface Mapget in class HashMapkey - the key to look upMap.get(java.lang.Object)
public Object put(Object key,
Object value)
If the map previously contained a mapping for this key, the old value is replaced.
put in interface Mapput in class HashMapkey - the key to storevalue - the value to storeMap.put(java.lang.Object, java.lang.Object)public void putAll(Map t)
These mappings will replace any mappings that this map had for any of the keys currently in the specified map.
putAll in interface MapputAll in class HashMapt - the map to storeMap.putAll(java.util.Map)public Object remove(Object key)
remove in interface Mapremove in class HashMapkey - the key to removeMap.remove(java.lang.Object)public CmsFlexLruCache getLruCache()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||