public class TwoWayMultiCollection extends MultiCollection
Constructor and Description |
---|
TwoWayMultiCollection()
Create a two way map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all mappings from this map.
|
TwoWayMultiCollection |
getReverseMultiCollection()
Get the reverse multi-collection.
|
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map
(optional operation).
|
Object |
remove(Object key)
Removes the mapping for this key from this map if it is present.
|
void |
remove(Object key,
Object value)
Remove a special object from the
collection of a defined key.
|
clone, containsKey, containsValue, entrySet, equals, get, getCollection, getKeys, getKeys, getObjects, getObjects, hashCode, isEmpty, keySet, putAll, putCollection, size, toString, values
public TwoWayMultiCollection getReverseMultiCollection()
public Object put(Object key, Object value)
m.containsKey(k)
would return
true.))put
in interface Map
put
in class MultiCollection
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.UnsupportedOperationException
- if the put operation is
not supported by this map.ClassCastException
- if the class of the specified key or value
prevents it from being stored in this map.IllegalArgumentException
- if some aspect of this key or value
prevents it from being stored in this map.NullPointerException
- this map does not permit null
keys or values, and the specified key or value is
null.public void clear()
clear
in interface Map
clear
in class MultiCollection
public Object remove(Object key)
(key==null ? k==null : key.equals(k))
, that mapping
is removed. (The map can contain at most one such mapping.)
Returns the value to which the map previously associated the key, or null if the map contained no mapping for this key. (A null return can also indicate that the map previously associated null with the specified key if the implementation supports null values.) The map will not contain a mapping for the specified key once the call returns.
remove
in interface Map
remove
in class MultiCollection
key
- key whose mapping is to be removed from the map.ClassCastException
- if the key is of an inappropriate type for
this map (optional).NullPointerException
- if the key is null and this map
does not not permit null keys (optional).public void remove(Object key, Object value)
remove
in class MultiCollection
Copyright © 2013. All Rights Reserved.