public class SharedMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V> extends java.lang.Object implements ISharedMapMultimap<T,K,V>
Constructor and Description |
---|
SharedMapMultimap()
Default constructor
|
SharedMapMultimap(java.lang.Class<?> keyType,
java.lang.Class<?> subkeyType,
java.lang.Class<?> valueType)
Constructor initializes with generic type parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the entire multimap
|
boolean |
contains(T key,
K subkey)
Returns true if the map contains a key
|
boolean |
containsKey(T key)
Returns true if the map contains a key
|
boolean |
containsSubkey(K key)
Returns true if the map contains a sub-key
|
boolean |
containsValue(V value)
Returns true if the map contains a value
|
V |
get(T key,
K subkey)
Returns the first occurrence of a key/sub-key tuple.
|
java.lang.Iterable<V> |
getAllValues(T key)
Returns all values held under a key's sub-keys.
|
java.lang.Class<?> |
getGenericTypeParameterKey()
Returns the T generic type parameter's class.
|
java.lang.Class<?> |
getGenericTypeParameterSubKey()
Returns the K generic type parameter's class.
|
java.lang.Class<?> |
getGenericTypeParameterValue()
Returns the V generic type parameter's class.
|
java.util.Map<K,V> |
getKey(T key)
Returns the sub-map of a key which stores sub-keys -> values.
|
V |
getValueBySubkey(K subkey)
Returns the first value of a key's sub-key.
|
java.lang.Iterable<V> |
getValuesBySubkey(K subkey)
Returns all values under a key's sub-key.
|
boolean |
isEmpty()
Returns true if the map is empty, false otherwise
|
java.util.Iterator<Triple<T,K,V>> |
iterator() |
java.util.NavigableSet<T> |
keySet()
Returns the key set
|
V |
put(T key,
K subkey,
V value)
Inserts a key/subkey/value tuple.
|
V |
putIfAbsent(T key,
K subkey,
V value)
Inserts a key/subkey/value tuple, if it is absent, returning null.
|
V |
remove(T key,
K subkey)
Removes a key/sub-key tuple value.
|
java.util.concurrent.ConcurrentNavigableMap<K,V> |
removeKey(T key)
Removes a key's sub-key->value map.
|
V |
removeSubKey(K subkey)
Removes the first occurrence of a sub-key.
|
V[] |
removeSubKeys(K subkey)
Removes all occurrences of a sub-key.
|
int |
size()
Returns the T,K,V tuple size that is returned when iterating over this multimap
|
int |
size(T key)
Returns the size of a sub-map
|
java.lang.Iterable<K> |
subkeys()
Returns all sub-keys, or an empty iterable if no sub-keys exist
|
java.lang.String |
toString() |
java.lang.Iterable<V> |
values()
Returns all values, or an empty iterable if no values exist
|
public SharedMapMultimap()
SuperTypeTokenException
- When called without using anonymous class semantics.public SharedMapMultimap(java.lang.Class<?> keyType, java.lang.Class<?> subkeyType, java.lang.Class<?> valueType)
java.lang.NullPointerException
- When the generic type parameter is null.public int size()
public int size(T key)
public boolean isEmpty()
public boolean containsKey(T key)
containsKey
in interface IMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public boolean containsSubkey(K key)
containsSubkey
in interface IMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public boolean containsValue(V value)
containsValue
in interface IMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public V get(T key, K subkey)
public java.util.Map<K,V> getKey(T key)
public java.lang.Iterable<V> getAllValues(T key)
getAllValues
in interface IMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public V getValueBySubkey(K subkey)
getValueBySubkey
in interface IMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public java.lang.Iterable<V> getValuesBySubkey(K subkey)
getValuesBySubkey
in interface IMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public V put(T key, K subkey, V value)
public V putIfAbsent(T key, K subkey, V value)
putIfAbsent
in interface ISharedMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public V remove(T key, K subkey)
public java.util.concurrent.ConcurrentNavigableMap<K,V> removeKey(T key)
public V removeSubKey(K subkey)
removeSubKey
in interface IMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public V[] removeSubKeys(K subkey)
removeSubKeys
in interface IMapMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public void clear()
public java.util.NavigableSet<T> keySet()
public java.lang.Iterable<K> subkeys()
public java.lang.Iterable<V> values()
public java.lang.Class<?> getGenericTypeParameterKey()
getGenericTypeParameterKey
in interface ReifiedMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public java.lang.Class<?> getGenericTypeParameterSubKey()
getGenericTypeParameterSubKey
in interface ReifiedMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public java.lang.Class<?> getGenericTypeParameterValue()
getGenericTypeParameterValue
in interface ReifiedMultimap<T extends java.lang.Comparable<? super T>,K extends java.lang.Comparable<? super K>,V>
public java.lang.String toString()
toString
in class java.lang.Object