Package net.sf.tweety.arg.adf.util
Class CacheMap<K,V>
- java.lang.Object
-
- net.sf.tweety.arg.adf.util.CacheMap<K,V>
-
- Type Parameters:
K
- the keyV
- the value
- All Implemented Interfaces:
java.util.function.Function<K,V>
,java.util.Map<K,V>
public final class CacheMap<K,V> extends java.lang.Object implements java.util.function.Function<K,V>, java.util.Map<K,V>
Uses the provided function to compute absent values on access, theses values are memorized for future access to avoid further computations.- Author:
- Mathias Hofer
-
-
Method Summary
Modifier and Type Method Description V
apply(K input)
void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
V
get(java.lang.Object key)
boolean
isEmpty()
java.util.Set<K>
keySet()
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> m)
V
remove(java.lang.Object key)
int
size()
java.util.Collection<V>
values()
-