public class PersistentEnvironment<K,V> extends java.util.AbstractMap<K,V> implements Environment<K,V>
| Constructor and Description |
|---|
PersistentEnvironment()
Creates a
PersistentEnvironment with no mappings. |
PersistentEnvironment(java.util.Map<K2,V2> m)
Creates a
PersistentEnvironment with the same
mappings as the given Map. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all mappings from this map.
|
boolean |
containsKey(java.lang.Object key)
Returns
true if this map contains a mapping for the
specified key. |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Returns a set view of the mappings contained in this map.
|
V |
get(java.lang.Object key)
Returns the value to which this map maps the specified key.
|
Environment.Mark |
getMark()
Get a mark that will allow you to restore the current state of
this environment.
|
boolean |
isEmpty()
Returns
true if this map contains no key-value mappings. |
V |
put(K key,
V value)
Associates the specified value with the specified key in this map.
|
V |
remove(java.lang.Object key)
Removes the mapping for this key from this map if present.
|
int |
size()
Returns the numer of key-value mappings in this map.
|
void |
undoToMark(Environment.Mark m)
Undo all changes since the supplied mark, restoring the map to
its state at the time the mark was taken.
|
clone, containsValue, equals, hashCode, keySet, putAll, toString, valuespublic PersistentEnvironment()
PersistentEnvironment with no mappings.public PersistentEnvironment(java.util.Map<K2,V2> m)
PersistentEnvironment with the same
mappings as the given Map.public void clear()
public boolean isEmpty()
true if this map contains no key-value mappings.public int size()
public V get(java.lang.Object key)
public boolean containsKey(java.lang.Object key)
true if this map contains a mapping for the
specified key.public V remove(java.lang.Object key)
public Environment.Mark getMark()
getMark in interface Environment<K,V>public void undoToMark(Environment.Mark m)
undoToMark in interface Environment<K,V>Copyright (c) 2006 C. Scott Ananian