GNU Trove

gnu.trove.map
Interface TMap<K,V>

All Superinterfaces:
java.util.Map<K,V>
All Known Implementing Classes:
TCustomHashMap, THashMap

public interface TMap<K,V>
extends java.util.Map<K,V>

Interface extension to Map which adds Trove-specific features.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 boolean forEachEntry(TObjectObjectProcedure<? super K,? super V> procedure)
          Executes procedure for each key/value entry in the map.
 boolean forEachKey(TObjectProcedure<? super K> procedure)
          Executes procedure for each key in the map.
 boolean forEachValue(TObjectProcedure<? super V> procedure)
          Executes procedure for each value in the map.
 V putIfAbsent(K key, V value)
          Inserts a key/value pair into the map if the specified key is not already associated with a value.
 boolean retainEntries(TObjectObjectProcedure<? super K,? super V> procedure)
          Retains only those entries in the map for which the procedure returns a true value.
 void transformValues(TObjectFunction<V,V> function)
          Transform the values in this map using function.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

putIfAbsent

V putIfAbsent(K key,
              V value)
Inserts a key/value pair into the map if the specified key is not already associated with a value.

Parameters:
key - an Object value
value - an Object value
Returns:
the previous value associated with key, or null if none was found.

forEachKey

boolean forEachKey(TObjectProcedure<? super K> procedure)
Executes procedure for each key in the map.

Parameters:
procedure - a TObjectProcedure value
Returns:
false if the loop over the keys terminated because the procedure returned false for some key.

forEachValue

boolean forEachValue(TObjectProcedure<? super V> procedure)
Executes procedure for each value in the map.

Parameters:
procedure - a TObjectProcedure value
Returns:
false if the loop over the values terminated because the procedure returned false for some value.

forEachEntry

boolean forEachEntry(TObjectObjectProcedure<? super K,? super V> procedure)
Executes procedure for each key/value entry in the map.

Parameters:
procedure - a TObjectObjectProcedure value
Returns:
false if the loop over the entries terminated because the procedure returned false for some entry.

retainEntries

boolean retainEntries(TObjectObjectProcedure<? super K,? super V> procedure)
Retains only those entries in the map for which the procedure returns a true value.

Parameters:
procedure - determines which entries to keep
Returns:
true if the map was modified.

transformValues

void transformValues(TObjectFunction<V,V> function)
Transform the values in this map using function.

Parameters:
function - a TObjectFunction value

GNU Trove