|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.domui.util.LRUHashMap<K,V>
public class LRUHashMap<K,V>
This is a LRU hashmap which will remove objects automatically when it's size becomes full.
Nested Class Summary | |
---|---|
static interface |
LRUHashMap.SizeCalculator<V>
|
Constructor Summary | |
---|---|
LRUHashMap(LRUHashMap.SizeCalculator<V> szc,
int maxsize)
|
|
LRUHashMap(LRUHashMap.SizeCalculator<V> szc,
int maxsize,
int initial)
|
Method Summary | |
---|---|
void |
clear()
Clear the map. |
java.lang.Object |
clone()
FIXME Needs an implementation |
boolean |
containsKey(java.lang.Object key)
Returns T if this map contains the keyed object. |
boolean |
containsValue(java.lang.Object value)
Returns T if this map contains the value. |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Returns a collection view of the mappings contained in this map. |
V |
get(java.lang.Object key)
Retrieve a value by key. |
int |
getMaxSize()
|
int |
getObjectSize()
Return the size of all stored objects. |
boolean |
isEmpty()
|
java.util.Set<K> |
keySet()
|
V |
put(K key,
V value)
Associates the specified value with the specified key in this map. |
void |
putAll(java.util.Map<? extends K,? extends V> m)
Adds all of the elements to this map. |
V |
remove(java.lang.Object key)
Remove an entry by key. |
int |
size()
Returns the current #elements in the map. |
java.util.Collection<V> |
values()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public LRUHashMap(LRUHashMap.SizeCalculator<V> szc, int maxsize)
public LRUHashMap(LRUHashMap.SizeCalculator<V> szc, int maxsize, int initial)
Method Detail |
---|
public int size()
size
in interface java.util.Map<K,V>
public int getMaxSize()
public int getObjectSize()
public boolean isEmpty()
isEmpty
in interface java.util.Map<K,V>
public void clear()
clear
in interface java.util.Map<K,V>
public V get(java.lang.Object key)
get
in interface java.util.Map<K,V>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<K,V>
public V put(K key, V value)
put
in interface java.util.Map<K,V>
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
public void putAll(java.util.Map<? extends K,? extends V> m)
putAll
in interface java.util.Map<K,V>
public V remove(java.lang.Object key)
remove
in interface java.util.Map<K,V>
Map.remove(java.lang.Object)
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<K,V>
Map.containsValue(java.lang.Object)
public java.lang.Object clone()
clone
in class java.lang.Object
public java.util.Set<K> keySet()
keySet
in interface java.util.Map<K,V>
public java.util.Collection<V> values()
values
in interface java.util.Map<K,V>
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
entrySet
in interface java.util.Map<K,V>
Map.Entry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |