Package org.faktorips.runtime
Class SimpleCache
java.lang.Object
org.faktorips.runtime.SimpleCache
- All Implemented Interfaces:
IComputable<Object,Object>
Simple cache that just uses a HashMap to cache objects and never releases them. This Cache is
thread safe but not very high-performance.
- Author:
- Jan Ortmann
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleCache(IComputable<Object, Object> computable) SimpleCache(IComputable<Object, Object> computable, int initialCapacity) -
Method Summary
-
Constructor Details
-
SimpleCache
-
SimpleCache
-
-
Method Details
-
compute
Description copied from interface:IComputableCompute an object of type V identified by the key of type K- Specified by:
computein interfaceIComputable<Object,Object> - Parameters:
key- the key to identify the object- Returns:
- the computed Object of type V
- Throws:
InterruptedException- When computation was interrupted
-
getValueClass
Description copied from interface:IComputableGetting theClassof the value this computable produces.- Specified by:
getValueClassin interfaceIComputable<Object,Object>
-