SetValuedMap interface to simplify the
creation of subclass implementations.
Subclasses specify a Map implementation to use as the internal storage and the Set implementation to use as values.
| Modifier and Type | Class and Description |
|---|---|
| private class | AbstractSetValuedMap.WrappedSet
Wrapped set to handle add and remove on the collection returned by
|
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | AbstractSetValuedMap(final Map<K, ? extends Set<V>>
the map to wrap, must not be null map)A constructor that wraps, not copies |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract Set | Returns: a new listImplements abstract org. |
| public Set | Returns: theSet of values, will return an empty
Set for no mappingthe key to retrieve key)Overrides org. Implements org. |
| protected Map | getMap()
Overrides org. |
| public Set | Returns: theSet of values removed, will return an empty,
unmodifiable set for no mapping found.the key to remove values from key)Overrides org. Implements org. |
| pack-priv Set |
| AbstractSetValuedMap | back to summary |
|---|---|
| protected AbstractSetValuedMap() Constructor needed for subclass serialisation. | |
| AbstractSetValuedMap | back to summary |
|---|---|
| protected AbstractSetValuedMap(final Map<K, ? extends Set<V>> map) A constructor that wraps, not copies
| |
| createCollection | back to summary |
|---|---|
| protected abstract Set Implements abstract org. Creates a new value collection using the provided factory. | |
| get | back to summary |
|---|---|
| public Set Overrides org. Implements org. Gets the set of values associated with the specified key. This would return an empty set in case the mapping is not present | |
| getMap | back to summary |
|---|---|
| protected Map Overrides org. Doc from org. Gets the map being wrapped.
| |
| remove | back to summary |
|---|---|
| public Set Overrides org. Implements org. Removes all values associated with the specified key.
A subsequent | |
| wrappedCollection | back to summary |
|---|---|
| pack-priv Set Overrides org.
| |
get(Object).
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(final Object
object to be compared for equality with this set other)Overrides java. Implements java. |
| public int | hashCode()
Overrides java. Implements java. |
| WrappedSet | back to summary |
|---|---|
| public WrappedSet(final K key) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object other) Overrides java. Implements java. Doc from java. Compares the specified object with this set for equality. Returns
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this set. The hash code of a set is
defined to be the sum of the hash codes of the elements in the set,
where the hash code of a
| |