|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OneToManyMap
An extension of java.util.Map
that represents a mapping
from a key to a set of values. In addition to the standard
java.util.Map
methods this interface also provides several useful
methods for directly accessing the values rather than having to access values
via a java.util.Set
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry |
Method Summary | |
---|---|
boolean |
containsSingleValue(java.lang.Object value)
This method returns true if any of the value sets in the
OneToManyMap contains an equivalent object to the value
parameter, where equivalence is determined using the
equals(Object) method. |
java.util.Set |
entries()
This method is similar to the java.util.Map.entrySet()
method, however the entries returned map from a key to a value, rather
than from a key(K ) to a value(V ) rather than
froma key(K ) to a set of values(Set<V> ). |
java.util.Collection |
flatValues()
Returns a Collection of all the values in the map. |
void |
putAllSingleValues(java.util.Map m)
This method is similar to java.utilMap.putAll(Map m) ,
however the map specified is from keys to values instead of keys to sets
of values. |
java.lang.Object |
putSingleValue(java.lang.Object key,
java.lang.Object value)
This method is similar to the method java.util.Map.put(K, V)
, however it allows the user to add a single value to the map rather than
adding a java.util.Set containing one or more values. |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Method Detail |
---|
boolean containsSingleValue(java.lang.Object value)
true
if any of the value sets in the
OneToManyMap contains an equivalent object to the value
parameter, where equivalence is determined using the
equals(Object)
method.
value
- The value being searched for.
true
if any of the value sets contains a
matching value, otherwise returns false
java.util.Set entries()
java.util.Map.entrySet()
method, however the entries returned map from a key to a value, rather
than from a key(K
) to a value(V
) rather than
froma key(K
) to a set of values(Set<V>
). java.util.Map.Entry.setValue(V)
.
Set<Entry<K, V>> representing all the key-value pairs in the ManyToOneMap.
java.lang.Object putSingleValue(java.lang.Object key, java.lang.Object value)
java.util.Map.put(K, V)
, however it allows the user to add a single value to the map rather than
adding a java.util.Set
containing one or more values. If the
specified key already has a set of values associated with it then the new
value is added to this set. Otherwise a new set is created and the new
value is added to that.
key
- value
-
void putAllSingleValues(java.util.Map m)
java.utilMap.putAll(Map m)
,
however the map specified is from keys to values instead of keys to sets
of values.
m
- A map containing the key-value mappings to be added to the
ManyToOneMap.java.util.Collection flatValues()
values()
the values are in a single flattened
Collection<V>
rather than a
Collection<Set<V>>
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |