public final class ArrayListMap<K,V> extends java.lang.Object implements CollectionMap<K,V,java.util.List<V>>
Modifier and Type | Field and Description |
---|---|
private CollectionMap<K,V,java.util.List<V>> |
_delegate |
Constructor and Description |
---|
ArrayListMap() |
ArrayListMap(int size) |
Modifier and Type | Method and Description |
---|---|
<C extends java.util.Collection<V>> |
addAllValues(K key,
C collection)
adds everything from the given collection to the internal collection mapped with key
|
void |
clear() |
void |
clearCollection(K key)
clearCollection the collection mapped with key
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(K key,
V value)
check the collection map for a key and value combination
|
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,java.util.List<V>>> |
entrySet() |
java.util.List<V> |
get(java.lang.Object key) |
java.util.Collection<java.util.List<V>> |
getAllCollections() |
java.util.List<V> |
getCollection(K key)
gets a collection mapped with key.
|
boolean |
isEmpty() |
java.util.Iterator<java.util.Map.Entry<K,java.util.List<V>>> |
iterator() |
java.util.Set<K> |
keySet() |
java.util.List<V> |
obtainCollection(K key)
obtains a collection mapped with key.
|
boolean |
placeMap(java.util.Map<K,V> map)
places each value of a map into a collection mapped with the appropriate key
|
boolean |
placeValue(K key,
V value)
places value into a collection mapped with key
|
java.util.List<V> |
put(K key,
java.util.List<V> value) |
void |
putAll(java.util.Map<? extends K,? extends java.util.List<V>> map) |
java.util.List<V> |
remove(java.lang.Object key) |
void |
removeValue(K key,
V value)
removes value from a collection mapped with key
|
int |
size() |
java.util.Map<K,java.util.List<V>> |
toSimpleMap()
Copy of this object as a simple (java.util.Collection) map of Collection
|
java.util.Collection<java.util.List<V>> |
values() |
private final CollectionMap<K,V,java.util.List<V>> _delegate
public ArrayListMap()
public ArrayListMap(int size)
size
- initial size of the HashSetMappublic java.util.Collection<java.util.List<V>> getAllCollections()
getAllCollections
in interface CollectionMap<K,V,java.util.List<V>>
public java.util.List<V> getCollection(K key)
getCollection
in interface CollectionMap<K,V,java.util.List<V>>
key
- key for internal collectionpublic java.util.List<V> obtainCollection(K key)
obtainCollection
in interface CollectionMap<K,V,java.util.List<V>>
key
- key for internal collectionpublic boolean containsValue(K key, V value)
containsValue
in interface CollectionMap<K,V,java.util.List<V>>
key
- key for internal collectionvalue
- value to check in internal collectionpublic boolean placeValue(K key, V value)
placeValue
in interface CollectionMap<K,V,java.util.List<V>>
key
- key for internal collectionvalue
- value to placeValue in internal collectionpublic boolean placeMap(java.util.Map<K,V> map)
placeMap
in interface CollectionMap<K,V,java.util.List<V>>
map
- map to storepublic void removeValue(K key, V value)
removeValue
in interface CollectionMap<K,V,java.util.List<V>>
key
- key for internal collectionvalue
- value to remove from internal collectionpublic <C extends java.util.Collection<V>> int addAllValues(K key, C collection)
addAllValues
in interface CollectionMap<K,V,java.util.List<V>>
key
- key for internal collectioncollection
- collection of values to place in internal collectionpublic void clearCollection(K key)
clearCollection
in interface CollectionMap<K,V,java.util.List<V>>
key
- key for internal collectionpublic boolean isEmpty()
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public java.util.List<V> get(java.lang.Object key)
public java.util.List<V> remove(java.lang.Object key)
public java.util.Set<K> keySet()
public java.util.Collection<java.util.List<V>> values()
public java.util.Map<K,java.util.List<V>> toSimpleMap()
toSimpleMap
in interface CollectionMap<K,V,java.util.List<V>>