Package org.eclipse.sisu.inject
Class MildKeys<K,V>
- java.lang.Object
-
- org.eclipse.sisu.inject.MildKeys<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
- Direct Known Subclasses:
MildConcurrentKeys
class MildKeys<K,V> extends java.lang.Object implements java.util.Map<K,V>NON-thread-safeMapwhose keys are kept alive by soft/weakReferences.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classMildKeys.EntryItrIteratorthat iterates over reachable entries in the map.(package private) classMildKeys.KeyItrIteratorthat iterates over reachable keys in the map.(package private) static classMildKeys.Soft<T>Soft key that maintains a constant hash and uses referential equality.(package private) classMildKeys.StrongEntryMap.Entrythat delegates to the original entry, but maintains a strong reference to the key.(package private) static classMildKeys.Weak<T>Weak key that maintains a constant hash and uses referential equality.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()(package private) voidcompact()Compacts the map by removing cleared keys.booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<K,V>>entrySet()Vget(java.lang.Object key)booleanisEmpty()java.util.Set<K>keySet()(package private) java.lang.ref.Reference<K>mildKey(K key)Vput(K key, V value)voidputAll(java.util.Map<? extends K,? extends V> m)Vremove(java.lang.Object key)intsize()(package private) static <K> java.lang.ref.Reference<K>tempKey(K key)java.util.Collection<V>values()
-
-
-
Method Detail
-
containsKey
public final boolean containsKey(java.lang.Object key)
-
containsValue
public final boolean containsValue(java.lang.Object value)
-
remove
public final V remove(java.lang.Object key)
-
values
public final java.util.Collection<V> values()
-
mildKey
final java.lang.ref.Reference<K> mildKey(K key)
- Returns:
- Soft or weak
Referencefor the given key.
-
tempKey
static final <K> java.lang.ref.Reference<K> tempKey(K key)
- Returns:
- Temporary
Referencefor the given key; used in queries.
-
compact
final void compact()
Compacts the map by removing cleared keys.
-
-