|
Build 1.0_r1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractMap
public abstract class AbstractMap
AbstractMap is an abstract implementation of the Map interface. This Implementation does not support adding. A subclass must implement the abstract method entrySet().
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry |
| Constructor Summary | |
|---|---|
protected |
AbstractMap()
Constructs a new instance of this AbstractMap. |
| Method Summary | |
|---|---|
void |
clear()
Removes all elements from this Map, leaving it empty. |
protected Object |
clone()
Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver. |
boolean |
containsKey(Object key)
Searches this Map for the specified key. |
boolean |
containsValue(Object value)
Searches this Map for the specified value. |
abstract Set |
entrySet()
Returns a set view of the mappings contained in this map. |
boolean |
equals(Object object)
Compares the specified object to this Map and answer if they are equal. |
Object |
get(Object key)
Returns the value of the mapping with the specified key. |
int |
hashCode()
Returns an integer hash code for the receiver. |
boolean |
isEmpty()
Returns if this Map has no elements, a size of zero. |
Set |
keySet()
Returns a Set of the keys contained in this Map. |
Object |
put(Object key,
Object value)
Maps the specified key to the specified value. |
void |
putAll(Map map)
Copies every mapping in the specified Map to this Map. |
Object |
remove(Object key)
Removes a mapping with the specified key from this Map. |
int |
size()
Returns the number of elements in this Map. |
String |
toString()
Returns the string representation of this Map. |
Collection |
values()
Returns a collection of the values contained in this map. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractMap()
| Method Detail |
|---|
public void clear()
clear in interface MapUnsupportedOperationException - when removing from this Map is not supportedisEmpty(),
size()public boolean containsKey(Object key)
containsKey in interface Mapkey - the object to search for
key is a key of this Map, false otherwisepublic boolean containsValue(Object value)
containsValue in interface Mapvalue - the object to search for
value is a value of this Map, false
otherwisepublic abstract Set entrySet()
entrySet in interface Mappublic boolean equals(Object object)
equals in interface Mapequals in class Objectobject - the object to compare with this object
hashCode()public Object get(Object key)
get in interface Mapkey - the key
public int hashCode()
hashCode in interface MaphashCode in class Objectequals(Object)public boolean isEmpty()
isEmpty in interface Mapsize()public Set keySet()
keySet in interface Map
public Object put(Object key,
Object value)
put in interface Mapkey - the keyvalue - the value
UnsupportedOperationException - when adding to this Map is not supported
ClassCastException - when the class of the key or value is inappropriate for
this Map
IllegalArgumentException - when the key or value cannot be added to this Map
NullPointerException - when the key or value is null and this Map does not
support null keys or valuespublic void putAll(Map map)
putAll in interface Mapmap - the Map to copy mappings from
UnsupportedOperationException - when adding to this Map is not supported
ClassCastException - when the class of a key or value is inappropriate for this
Map
IllegalArgumentException - when a key or value cannot be added to this Map
NullPointerException - when a key or value is null and this Map does not support
null keys or valuespublic Object remove(Object key)
remove in interface Mapkey - the key of the mapping to remove
UnsupportedOperationException - when removing from this Map is not supportedpublic int size()
size in interface Mappublic String toString()
toString in class Objectpublic Collection values()
values in interface Map
protected Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException - if the receiver's class does not implement the interface
Cloneable.
|
Build 1.0_r1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||