net.sf.molae.pipe.binop
Class ConstantBinaryFunction<S,T extends S>
java.lang.Object
net.sf.molae.pipe.binop.AbstractBinaryFunction<S,S,T>
net.sf.molae.pipe.binop.SymmetricBinaryFunction<S,T>
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.
Method Summary |
T |
compute(S arg1,
S arg2)
Performs a computation on the specified arguments and
returns the result of that computation. |
ConstantBinaryFunction
public ConstantBinaryFunction(T constant)
- Constructs a ConstantBinaryFunction object.
- Parameters:
constant
- the constant value that is the result of this function.
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 argumentarg2
- the second argument
- Returns:
- the result of the computation