Class FuncOf<X,​Y>

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

    public final class FuncOf<X,​Y>
    extends Object
    implements Func<X,​Y>
    Represents many possible inputs as Func.

    There is no thread-safety guarantee.

    Since:
    0.12
    • Constructor Detail

      • FuncOf

        public FuncOf​(Proc<? super X> proc,
                      Y result)
        Ctor.
        Parameters:
        proc - The proc
        result - Result to return
      • FuncOf

        public FuncOf​(Scalar<? extends Y> scalar)
        Ctor.
        Parameters:
        scalar - Origin scalar
      • FuncOf

        public FuncOf​(Func<? super X,​? extends Y> fnc)
        Ctor.
        Parameters:
        fnc - Func
    • 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