public final class HashSetMap<K,V> extends Object implements CollectionMap<K,V,Set<V>>
Constructor and Description |
---|
HashSetMap() |
HashSetMap(int size) |
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,Set<V>>> |
entrySet() |
Set<V> |
get(Object key) |
Collection<Set<V>> |
getAllCollections() |
Set<V> |
getCollection(K key)
gets a collection mapped with key.
|
Set<V> |
getOrCreateCollection(K key)
obtains a collection mapped with key.
|
boolean |
isEmpty() |
Iterator<Map.Entry<K,Set<V>>> |
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
|
Set<V> |
put(K key,
Set<V> value) |
void |
putAll(Map<? extends K,? extends Set<V>> map) |
Set<V> |
remove(Object key) |
void |
removeValue(K key,
V value)
removes value from a collection mapped with key
|
int |
size() |
Map<K,Set<V>> |
toSimpleMap()
Copy of this object as a simple (java.util.Collection) map of Collection
|
Collection<Set<V>> |
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 HashSetMap()
public HashSetMap(int size)
size
- initial size of the HashSetMappublic Collection<Set<V>> getAllCollections()
getAllCollections
in interface CollectionMap<K,V,Set<V>>
public Set<V> getCollection(K key)
getCollection
in interface CollectionMap<K,V,Set<V>>
key
- key for internal collectionpublic Set<V> getOrCreateCollection(K key)
getOrCreateCollection
in interface CollectionMap<K,V,Set<V>>
key
- key for internal collectionpublic boolean containsValue(K key, V value)
containsValue
in interface CollectionMap<K,V,Set<V>>
key
- key for internal collectionvalue
- value to check in internal collectionpublic boolean placeValue(K key, V value)
placeValue
in interface CollectionMap<K,V,Set<V>>
key
- key for internal collectionvalue
- value to placeValue in internal collectionpublic boolean placeMap(Map<K,V> map)
public void removeValue(K key, V value)
removeValue
in interface CollectionMap<K,V,Set<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,Set<V>>
key
- key for internal collectioncollection
- collection of values to place in internal collectionpublic void clearCollection(K key)
clearCollection
in interface CollectionMap<K,V,Set<V>>
key
- key for internal collectionpublic boolean containsKey(Object key)
containsKey
in interface Map<K,Set<V>>
public boolean containsValue(Object value)
containsValue
in interface Map<K,Set<V>>
public Map<K,Set<V>> toSimpleMap()
toSimpleMap
in interface CollectionMap<K,V,Set<V>>
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.