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-safeMap
whose keys are kept alive by soft/weakReference
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
MildKeys.EntryItr
Iterator
that iterates over reachable entries in the map.(package private) class
MildKeys.KeyItr
Iterator
that iterates over reachable keys in the map.(package private) static class
MildKeys.Soft<T>
Soft key that maintains a constant hash and uses referential equality.(package private) class
MildKeys.StrongEntry
Map.Entry
that delegates to the original entry, but maintains a strong reference to the key.(package private) static class
MildKeys.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 void
clear()
(package private) void
compact()
Compacts the map by removing cleared keys.boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
V
get(java.lang.Object key)
boolean
isEmpty()
java.util.Set<K>
keySet()
(package private) java.lang.ref.Reference<K>
mildKey(K key)
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> m)
V
remove(java.lang.Object key)
int
size()
(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
Reference
for the given key.
-
tempKey
static final <K> java.lang.ref.Reference<K> tempKey(K key)
- Returns:
- Temporary
Reference
for the given key; used in queries.
-
compact
final void compact()
Compacts the map by removing cleared keys.
-
-