Package org.faktorips.runtime.caching
Interface IComputable<K,V>
- All Known Implementing Classes:
AbstractComputable,HardMemoizer,Memoizer,SimpleCache
public interface IComputable<K,V>
Interface to compute objects of type V identified by a key of type K
- Author:
- dirmeier
-
Method Summary
Modifier and TypeMethodDescriptionCompute an object of type V identified by the key of type KGetting theClassof the value this computable produces.static <K,V> IComputable<K, V> Creates a newIComputablefor the given value class using the givenFunctionto compute the values from keys.
-
Method Details
-
compute
Compute an object of type V identified by the key of type K- Parameters:
key- the key to identify the object- Returns:
- the computed Object of type V
- Throws:
InterruptedException- When computation was interrupted
-
getValueClass
Getting theClassof the value this computable produces. -
of
Creates a newIComputablefor the given value class using the givenFunctionto compute the values from keys.- Type Parameters:
K- the key typeV- the value type- Parameters:
valueClass- the class of the valuesfunction- the function to compute a value from a key- Returns:
- a new
IComputable
-