net.sf.molae.pipe.binop
Class ConstantBinaryFunction<S,T extends S>

java.lang.Object
  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:
BinaryFunction<S,S,T>

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

ConstantBinaryFunction

public ConstantBinaryFunction(T constant)
Constructs a ConstantBinaryFunction object.

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

compute

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>
Parameters:
arg1 - the first argument
arg2 - the second argument
Returns:
the result of the computation