Package org.tweetyproject.arg.adf.util
Class LazyMap<K,V>
java.lang.Object
org.tweetyproject.arg.adf.util.LazyMap<K,V>
- Type Parameters:
K- the keyV- the value
- All Implemented Interfaces:
Map<K,V>
Lazily computes missing values. If a key is mapped to null, the value is computed by the provided function on its first access.
- Author:
- Mathias Hofer
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanisEmpty()keySet()voidintsize()values()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
LazyMap
- Parameters:
function- the function to compute missing values
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-