Package fj

Class P1.Memo<A>

  • All Implemented Interfaces:
    F0<A>, java.util.function.Supplier<A>
    Enclosing class:
    P1<A>

    static final class P1.Memo<A>
    extends P1<A>
    • Field Detail

      • fa

        private volatile F0<A> fa
      • value

        private A value
    • Constructor Detail

      • Memo

        Memo​(F0<A> fa)
    • Method Detail

      • _1

        public final A _1()
        Description copied from class: P1
        Access the first element of the product.
        Specified by:
        _1 in class P1<A>
        Returns:
        The first element of the product.
      • computeValue

        private A computeValue()
      • hardMemo

        public P1<A> hardMemo()
        Description copied from class: P1
        Returns a P1 that remembers its value.
        Overrides:
        hardMemo in class P1<A>
        Returns:
        A P1 that calls this P1 once and remembers the value for subsequent calls.
      • softMemo

        public P1<A> softMemo()
        Description copied from class: P1
        Like memo, but the memoized value is wrapped into a SoftReference
        Overrides:
        softMemo in class P1<A>
      • weakMemo

        public P1<A> weakMemo()
        Description copied from class: P1
        Like memo, but the memoized value is wrapped into a WeakReference
        Overrides:
        weakMemo in class P1<A>