|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A container that maps keys to values. A Map does not contain duplicate keys but can contain duplicate values. Any key maps to zero or one value.
Map implementations should provide two copy constructors: one should take another Map and perform a shallow copy. The other should take a java.util.Map and perform a shallow copy.
Unlike java.util.Map, this interface does not override hashcode and eqauals. Instead it provides the containsAll() and sameContentsAs() methods.
Field Summary | |
static Map |
EMPTY
|
Method Summary | |
boolean |
containsAll(Map c)
Returns true if this collection contains all of the Objects in the specified collection. |
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains an entry for key. |
boolean |
containsValue(java.lang.Object value)
Returns true if this map contains value. |
java.lang.Object |
get(java.lang.Object key)
Returns the value for the key. |
Identitor |
getIdentitor()
Returns the Identitor for this Map. |
java.util.Map |
getJavaMap()
Return a java.util.Collection of these Objects. |
Set |
getKeys()
Returns an immutable shallow copy of the Set of keys. |
Collection |
getValues()
Returns an immutable shallow copy of the Collection of values. |
boolean |
isEmpty()
Returns true if this Map has no entries. |
java.util.Iterator |
keyIterator()
Returns an iterator over the keys. |
boolean |
sameContentsAs(Map c)
Returns true if this Collection's contents are equal to c's. |
int |
size()
Returns the number of key-value pairs in this map. |
java.util.Iterator |
valueIterator()
Returns an iterator over the values. |
Methods inherited from interface net.walend.collection.HasState |
getPrincipleInterface, sameStateAs |
Field Detail |
public static final Map EMPTY
Method Detail |
public Identitor getIdentitor()
public int size()
public boolean isEmpty()
public boolean containsKey(java.lang.Object key)
java.lang.NullPointerException
- if key is null.public boolean containsValue(java.lang.Object value)
java.lang.NullPointerException
- if value is null.public java.lang.Object get(java.lang.Object key)
java.lang.NullPointerException
- if the key is null.public Set getKeys()
public Collection getValues()
public java.util.Iterator keyIterator()
public java.util.Iterator valueIterator()
public boolean containsAll(Map c)
public boolean sameContentsAs(Map c)
public java.util.Map getJavaMap()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |