@Immutable public final class ImmutableCollectionMap<K,V,T extends Collection<V>> extends Object implements CollectionMap<K,V,T>
Constructor and Description |
---|
ImmutableCollectionMap(CollectionMap<K,V,T> collectionMap) |
Modifier and Type | Method and Description |
---|---|
<C extends 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(Object key) |
boolean |
containsValue(K key,
V value)
check the collection map for a key and value combination
|
boolean |
containsValue(Object value) |
Set<Map.Entry<K,T>> |
entrySet() |
T |
get(Object key) |
Collection<T> |
getAllCollections() |
T |
getCollection(K key)
gets a collection mapped with key.
|
T |
getOrCreateCollection(K key)
obtains a collection mapped with key.
|
boolean |
isEmpty() |
Iterator<Map.Entry<K,T>> |
iterator() |
Set<K> |
keySet() |
boolean |
placeMap(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
|
T |
put(K key,
T value) |
void |
putAll(Map<? extends K,? extends T> map) |
T |
remove(Object key) |
void |
removeValue(K key,
V value)
removes value from a collection mapped with key
|
int |
size() |
Map<K,T> |
toSimpleMap()
Copy of this object as a simple (java.util.Collection) map of Collection
|
Collection<T> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
forEach, spliterator
public ImmutableCollectionMap(CollectionMap<K,V,T> collectionMap)
public Collection<T> getAllCollections()
getAllCollections
in interface CollectionMap<K,V,T extends Collection<V>>
public T getCollection(K key)
getCollection
in interface CollectionMap<K,V,T extends Collection<V>>
key
- key for internal collectionpublic T getOrCreateCollection(K key)
getOrCreateCollection
in interface CollectionMap<K,V,T extends Collection<V>>
key
- key for internal collectionpublic boolean containsValue(K key, V value)
containsValue
in interface CollectionMap<K,V,T extends Collection<V>>
key
- key for internal collectionvalue
- value to check in internal collectionpublic boolean placeValue(K key, V value)
placeValue
in interface CollectionMap<K,V,T extends Collection<V>>
key
- key for internal collectionvalue
- value to placeValue in internal collectionpublic boolean placeMap(Map<K,V> map)
placeMap
in interface CollectionMap<K,V,T extends Collection<V>>
map
- map to storepublic void removeValue(K key, V value)
removeValue
in interface CollectionMap<K,V,T extends Collection<V>>
key
- key for internal collectionvalue
- value to remove from internal collectionpublic <C extends Collection<V>> int addAllValues(K key, C collection)
addAllValues
in interface CollectionMap<K,V,T extends Collection<V>>
key
- key for internal collectioncollection
- collection of values to place in internal collectionpublic void clearCollection(K key)
clearCollection
in interface CollectionMap<K,V,T extends Collection<V>>
key
- key for internal collectionpublic boolean containsKey(Object key)
containsKey
in interface Map<K,T extends Collection<V>>
public boolean containsValue(Object value)
containsValue
in interface Map<K,T extends Collection<V>>
public Collection<T> values()
public Map<K,T> toSimpleMap()
toSimpleMap
in interface CollectionMap<K,V,T extends Collection<V>>
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.