java.util
Class AbstractMap

java.lang.Object
  |
  +--java.util.AbstractMap
All Implemented Interfaces:
Map
Direct Known Subclasses:
IdentityHashMap, TreeMap, WeakHashMap

public abstract synchronized class AbstractMap
extends Object
implements Map


Constructor Summary
protected AbstractMap()
           
 
Method Summary
 void clear()
           
protected  Object clone()
           
 boolean containsKey(Object)
           
 boolean containsValue(Object)
           
abstract  Set entrySet()
           
 boolean equals(Object)
          Determines if this object is "equal" to another object.
 Object get(Object)
           
 int hashCode()
           
 boolean isEmpty()
           
 Set keySet()
           
 Object put(Object, Object)
           
 void putAll(Map)
           
 Object remove(Object)
           
 int size()
           
 String toString()
           
 Collection values()
           
 

Constructor Detail

AbstractMap

protected AbstractMap()
Method Detail

size

public int size()
Specified by:
size in interface Map

isEmpty

public boolean isEmpty()

containsValue

public boolean containsValue(Object)

containsKey

public boolean containsKey(Object)
Specified by:
containsKey in interface Map

get

public Object get(Object)
Specified by:
get in interface Map

put

public Object put(Object,
                  Object)
Specified by:
put in interface Map

remove

public Object remove(Object)

putAll

public void putAll(Map)

clear

public void clear()

keySet

public Set keySet()
Specified by:
keySet in interface Map

values

public Collection values()

entrySet

public abstract Set entrySet()

equals

public boolean equals(Object)
Description copied from class: Object
Determines if this object is "equal" to another object.

In general, objects should be instances of the same class with the same guts to be considered equal. For example, the code below only prints same value since s and t are different strings though they have the same value: "hello".

 String s = new String("hello");
 String t = new String("hello");
 if (s.equals(t)) System.out.println("same value");
 if (s == t) System.out.println("same string");

 

Overrides:
equals in class Object
Following copied from class: java.lang.Object
Parameters:
is - the other Object to which this one is compared
Returns:
true if this Object is equal to other

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

clone

protected Object clone()
                throws CloneNotSupportedException