org.postgresql.pljava.internal
Class TransactionalMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by java.util.HashMap
          extended by org.postgresql.pljava.internal.TransactionalMap
All Implemented Interfaces:
Serializable, Cloneable, Map

public class TransactionalMap
extends HashMap

A TransactionalMap acts as a modifiable front for a backing map. All modifications can be reverted by a call to abort or propagated to the backing map by a call to commit. The map is not synchronized so care should be taken if multiple threads will access the map.

Author:
Thomas Hallgren
See Also:
Serialized Form

Nested Class Summary
protected  class TransactionalMap.BackedEntry
           
protected  class TransactionalMap.EntryIterator
           
protected  class TransactionalMap.KeyIterator
           
protected  class TransactionalMap.ValueIterator
           
 
Constructor Summary
protected TransactionalMap(Map base)
           
 
Method Summary
 void abort()
          Undo all changes made since the map was created or since last commit or abort.
 void clear()
          Clear this map (an anti-object is inserted for each entry present in the backed map).
 void commit()
          Commit all changes made since the map was created or since last commit or abort.
 boolean containsKey(Object key)
           
 boolean containsValue(Object val)
           
 Set entrySet()
           
 Object get(Object key)
           
protected  Iterator getEntryIterator()
           
protected  Iterator getKeyIterator()
           
protected  Iterator getValueIterator()
           
 boolean isEmpty()
           
 Set keySet()
           
 Object put(Object key, Object value)
           
 void putAll(Map t)
           
 Object remove(Object key)
           
 int size()
           
 Collection values()
           
 
Methods inherited from class java.util.HashMap
clone
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

TransactionalMap

protected TransactionalMap(Map base)
Method Detail

abort

public void abort()
Undo all changes made since the map was created or since last commit or abort.


clear

public void clear()
Clear this map (an anti-object is inserted for each entry present in the backed map).

Specified by:
clear in interface Map
Overrides:
clear in class HashMap

commit

public void commit()
Commit all changes made since the map was created or since last commit or abort. All changes are propagated to the backing map.


containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map
Overrides:
containsKey in class HashMap

get

public Object get(Object key)
Specified by:
get in interface Map
Overrides:
get in class HashMap

remove

public Object remove(Object key)
Specified by:
remove in interface Map
Overrides:
remove in class HashMap

size

public int size()
Specified by:
size in interface Map
Overrides:
size in class HashMap

containsValue

public boolean containsValue(Object val)
Specified by:
containsValue in interface Map
Overrides:
containsValue in class HashMap

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map
Overrides:
entrySet in class HashMap

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map
Overrides:
isEmpty in class HashMap

keySet

public Set keySet()
Specified by:
keySet in interface Map
Overrides:
keySet in class HashMap

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface Map
Overrides:
put in class HashMap

putAll

public void putAll(Map t)
Specified by:
putAll in interface Map
Overrides:
putAll in class HashMap

values

public Collection values()
Specified by:
values in interface Map
Overrides:
values in class HashMap

getEntryIterator

protected Iterator getEntryIterator()

getKeyIterator

protected Iterator getKeyIterator()

getValueIterator

protected Iterator getValueIterator()