org.postgresql.pljava.internal
Class TransactionalMap

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

public class TransactionalMap
extends java.util.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.

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(java.util.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(java.lang.Object key)
           
 boolean containsValue(java.lang.Object val)
           
 java.util.Set entrySet()
           
 java.lang.Object get(java.lang.Object key)
           
protected  java.util.Iterator getEntryIterator()
           
protected  java.util.Iterator getKeyIterator()
           
protected  java.util.Iterator getValueIterator()
           
 boolean isEmpty()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map t)
           
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 java.util.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(java.util.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 java.util.Map
Overrides:
clear in class java.util.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(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map
Overrides:
containsKey in class java.util.HashMap

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map
Overrides:
get in class java.util.HashMap

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
Overrides:
remove in class java.util.HashMap

size

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

containsValue

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

entrySet

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

isEmpty

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

keySet

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

put

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

putAll

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

values

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

getEntryIterator

protected java.util.Iterator getEntryIterator()

getKeyIterator

protected java.util.Iterator getKeyIterator()

getValueIterator

protected java.util.Iterator getValueIterator()


Copyright (c) 2003, 2004, 2005 TADA AB - Taby Sweden. \ Distributed under the terms shown in COPYRIGHT