Class SetMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
com.tangosol.util.SetMap<K,V>
- All Implemented Interfaces:
Map<K,V>
A Map implementation based on a known
set of keys and a Function that when given a key can derive the value. Once a value has been
derived for a key the function will not be called again for the same key.
This map can be mutated outside of the original set of keys or within the set of keys. The latter will result in the function not being called for the respective keys.
This implementation is the inverse to a MapSet which can trivially
distill a Map of keys and values to a Set of keys. With the use of a Function
this implementation allows a Set of keys to be converted lazily to a Map of
keys and values.
- Since:
- 12.2.1.4.0
- Author:
- hr 2016.09.29
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) protected VensureValue(Object oKey) Return a value for the specified key.entrySet()Return an external map allowing type safe access.Return the internal map allowing any object to be stored.booleanisEmpty()keySet()voidintsize()Methods inherited from class java.util.AbstractMap
clone, containsValue, equals, hashCode, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
f_map
-
f_functionValue
-
-
Constructor Details
-
SetMap
-
SetMap
-
SetMap
-
-
Method Details
-
size
-
isEmpty
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classAbstractMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
-
keySet
-
entrySet
-
getInternalMap
-
getExternalMap
-
ensureValue
-