Package org.aksw.commons.util.memoize
Class MemoizedFunctionImpl<I,O>
- java.lang.Object
-
- org.aksw.commons.util.memoize.MemoizedFunctionImpl<I,O>
-
- All Implemented Interfaces:
java.util.function.Function<I,O>,Memoized<I,O>,MemoizedFunction<I,O>
public class MemoizedFunctionImpl<I,O> extends Object implements MemoizedFunction<I,O>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Oapply(I obj)voidclearCache()Clear the cachestatic <I,O>
MemoizedFunction<I,O>create(java.util.function.Function<I,O> delegate)Create with backing by a ConcurrentHashMapstatic <I,O>
MemoizedFunction<I,O>createNonConcurrent(java.util.function.Function<I,O> delegate)Create with backing by a HashMapMap<I,O>getCache()Return a reference or copy to the memoized entries
-
-
-
Method Detail
-
getCache
public Map<I,O> getCache()
Description copied from interface:MemoizedReturn a reference or copy to the memoized entries
-
clearCache
public void clearCache()
Description copied from interface:MemoizedClear the cache- Specified by:
clearCachein interfaceMemoized<I,O>
-
create
public static <I,O> MemoizedFunction<I,O> create(java.util.function.Function<I,O> delegate)
Create with backing by a ConcurrentHashMap
-
createNonConcurrent
public static <I,O> MemoizedFunction<I,O> createNonConcurrent(java.util.function.Function<I,O> delegate)
Create with backing by a HashMap
-
-