KEYTYPE1 - outer key typeKEYTYPE2 - inner key typeVALUETYPE - value type@NotThreadSafe public abstract class AbstractMultiHashMapMapBased<KEYTYPE1,KEYTYPE2,VALUETYPE> extends HashMap<KEYTYPE1,Map<KEYTYPE2,VALUETYPE>> implements IMultiMapMapBased<KEYTYPE1,KEYTYPE2,VALUETYPE>
HashMap.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
AbstractMultiHashMapMapBased() |
AbstractMultiHashMapMapBased(KEYTYPE1 aKey,
KEYTYPE2 aInnerKey,
VALUETYPE aValue) |
AbstractMultiHashMapMapBased(KEYTYPE1 aKey,
Map<KEYTYPE2,VALUETYPE> aValue) |
AbstractMultiHashMapMapBased(Map<? extends KEYTYPE1,? extends Map<KEYTYPE2,VALUETYPE>> aCont) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsSingle(KEYTYPE1 aKey,
KEYTYPE2 aInnerKey)
Check a single element from the container identified by the passed keys is
present.
|
protected abstract Map<KEYTYPE2,VALUETYPE> |
createNewInnerMap() |
Map<KEYTYPE2,VALUETYPE> |
getOrCreate(KEYTYPE1 aKey)
Get or create the collection of the specified key.
|
VALUETYPE |
getSingle(KEYTYPE1 aKey,
KEYTYPE2 aInnerKey)
Get a single value from the container identified by the passed keys.
|
long |
getTotalValueCount() |
EChange |
putAllIn(Map<? extends KEYTYPE1,? extends Map<KEYTYPE2,VALUETYPE>> aMap)
Add all values into the container identified by the passed key-value-map.
|
EChange |
putSingle(KEYTYPE1 aKey,
KEYTYPE2 aInnerKey,
VALUETYPE aValue)
Add a single value into the container identified by the passed key.
|
EChange |
removeSingle(KEYTYPE1 aKey,
KEYTYPE2 aInnerKey)
Remove a single element from the container identified by the passed key.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, valuesequals, hashCode, toStringpublic AbstractMultiHashMapMapBased()
public AbstractMultiHashMapMapBased(@Nullable KEYTYPE1 aKey, @Nullable KEYTYPE2 aInnerKey, @Nullable VALUETYPE aValue)
public AbstractMultiHashMapMapBased(@Nullable KEYTYPE1 aKey, @Nullable Map<KEYTYPE2,VALUETYPE> aValue)
@Nonnull public Map<KEYTYPE2,VALUETYPE> getOrCreate(@Nullable KEYTYPE1 aKey)
IMultiMapMapBasedgetOrCreate in interface IMultiMapMapBased<KEYTYPE1,KEYTYPE2,VALUETYPE>aKey - The key to use. May not be null.null.@Nonnull public final EChange putSingle(@Nullable KEYTYPE1 aKey, @Nullable KEYTYPE2 aInnerKey, @Nullable VALUETYPE aValue)
IMultiMapMapBased@Nonnull public final EChange putAllIn(@Nonnull Map<? extends KEYTYPE1,? extends Map<KEYTYPE2,VALUETYPE>> aMap)
IMultiMapMapBased@Nonnull public final EChange removeSingle(@Nullable KEYTYPE1 aKey, @Nullable KEYTYPE2 aInnerKey)
IMultiMapMapBasedremoveSingle in interface IMultiMapMapBased<KEYTYPE1,KEYTYPE2,VALUETYPE>aKey - The key to use. May not be null.aInnerKey - The key for the inner map to be removed. May be null.EChange@Nullable public final VALUETYPE getSingle(@Nonnull KEYTYPE1 aKey, @Nonnull KEYTYPE2 aInnerKey)
IMultiMapMapBasedgetSingle in interface IMultiMapMapBased<KEYTYPE1,KEYTYPE2,VALUETYPE>aKey - The key to use. May not be null.aInnerKey - The key for the inner map to use. May not be null.null if no such value exists.public final boolean containsSingle(@Nullable KEYTYPE1 aKey, @Nullable KEYTYPE2 aInnerKey)
IMultiMapMapBasedcontainsSingle in interface IMultiMapMapBased<KEYTYPE1,KEYTYPE2,VALUETYPE>aKey - The key to use. May not be null.aInnerKey - The key of the inner map to be checked. May be null.true if contained, false otherwise.@Nonnegative public final long getTotalValueCount()
getTotalValueCount in interface IMultiMapMapBased<KEYTYPE1,KEYTYPE2,VALUETYPE>Copyright © 2014–2015 Philip Helger. All rights reserved.