|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MultiMap<K,V>
This interface declares a map that permits duplicate keys, but no duplicate key->value pairs, i.e. a key can map to an arbitrary set of values wherein no value occurs more than once
| Method Summary | |
|---|---|
MultiMap<K,V> |
copy()
Returns a copy of the map. |
Set<java.util.Map.Entry<K,V>> |
entries()
Returns a set representing all the key->value pairs in this map. |
MultiSet<K> |
keys()
Returns a set representing all the keys in the domain of this map. |
V |
put(K key,
V val)
Ensures that the provided key binds to the provided value, removing any existing key->value pair where the key is equal to the one provided. |
V |
putIfAbsent(K key,
V val)
Attempts to bind the provided key to the provided value. |
Set<V> |
values(K key)
Returns a set representing the values associated with the provided key in this map. |
| Methods inherited from interface org.jjoost.collections.AnyMap |
|---|
add, clear, clearAndReturn, inverse, remove, remove, removeAndReturn, removeAndReturn, removeAndReturnFirst, shrink, values |
| Methods inherited from interface org.jjoost.collections.AnyReadMap |
|---|
contains, contains, count, count, entries, first, isEmpty, list, permitsDuplicateKeys, totalCount, uniqueKeyCount |
| Methods inherited from interface org.jjoost.util.Function |
|---|
apply |
| Method Detail |
|---|
V put(K key,
V val)
put in interface AnyMap<K,V>key - the keyval - the val
V putIfAbsent(K key,
V val)
putIfAbsent in interface AnyMap<K,V>key - the keyval - the val
Set<V> values(K key)
AnyReadMap
Note that in a regular (scalar) map the set returned will be a
UnitarySet, which contains at most one value.
put() operations on such a set will override any existing
value regardless of if it is equal to the one already present.
values in interface AnyMap<K,V>values in interface AnyReadMap<K,V>MultiSet<K> keys()
AnyReadMapMultiMap or ListMap this will be a
MultiSet. This set should always reflect changes to the map,
and changes to the set should be reflected in the map also. Otherwise,
this set should behave exactly as a regular set does. The key equality used
by this map can be obtained from this set.
Depending on the implementation of map, this key set may contain every occurrence of equal keys provided to the map, or may contain a subset thereof with repetitions to bring the number of occurrences in line with the number provided.
Note that the put() methods on this set will always fail,
because no value can be provided to update the map with.
keys in interface AnyMap<K,V>keys in interface AnyReadMap<K,V>Set<java.util.Map.Entry<K,V>> entries()
AnyReadMapListMap this will be a MultiSet. This set
should always reflect changes to the map, and changes to the set should
be reflected in the map also. Otherwise, this set should behave exactly
as a regular set does.
entries in interface AnyMap<K,V>entries in interface AnyReadMap<K,V>MultiMap<K,V> copy()
AnyMap
copy in interface AnyMap<K,V>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||