Package gnu.trove.map
Interface TMap<K,V>
- All Superinterfaces:
Map<K,V>
- All Known Implementing Classes:
TCustomHashMap,THashMap
Interface extension to
Map which adds Trove-specific features.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionbooleanforEachEntry(TObjectObjectProcedure<? super K, ? super V> procedure) Executes procedure for each key/value entry in the map.booleanforEachKey(TObjectProcedure<? super K> procedure) Executes procedure for each key in the map.booleanforEachValue(TObjectProcedure<? super V> procedure) Executes procedure for each value in the map.putIfAbsent(K key, V value) Inserts a key/value pair into the map if the specified key is not already associated with a value.booleanretainEntries(TObjectObjectProcedure<? super K, ? super V> procedure) Retains only those entries in the map for which the procedure returns a true value.voidtransformValues(TObjectFunction<V, V> function) Transform the values in this map using function.Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, remove, remove, replace, replace, replaceAll, size, values
-
Method Details
-
putIfAbsent
Inserts a key/value pair into the map if the specified key is not already associated with a value.- Specified by:
putIfAbsentin interfaceMap<K,V> - Parameters:
key- anObjectvaluevalue- anObjectvalue- Returns:
- the previous value associated with key,
or
nullif none was found.
-
forEachKey
Executes procedure for each key in the map.- Parameters:
procedure- aTObjectProcedurevalue- Returns:
- false if the loop over the keys terminated because the procedure returned false for some key.
-
forEachValue
Executes procedure for each value in the map.- Parameters:
procedure- aTObjectProcedurevalue- Returns:
- false if the loop over the values terminated because the procedure returned false for some value.
-
forEachEntry
Executes procedure for each key/value entry in the map.- Parameters:
procedure- aTObjectObjectProcedurevalue- Returns:
- false if the loop over the entries terminated because the procedure returned false for some entry.
-
retainEntries
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
Transform the values in this map using function.- Parameters:
function- aTObjectFunctionvalue
-