public class CollectorDictionary<K,V>
extends java.lang.Object
implements java.util.Map<K,java.util.List<V>>
Constructor and Description |
---|
CollectorDictionary()
Initialize the new instance with default values.
|
CollectorDictionary(boolean allowDuplicates)
Initialize the new instance with default values.
|
CollectorDictionary(int initialCapacity)
Initialize the new instance with default values.
|
Modifier and Type | Method and Description |
---|---|
void |
add(K key,
V value)
Adds a single value to the key.
|
void |
addAll(K key,
java.util.Collection<V> values)
Adds all values in the given collection to the key.
|
void |
addAll(K key,
V... values)
Stores the given values under the specified key object.
|
void |
addAll(java.util.Map<K,V> map)
Adds all entries of the given map.
|
void |
clear()
Removes all mappings from this map (optional operation).
|
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key.
|
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value.
|
java.util.Set<java.util.Map.Entry<K,java.util.List<V>>> |
entrySet()
Returns a set view of the mappings contained in this map.
|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this map for equality.
|
java.util.List<V> |
get(java.lang.Object key) |
boolean |
getAcceptDuplicates() |
protected java.util.Map<K,java.util.List<V>> |
getObjectDictionary() |
protected java.util.List<V> |
getValues(K key) |
int |
hashCode()
Returns the hash code value for this map.
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
java.util.Iterator<K> |
keys()
Returns an iterator over all key objects in this map.
|
java.util.Set<K> |
keySet()
Returns a set view of the keys contained in this map.
|
protected java.util.List<V> |
newValue() |
protected java.util.List<V> |
newValueWith(V obj) |
java.util.List<V> |
put(K key,
java.util.List<V> list)
Stores the given value list under the specified key object.
|
void |
putAll(java.util.Map<? extends K,? extends java.util.List<V>> m)
This method is actually not supported.
|
protected void |
putAll(java.lang.Object key,
java.util.Collection<java.util.List<V>> values)
Not supported - use
|
java.util.List<V> |
remove(java.lang.Object key)
Removes the mapping for this key from this map if present.
|
void |
setAcceptDuplicates(boolean newValue) |
protected void |
setObjectDictionary(java.util.Map<K,java.util.List<V>> newValue) |
int |
size()
Returns the number of key-value mappings in this map.
|
java.util.Collection<java.util.List<V>> |
values()
Returns a collection view of the values contained in this map.
|
int |
valuesSize()
Returns the number of all values in all entries.
|
public CollectorDictionary()
public CollectorDictionary(int initialCapacity)
public CollectorDictionary(boolean allowDuplicates)
public boolean getAcceptDuplicates()
public void setAcceptDuplicates(boolean newValue)
public void clear()
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public java.util.Set<java.util.Map.Entry<K,java.util.List<V>>> entrySet()
public boolean equals(java.lang.Object obj)
public int hashCode()
public boolean isEmpty()
public java.util.Set<K> keySet()
public void addAll(K key, V... values)
public java.util.List<V> put(K key, java.util.List<V> list)
public void addAll(K key, java.util.Collection<V> values)
public void putAll(java.util.Map<? extends K,? extends java.util.List<V>> m)
addAll(Map)
instead.public java.util.List<V> remove(java.lang.Object key)
public int size()
public java.util.Collection<java.util.List<V>> values()
public java.util.List<V> get(java.lang.Object key)
public java.util.Iterator<K> keys()
public int valuesSize()
protected java.util.List<V> newValue()
protected void putAll(java.lang.Object key, java.util.Collection<java.util.List<V>> values)
java.lang.UnsupportedOperationException