org.postgresql.pljava.internal
Class TransactionalMap
java.lang.Object
java.util.AbstractMap
java.util.HashMap
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
TransactionalMap
protected TransactionalMap(Map base)
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()