|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap
com.miginfocom.util.MRUSoftCacheMap
public class MRUSoftCacheMap
Generic implementation of an access-order MRU-map that holds all values in SoftReferences.
Some methods, mostly those which returns a collection that this class can't filter, throws an UnsupportedOperationException.
Having the refenence in a SoftReference means it will go away of memory gets low in the virtual machine. It is therefore
used as a cache for objects that is good to have around but should be garbage collected to avoid out-of-memory problems.
| Constructor Summary | |
|---|---|
MRUSoftCacheMap(int maxCount,
boolean accessOrder)
|
|
| Method Summary | |
|---|---|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
Not supported! Throws UnsupportedOperationException |
java.util.Set |
entrySet()
Not supported! Throws UnsupportedOperationException |
protected void |
flushEmptyRefs()
Checks all references and deletes those entries which has no referring object. |
java.lang.Object |
get(java.lang.Object key)
|
boolean |
isEmpty()
Not supported! Throws UnsupportedOperationException |
java.util.Set |
keySet()
Not supported! Throws UnsupportedOperationException |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
boolean |
removeEldestEntry(java.util.Map.Entry entry)
|
int |
size()
|
java.lang.String |
toString()
|
java.util.Collection |
values()
Not supported! Throws UnsupportedOperationException |
| Methods inherited from class java.util.LinkedHashMap |
|---|
clear |
| Methods inherited from class java.util.HashMap |
|---|
clone, putAll, remove |
| 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, putAll, remove |
| Constructor Detail |
|---|
public MRUSoftCacheMap(int maxCount,
boolean accessOrder)
| Method Detail |
|---|
public boolean removeEldestEntry(java.util.Map.Entry entry)
removeEldestEntry in class java.util.LinkedHashMap
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class java.util.HashMappublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.MapcontainsKey in class java.util.HashMappublic java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapget in class java.util.LinkedHashMapprotected void flushEmptyRefs()
public boolean containsValue(java.lang.Object value)
UnsupportedOperationException
containsValue in interface java.util.MapcontainsValue in class java.util.LinkedHashMappublic java.util.Set entrySet()
UnsupportedOperationException
entrySet in interface java.util.MapentrySet in class java.util.HashMappublic java.util.Set keySet()
UnsupportedOperationException
keySet in interface java.util.MapkeySet in class java.util.HashMappublic java.util.Collection values()
UnsupportedOperationException
values in interface java.util.Mapvalues in class java.util.HashMappublic boolean isEmpty()
UnsupportedOperationException
isEmpty in interface java.util.MapisEmpty in class java.util.HashMappublic int size()
size in interface java.util.Mapsize in class java.util.HashMappublic java.lang.String toString()
toString in class java.util.AbstractMap
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||