|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object AbstractCollectionMap
AbstractCollectionMap implements all methods of the CollectionMap interface except makeKey and is intended to be used as an abstract base class for containers that need Map capabilities.
Method Summary | |
boolean |
add(Object o)
Add an object to the underlying map. |
boolean |
addAll(Collection c)
Add a Collection of objects to the map. |
void |
clear()
Remove all elements from this collection. |
boolean |
contains(Object o)
Returns true if this collection contains the specified element. |
boolean |
containsAll(Collection c)
Returns true if this collection contains all of the elements in the specified collection. |
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified key. |
boolean |
equals(Object o)
Compares the specified object with this collection for equality. |
Object |
get(Object key)
Returns the value to which this map maps the specified key. |
int |
hashCode()
Returns the hash code for this collection. |
boolean |
isEmpty()
Returns true if this collection is empty. |
Iterator |
iterator()
Returns an iterator for this collection. |
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map. |
boolean |
remove(Object o)
Removes the specified element from this collection, if it is present. |
boolean |
removeAll(Collection c)
Remove a collection of objects from this collection. |
Object |
removeKey(Object key)
Removes the mapping for the specified key from this collection. |
boolean |
retainAll(Collection c)
Retains only the elements in this collection that are contained in the specified collection. |
int |
size()
Returns the number of elements in this collection. |
Object[] |
toArray()
Returns an array containing the elements of this collection. |
Object[] |
toArray(Object[] a)
Return an array containing the elements of this collection. |
String |
toString()
Returns a string representation of this collection. |
Methods inherited from class Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface CollectionMap |
makeKey |
Method Detail |
public String toString()
public boolean add(Object o)
add
in interface Collection
o
- the object to be added to the collection.
public boolean addAll(Collection c)
addAll
in interface Collection
c
- the collection to be added.
public void clear()
clear
in interface Collection
public boolean contains(Object o)
contains
in interface Collection
o
- the object to be found.
public boolean containsAll(Collection c)
containsAll
in interface Collection
c
- collection to be checked for containment in this collection.
public boolean equals(Object o)
equals
in interface Collection
o
- object to be compared for equality with this collection.
public int hashCode()
hashCode
in interface Collection
public boolean isEmpty()
isEmpty
in interface Collection
public Iterator iterator()
iterator
in interface Collection
public boolean remove(Object o)
remove
in interface Collection
o
- the object to be removed.
public boolean removeAll(Collection c)
removeAll
in interface Collection
c
- the collection of objects to be removed.
public boolean retainAll(Collection c)
retainAll
in interface Collection
c
- the collection of objects to be retained.
public int size()
size
in interface Collection
public Object[] toArray()
toArray
in interface Collection
public Object[] toArray(Object[] a)
toArray
in interface Collection
a
- the array into which the elements of this hash map are to
be stored, if it is large enough; otherwise, a new array of
the same runtime type is allocated for this purpose.
public boolean containsKey(Object key)
containsKey
in interface CollectionMap
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.)
get
in interface CollectionMap
key
- key whose associated value is to be returned.
public Object put(Object key, Object value)
put
in interface CollectionMap
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)
removeKey
in interface CollectionMap
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 |