Class ConstantBinaryFunction<S,T extends S>

  extended by net.sf.molae.pipe.binop.AbstractBinaryFunction<S,S,T>
      extended by net.sf.molae.pipe.binop.SymmetricBinaryFunction<S,T>
          extended by net.sf.molae.pipe.binop.ConstantBinaryFunction<S,T>
All Implemented Interfaces:

public final class ConstantBinaryFunction<S,T extends S>
extends SymmetricBinaryFunction<S,T>

A binary operation that returns a constant ingnoring the arguments.

Constructor Summary
ConstantBinaryFunction(T constant)
          Constructs a ConstantBinaryFunction object.
Method Summary
 T compute(S arg1, S arg2)
          Performs a computation on the specified arguments and returns the result of that computation.
Methods inherited from class net.sf.molae.pipe.binop.SymmetricBinaryFunction
getIdentityElement, getSink, isAnIdentityElement, isASink
Methods inherited from class net.sf.molae.pipe.binop.AbstractBinaryFunction
getFirstInverse, getPermuted, isAssociative, isLeftSink, isRightIdentityElement, setFirstInverse, setPermuted, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public ConstantBinaryFunction(T constant)
Constructs a ConstantBinaryFunction object.

constant - the constant value that is the result of this function.
Method Detail


public T compute(S arg1,
                 S arg2)
Description copied from interface: BinaryFunction
Performs a computation on the specified arguments and returns the result of that computation.

Specified by:
compute in interface BinaryFunction<S,S,T extends S>
Specified by:
compute in class AbstractBinaryFunction<S,S,T extends S>
arg1 - the first argument
arg2 - the second argument
the result of the computation