public class HashEnvironment<K,V> extends java.util.AbstractMap<K,V> implements Environment<K,V>
| Constructor and Description |
|---|
HashEnvironment()
Creates a
HashEnvironment. |
HashEnvironment(java.util.Map<? extends K,? extends V> m)
Creates a
HashEnvironment with all the mappings in
the given map. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all mappings.
|
boolean |
containsKey(java.lang.Object key)
Returns
true if this map contains a mapping for the
specified key. |
MapSet<K,V> |
entrySet()
The
Set returned by this method is really a
MapSet. |
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.
|
static void |
main(java.lang.String[] argv)
Self-test function.
|
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 number 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, isEmpty, keySet, putAll, toString, valuespublic HashEnvironment()
HashEnvironment.public HashEnvironment(java.util.Map<? extends K,? extends V> m)
HashEnvironment with all the mappings in
the given map.public boolean containsKey(java.lang.Object key)
true if this map contains a mapping for the
specified key.public V get(java.lang.Object key)
public V remove(java.lang.Object key)
public int size()
public void clear()
public Environment.Mark getMark()
EnvironmentgetMark in interface Environment<K,V>public void undoToMark(Environment.Mark m)
EnvironmentundoToMark in interface Environment<K,V>public static void main(java.lang.String[] argv)
Copyright (c) 2006 C. Scott Ananian