com.hazelcast.core
Interface TransactionalMultiMap<K,V>

Type Parameters:
K - key
V - value
All Superinterfaces:
BaseMultiMap<K,V>, DistributedObject, TransactionalObject

public interface TransactionalMultiMap<K,V>
extends BaseMultiMap<K,V>, TransactionalObject

Transactional implementation of BaseMultiMap.

See Also:
BaseMultiMap, MultiMap

Method Summary
 Collection<V> get(K key)
          Returns the collection of values associated with the key.
 boolean put(K key, V value)
          Stores a key-value pair in the multimap.
 Collection<V> remove(Object key)
          Removes all the entries with the given key.
 boolean remove(Object key, Object value)
          Removes the given key value pair from the multimap.
 int size()
          Returns the number of key-value pairs in the multimap.
 int valueCount(K key)
          Returns number of values matching to given key in the multimap.
 
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getId, getName, getPartitionKey, getServiceName
 

Method Detail

put

boolean put(K key,
            V value)
Stores a key-value pair in the multimap.

Specified by:
put in interface BaseMultiMap<K,V>
Parameters:
key - the key to be stored
value - the value to be stored
Returns:
true if size of the multimap is increased, false if the multimap already contains the key-value pair.

get

Collection<V> get(K key)
Returns the collection of values associated with the key.

Specified by:
get in interface BaseMultiMap<K,V>
Parameters:
key - the key whose associated values are to be returned
Returns:
the collection of the values associated with the key.

remove

boolean remove(Object key,
               Object value)
Removes the given key value pair from the multimap.

Specified by:
remove in interface BaseMultiMap<K,V>
Parameters:
key - the key of the entry to remove
value - the value of the entry to remove
Returns:
true if the size of the multimap changed after the remove operation, false otherwise.

remove

Collection<V> remove(Object key)
Removes all the entries with the given key.

Specified by:
remove in interface BaseMultiMap<K,V>
Parameters:
key - the key of the entries to remove
Returns:
the collection of removed values associated with the given key. Returned collection might be modifiable but it has no effect on the multimap

valueCount

int valueCount(K key)
Returns number of values matching to given key in the multimap.

Specified by:
valueCount in interface BaseMultiMap<K,V>
Parameters:
key - the key whose values count are to be returned
Returns:
number of values matching to given key in the multimap.

size

int size()
Returns the number of key-value pairs in the multimap.

Specified by:
size in interface BaseMultiMap<K,V>
Returns:
the number of key-value pairs in the multimap.


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.