| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final long | serialVersionUID
For serialization |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private final List | |
| public final void | add(K
key to store the entry under k, V value to store in the k's values. v)Adds one more key-value pair. |
| public MultiMap | clone()
Overrides java. Creates a copy of the map that contains the exact same key and value set. |
| public boolean | Returns: true if the map contains at least one element for these keyskey from top collection k1, V key (value) from inner collection k2)Checks if the map contains the given key(s), also extending the search to including the sub collection. |
| public boolean | Returns: true if the map contains at least one element for this keykey to test k)Checks if the map contains the given key. |
| public Set | |
| public boolean | equals(Object another)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public final List | Returns: Can be empty but never null. Read-only.key for the values k)Returns the elements indexed by the provided key |
| private V | |
| public V | Returns: null if the key has no values or it has a value but the value is null.key for the values k)Gets the first value if any, or null. |
| public int | |
| public Set | Returns: The set of keys currently available in this MultiMap. Will not return null, but may return a Set of lenght zeroReturns the set of keys associated with this MultiMap |
| public void | |
| private List | newList(Collection<? extends V> initialVals)
Creates an optionally populated list to be used as an entry in the map. |
| public List | Returns: the value stored under this key or null if there was nonekey to be removed key)Removes an key value from the map |
| public boolean | Returns: true if there was none that was deletedkey to be removed key, V the entry to be removed from the key'ed list entry)Removes an key value pair from the map. |
| public void | set(K
key for the values k, Collection<? extends V> Can be null or empty. v)Replaces all the existing values associated with the key by the given value. |
| public void | set(K
key for the values k, V singleton value for k key
v)This is short for set(k,Collections.singleton(v)) Replaces all the existing values associated with the key by the given single value. |
| public int | |
| public String | |
| public String |
| NEWLINE | back to summary |
|---|---|
| private static final String NEWLINE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID For serialization | |
| store | back to summary |
|---|---|
| private final Map<K, List<V>> store | |
| MultiMap | back to summary |
|---|---|
| public MultiMap() Creates an empty multi-map with default concurrency controls | |
| MultiMap | back to summary |
|---|---|
| public MultiMap(MultiMap<K, V> base) Copy constructor.
| |
| _get | back to summary |
|---|---|
| private final List Package private (for getting the raw map for direct manipulation by the habitat)
| |
| add | back to summary |
|---|---|
| public final void add(K k, V v) Adds one more key-value pair.
| |
| clone | back to summary |
|---|---|
| public MultiMap Overrides java. Creates a copy of the map that contains the exact same key and value set. Keys and values won't cloned.
| |
| contains | back to summary |
|---|---|
| public boolean contains(K k1, V k2) Checks if the map contains the given key(s), also extending the search to including the sub collection.
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(K k) Checks if the map contains the given key.
| |
| entrySet | back to summary |
|---|---|
| public Set Lists up all entries.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object another) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| get | back to summary |
|---|---|
| public final List Returns the elements indexed by the provided key
| |
| getFirst | back to summary |
|---|---|
| private V getFirst(K k) | |
| getOne | back to summary |
|---|---|
| public V getOne(K k) Gets the first value if any, or null. This is useful when you know the given key only has one value and you'd like to get to that value.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| keySet | back to summary |
|---|---|
| public Set Returns the set of keys associated with this MultiMap
| |
| mergeAll | back to summary |
|---|---|
| public void mergeAll(MultiMap<K, V> another) This method merges all of the keys and values from another MultiMap into this MultiMap. If a key/value pair is found in both MultiMaps it is not re-added to this MultiMap, but is instead discarded
| |
| newList | back to summary |
|---|---|
| private List Creates an optionally populated list to be used as an entry in the map. | |
| remove | back to summary |
|---|---|
| public List Removes an key value from the map
| |
| remove | back to summary |
|---|---|
| public boolean remove(K key, V entry) Removes an key value pair from the map. If the list of entries for that key is empty after the remove it will be removed from the set of keys
| |
| set | back to summary |
|---|---|
| public void set(K k, Collection<? extends V> v) Replaces all the existing values associated with the key by the given value. If v is empty the key k will be removed from the MultiMap.
| |
| set | back to summary |
|---|---|
| public void set(K k, V v) Replaces all the existing values associated with the key by the given single value.
| |
| size | back to summary |
|---|---|
| public int size() Returns the size of the map. This returns the numbers of keys in the map, not the number of values
| |
| toCommaSeparatedString | back to summary |
|---|---|
public String toCommaSeparatedString()
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |