Class SolidFunc<X,​Y>

  • Type Parameters:
    X - Type of input
    Y - Type of output
    All Implemented Interfaces:
    Func<X,​Y>

    public final class SolidFunc<X,​Y>
    extends Object
    implements Func<X,​Y>
    Func that is thread-safe and sticky.

    Objects of this class are thread safe.

    Since:
    0.24
    • Constructor Detail

      • SolidFunc

        public SolidFunc​(Func<X,​Y> fnc)
        Ctor.
        Parameters:
        fnc - Original function
      • SolidFunc

        public SolidFunc​(Func<X,​Y> fnc,
                         int max)
        Ctor.
        Parameters:
        fnc - Original function
        max - Max caching buffer length
        Since:
        0.26
    • Method Detail

      • apply

        public Y apply​(X input)
                throws Exception
        Description copied from interface: Func
        Apply it.
        Specified by:
        apply in interface Func<X,​Y>
        Parameters:
        input - The argument
        Returns:
        The result
        Throws:
        Exception - If fails