org.multiverse.transactional.collections
Interface TransactionalMap<K,V>

Type Parameters:
K - the key type for the map
V - the value type for the map
All Superinterfaces:
ConcurrentMap<K,V>, Map<K,V>

public interface TransactionalMap<K,V>
extends ConcurrentMap<K,V>

A Transactional version of the ConcurrentMap.

Author:
Peter Veentjer.
See Also:
ConcurrentMap, Map

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 int atomicSize()
          Returns the current size of the TransactionalMap.
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<K,V>> entrySet()
           
 boolean equals(Object o)
           
 V get(Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 Set<K> keySet()
           
 V put(K key, V value)
           
 void putAll(Map<? extends K,? extends V> m)
           
 V putIfAbsent(K key, V value)
           
 V remove(Object key)
           
 boolean remove(Object key, Object value)
           
 V replace(K key, V value)
           
 boolean replace(K key, V oldValue, V newValue)
           
 int size()
           
 String toString()
           
 Collection<V> values()
           
 

Method Detail

size

int size()
Specified by:
size in interface Map<K,V>

atomicSize

int atomicSize()
Returns the current size of the TransactionalMap. The big difference between the normal size() method is that this one returns the actual size of this map and doesn't look at the current transaction. So you could see changes made by other threads.

Returns:
the current size of the TransactionalMap.

isEmpty

boolean isEmpty()
Specified by:
isEmpty in interface Map<K,V>

containsKey

boolean containsKey(Object key)
Specified by:
containsKey in interface Map<K,V>

containsValue

boolean containsValue(Object value)
Specified by:
containsValue in interface Map<K,V>

get

V get(Object key)
Specified by:
get in interface Map<K,V>

keySet

Set<K> keySet()
Specified by:
keySet in interface Map<K,V>

values

Collection<V> values()
Specified by:
values in interface Map<K,V>

entrySet

Set<Map.Entry<K,V>> entrySet()
Specified by:
entrySet in interface Map<K,V>

toString

String toString()
Overrides:
toString in class Object

equals

boolean equals(Object o)
Specified by:
equals in interface Map<K,V>
Overrides:
equals in class Object

hashCode

int hashCode()
Specified by:
hashCode in interface Map<K,V>
Overrides:
hashCode in class Object

put

V put(K key,
      V value)
Specified by:
put in interface Map<K,V>

remove

V remove(Object key)
Specified by:
remove in interface Map<K,V>

putAll

void putAll(Map<? extends K,? extends V> m)
Specified by:
putAll in interface Map<K,V>

clear

void clear()
Specified by:
clear in interface Map<K,V>

putIfAbsent

V putIfAbsent(K key,
              V value)
Specified by:
putIfAbsent in interface ConcurrentMap<K,V>

remove

boolean remove(Object key,
               Object value)
Specified by:
remove in interface ConcurrentMap<K,V>

replace

boolean replace(K key,
                V oldValue,
                V newValue)
Specified by:
replace in interface ConcurrentMap<K,V>

replace

V replace(K key,
          V value)
Specified by:
replace in interface ConcurrentMap<K,V>


Copyright © 2008-2010 Multiverse. All Rights Reserved.