Class Memoizer<A,​V>

  • All Implemented Interfaces:
    LowLevelProcessor<A,​V>

    public class Memoizer<A,​V>
    extends Object
    implements LowLevelProcessor<A,​V>
    Memoizer for computing resource expensive tasks asynchronously & concurrently. Inspired by D. Lea. JCiP, 2nd edition. Addison-Wesley, 2006. pp.109
    Since:
    2.6
    Author:
    Marcel Valovy - [email protected]
    • Constructor Detail

      • Memoizer

        public Memoizer()
    • Method Detail

      • forget

        public void forget​(ComputableTask<A,​V> task,
                           A key)
        Forgets result of the specified task. This allows to manually control size of internal cache.
        Parameters:
        task - computable task, forming part of result key
        key - argument of computation
      • forgetAll

        public void forgetAll()
        Forgets all cached results.