|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
CollectionMap is the interface for containers that implements the Collection interface but delegate to a Map class. CollectionMap retains the best feature of a Map which is the ability to locate an object quickly using a key. While a CollectionMap cannot be cast as a Map, the implementing class can choose to implement the map method which returns the underlying map.
The persistence framework only supports containers that implement the Collection interface. CollectionMap makes it possible to use a Map to model a 1:n association.
Method Summary | |
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified key. |
Object |
get(Object key)
Returns the value to which this map maps the specified key. |
Object |
makeKey(Object o)
Create a key to which a value can be associated. |
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map. |
Object |
removeKey(Object key)
Removes the mapping for the specified key from this collection. |
Methods inherited from interface Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
public boolean containsKey(Object key)
key
- key whose presence in this map is to be tested.
public Object get(Object key)
More formally, if this map contains a mapping from a key k to a value v such that (key==null ? k==null : key.equals(k)), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)
key
- key whose associated value is to be returned.
public Object makeKey(Object o)
o
- the value for which a key is to be computed.
public Object put(Object key, Object value)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
public Object removeKey(Object key)
key
- key whose mapping is to be removed from the collection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |