public class KeyedSets<K extends java.lang.Comparable,V>
extends java.util.HashMap<K,java.util.Set<V>>
This class extends HashMap to allow each key to take a HashSet of values.
Constructor and Description |
---|
KeyedSets()
Create a keyed sets object.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<V> |
add(K key,
V value)
Add an entry to set for a key.
|
java.util.Set<V> |
addAll(K key,
java.util.Collection<V> collection)
Add all entries from a collection to set for a key.
|
boolean |
contains(java.lang.Object key,
V value)
Check if entry exists in set for specified key.
|
boolean |
remove(K key,
V value)
Remove an entry from set for a key.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
public boolean contains(java.lang.Object key, V value)
key
- The key.value
- Value to check.public java.util.Set<V> addAll(K key, java.util.Collection<V> collection)
key
- The key.collection
- Collection whose entries should be added.public java.util.Set<V> add(K key, V value)
key
- The key.value
- Value to add to key's set.