Class CommonsWeakHashMap<KEYTYPE,VALUETYPE>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.WeakHashMap<KEYTYPE,VALUETYPE>
-
- com.helger.commons.collection.impl.CommonsWeakHashMap<KEYTYPE,VALUETYPE>
-
- Type Parameters:
KEYTYPE- Map key typeVALUETYPE- Map value type
- All Implemented Interfaces:
ICommonsMap<KEYTYPE,VALUETYPE>,ICloneable<ICommonsMap<KEYTYPE,VALUETYPE>>,Map<KEYTYPE,VALUETYPE>
public class CommonsWeakHashMap<KEYTYPE,VALUETYPE> extends WeakHashMap<KEYTYPE,VALUETYPE> implements ICommonsMap<KEYTYPE,VALUETYPE>
A specialWeakHashMapimplementation based onICommonsMap.- Author:
- Philip Helger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description CommonsWeakHashMap()CommonsWeakHashMap(int nInitialCapacity)CommonsWeakHashMap(int nInitialCapacity, float fLoadFactor)CommonsWeakHashMap(Collection<? extends COLLTYPE> aValues, Function<? super COLLTYPE,? extends KEYTYPE> aKeyMapper, Function<? super COLLTYPE,? extends VALUETYPE> aValueMapper)CommonsWeakHashMap(Map<? extends KEYTYPE,? extends VALUETYPE> aMap)CommonsWeakHashMap(Map<? extends SRCKEYTYPE,? extends SRCVALUETYPE> aValues, Function<? super SRCKEYTYPE,? extends KEYTYPE> aKeyMapper, Function<? super SRCVALUETYPE,? extends VALUETYPE> aValueMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
CommonsWeakHashMap<K,V>createInstance()Create a new empty map.CommonsWeakHashMap<KEYTYPE,VALUETYPE>getClone()-
Methods inherited from class java.util.WeakHashMap
clear, containsKey, containsValue, entrySet, forEach, get, isEmpty, keySet, put, putAll, remove, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsMap
addAll, containsAnyEntry, containsAnyKey, containsAnyValue, copyOfEntrySet, copyOfKeySet, copyOfKeySet, copyOfValues, copyOfValues, copyOfValuesMapped, copyOfValuesMapped, findFirstEntry, findFirstKey, findFirstValue, forEach, forEachKey, forEachKey, forEachValue, forEachValue, getAsUnmodifiable, getFirstEntry, getFirstEntry, getFirstKey, getFirstKey, getFirstValue, getFirstValue, getSortedByKey, getSortedByValue, getSwappedKeyValues, isNotEmpty, put, putAll, putAll, putAllMapped, putAllMapped, putAllMapped, putIf, putIfNotNull, removeAll, removeIf, removeIfKey, removeIfValue, removeObject, setAll
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
CommonsWeakHashMap
public CommonsWeakHashMap()
-
CommonsWeakHashMap
public CommonsWeakHashMap(@Nonnegative int nInitialCapacity)
-
CommonsWeakHashMap
public CommonsWeakHashMap(@Nonnegative int nInitialCapacity, @Nonnegative float fLoadFactor)
-
CommonsWeakHashMap
public CommonsWeakHashMap(@Nullable Map<? extends KEYTYPE,? extends VALUETYPE> aMap)
-
CommonsWeakHashMap
public CommonsWeakHashMap(@Nullable Collection<? extends COLLTYPE> aValues, @Nonnull Function<? super COLLTYPE,? extends KEYTYPE> aKeyMapper, @Nonnull Function<? super COLLTYPE,? extends VALUETYPE> aValueMapper)
-
-
Method Detail
-
createInstance
@Nonnull @ReturnsMutableCopy public <K,V> CommonsWeakHashMap<K,V> createInstance()
Description copied from interface:ICommonsMapCreate a new empty map. Overwrite this if you don't want to useCommonsHashMap.- Specified by:
createInstancein interfaceICommonsMap<KEYTYPE,VALUETYPE>- Type Parameters:
K- Map key typeV- Map value type- Returns:
- A new empty map. Never
null.
-
getClone
@Nonnull @ReturnsMutableCopy public CommonsWeakHashMap<KEYTYPE,VALUETYPE> getClone()
- Specified by:
getClonein interfaceICloneable<KEYTYPE>- Returns:
- A 100% deep-copy of the implementing class.
-
-