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 TypeMethodDescriptionboolean
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.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, 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:
putIfAbsent
in interfaceMap<K,
V> - Parameters:
key
- anObject
valuevalue
- anObject
value- Returns:
- the previous value associated with key,
or
null
if none was found.
-
forEachKey
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
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
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
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
- aTObjectFunction
value
-