|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hp.hpl.jena.util.OneToManyMap
public class OneToManyMap
An extension to a standard map that supports one-to-many mappings: that is, there may be zero, one or many values corresponding to a given key.
Nested Class Summary | |
---|---|
class |
OneToManyMap.Entry
Helper class to implement the Map.Entry interface to enumerate entries in the map |
Constructor Summary | |
---|---|
OneToManyMap()
Construct a new empty one-to-many map |
|
OneToManyMap(OneToManyMap map)
Construct a new one-to-many map whose contents are initialised from the existing map. |
Method Summary | |
---|---|
void |
clear()
Clear all entries from the map. |
boolean |
containsKey(Object key)
Answer true if the map contains the given value as a key. |
boolean |
containsValue(Object value)
Answer true if the map contains the given object as a value stored against any key. |
Set |
entrySet()
Answer a set of the mappings in this map. |
boolean |
equals(Object o)
Compares the specified object with this map for equality. |
Object |
get(Object key)
Get a value for this key. |
Iterator |
getAll(Object key)
Answer an iterator over all of the values for the given key. |
int |
hashCode()
Returns the hash code value for this map. |
boolean |
isEmpty()
Answer true if the map is empty of key-value mappings. |
Set |
keySet()
Answer a set of the keys in this map |
Object |
put(Object key,
Object value)
Associates the given value with the given key. |
void |
putAll(Map m)
Put all entries from one map into this. |
Object |
remove(Object key)
Remove all of the associations for the given key. |
void |
remove(Object key,
Object value)
Remove the specific association between the given key and value. |
int |
size()
Answer the number of key-value mappings in the map |
Collection |
values()
Returns a collection view of the values contained in this map. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OneToManyMap()
Construct a new empty one-to-many map
public OneToManyMap(OneToManyMap map)
Construct a new one-to-many map whose contents are initialised from the existing map.
map
- An existing one-to-many mapMethod Detail |
---|
public void clear()
clear
in interface Map
public boolean containsKey(Object key)
containsKey
in interface Map
key
- The key object to test for
public boolean containsValue(Object value)
containsValue
in interface Map
value
- The value to test for
public Set entrySet()
entrySet
in interface Map
public boolean equals(Object o)
equals
in interface Map
equals
in class Object
o
- The object to be compared for equality with this map.
public Object get(Object key)
get
in interface Map
key
- The key to access the map.
getAll(java.lang.Object)
public Iterator getAll(Object key)
key
- The key object
public int hashCode()
hashCode
in interface Map
hashCode
in class Object
public boolean isEmpty()
isEmpty
in interface Map
public Set keySet()
keySet
in interface Map
public Object put(Object key, Object value)
put
in interface Map
key
- The key objectvalue
- The value object
public void putAll(Map m) throws UnsupportedOperationException
putAll
in interface Map
UnsupportedOperationException
public Object remove(Object key)
remove( java.lang.Object, java.lang.Object )
instead. Has no effect if the key is not present in the map. Since no
single specific association with the key is defined, this method always
returns null.
remove
in interface Map
key
- All associations with this key will be removed.public void remove(Object key, Object value)
key
- The key objectvalue
- The value objectpublic int size()
size
in interface Map
public Collection values()
values
in interface Map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |