Class MemoizedFunctionImpl<I,​O>

    • Field Detail

      • cache

        protected Map<I,​O> cache
      • delegate

        protected java.util.function.Function<I,​O> delegate
    • Constructor Detail

      • MemoizedFunctionImpl

        public MemoizedFunctionImpl​(java.util.function.Function<I,​O> delegate,
                                    Map<I,​O> cache)
    • Method Detail

      • getCache

        public Map<I,​O> getCache()
        Description copied from interface: Memoized
        Return a reference or copy to the memoized entries
        Specified by:
        getCache in interface Memoized<I,​O>
      • clearCache

        public void clearCache()
        Description copied from interface: Memoized
        Clear the cache
        Specified by:
        clearCache in interface Memoized<I,​O>
      • apply

        public O apply​(I obj)
        Specified by:
        apply in interface java.util.function.Function<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