Package 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 toMap
which adds Trove-specific features.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.
-
-
-
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.
-
forEachKey
boolean forEachKey(TObjectProcedure<? super K> procedure)
Executes procedure for each key in the map.- Parameters:
procedure
- aTObjectProcedure
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
- aTObjectProcedure
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
- aTObjectObjectProcedure
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
- aTObjectFunction
value
-
-