|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Util.Collections.PersistentMap
PersistentMap
implements a persistent map, based on a
binary search tree.
Constructor Summary | |
PersistentMap()
Creates an empty PersistentMap whose
key objects will all implement java.lang.Comparable . |
|
PersistentMap(Comparator c)
Creates an empty PersistentMap whose
key objects are ordered by the given Comparator . |
Method Summary | |
Map |
asMap()
java.util.Collection s view of the mapping. |
boolean |
containsKey(Object key)
Determines if there is a mapping for the given key . |
Object |
get(Object key)
Gets the value which key maps to. |
boolean |
isEmpty()
Determines if this PersistentMap has any mappings. |
PersistentMap |
put(Object key,
Object value)
Creates and returns a new PersistantMap identical to
this one, except it contains a mapping from key to
value. |
PersistentMap |
remove(Object key)
Make a new PersistentMap identical to this one,
except that it does not contain a mapping for key . |
int |
size()
Count the number of key->value mappings in this PersistentMap . |
String |
toString()
Human-readable representation of the map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PersistentMap()
PersistentMap
whose
key objects will all implement java.lang.Comparable
.
public PersistentMap(Comparator c)
PersistentMap
whose
key objects are ordered by the given Comparator
.
Method Detail |
public boolean isEmpty()
PersistentMap
has any mappings.
public int size()
PersistentMap
.
public PersistentMap put(Object key, Object value)
PersistantMap
identical to
this one, except it contains a mapping from key
to
value.
public Object get(Object key)
key
maps to.
public boolean containsKey(Object key)
key
.
public PersistentMap remove(Object key)
PersistentMap
identical to this one,
except that it does not contain a mapping for key
.
public String toString()
toString
in class Object
public Map asMap()
java.util.Collection
s view of the mapping.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |