org.postgresql.pljava.internal

Class TransactionalMap


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.

Nested Class Summary

protected class
TransactionalMap.BackedEntry
protected class
TransactionalMap.EntryIterator
protected class
TransactionalMap.KeyIterator
protected class
TransactionalMap.ValueIterator

Constructor Summary

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()

Constructor Details

TransactionalMap

protected TransactionalMap(Map base)

Method Details

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).

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)

containsValue

public boolean containsValue(Object val)

entrySet

public Set entrySet()

get

public Object get(Object key)

getEntryIterator

protected Iterator getEntryIterator()

getKeyIterator

protected Iterator getKeyIterator()

getValueIterator

protected Iterator getValueIterator()

isEmpty

public boolean isEmpty()

keySet

public Set keySet()

put

public Object put(Object key,
                  Object value)

putAll

public void putAll(Map t)

remove

public Object remove(Object key)

size

public int size()

values

public Collection values()

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