Class Operators.ConstantFun<X,Y>

java.lang.Object
eu.bandm.tools.util.Operators.ConstantFun<X,Y>
All Implemented Interfaces:
Operators.Fun<X,Y>
Direct Known Subclasses:
Operators.LazyConstantFun
Enclosing class:
Operators

static class Operators.ConstantFun<X,Y> extends Object implements Operators.Fun<X,Y>
  • Field Details

    • c

      protected Y c
  • Constructor Details

    • ConstantFun

      ConstantFun()
    • ConstantFun

      public ConstantFun(Y c)
  • Method Details

    • getConstant

      public Y getConstant()
    • apply

      public final Y apply(X x)
      Description copied from interface: Operators.Fun
      Compute an output element from an input element. Computation should be stateless and thread-safe, i.e., f.apply(x) for a given fixed function object f and input element x should not vary unless the observable state of x varies.
      Specified by:
      apply in interface Operators.Fun<X,Y>
      Parameters:
      x - an input element.
      Returns:
      an output element.
    • toString

      public String toString()
      Overrides:
      toString in class Object