net.sf.molae.pipe.binop
Class ConstantSecondFactorTransformer
java.lang.Object
|
+--net.sf.molae.pipe.binop.ConstantSecondFactorTransformer
- All Implemented Interfaces:
- Transformer, TwoWayTransformer
- public final class ConstantSecondFactorTransformer
- extends Object
- implements TwoWayTransformer
A transformer based on a binary operation where the second
operand is constant.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConstantSecondFactorTransformer
public ConstantSecondFactorTransformer(BinaryFunction operation,
Object factor)
- Constructs a ConstantSecondFactorTransformer object.
- Parameters:
operation - the underlying binary functionfactor - the constant value of the second factor
transform
public Object transform(Object input)
- Specified by:
transform in interface Transformer
retransform
public Object retransform(Object input)
- Description copied from interface:
TwoWayTransformer
- Calculates the transformation origin of the specified object
(optional operation).
This is the inverse mapping of
transform.
If implemented, it must at least be ensured that
transform(retransform(input)).equals(input)
for all objects, for that the retransformation is defined
(that is retransform(input) does not throw an exception).
This implies that the retransformation is defined on a subset
of the image of the transformation.
- Specified by:
retransform in interface TwoWayTransformer
- Following copied from interface:
net.sf.molae.pipe.trafo.TwoWayTransformer
- Parameters:
input - the object for which the transformation origin is searched.- Returns:
- the transformation origin of the specified object.
- Throws:
IllegalArgumentException - if the retransformation for the input
object is not definedClassCastException - if the retransformation is not defined for
the class of the input elementUnsupportedOperationException - if not implemented.
isRetrievable
public boolean isRetrievable(Object input)
- Description copied from interface:
TwoWayTransformer
- Indicates if the origin of the specified object can be calculated.
This requires that:
retransform is implemented for this object and does
not throw an exception.
- The object
x returned by retransform
is unique, or more formally:
transform(o1).equals(transform(o2)) &rArr o1.equals(o2)
This implies that
retransform(transform(input)).equals(input)
for all objects where the retransformation is defined.
- Specified by:
isRetrievable in interface TwoWayTransformer
- Following copied from interface:
net.sf.molae.pipe.trafo.TwoWayTransformer
- Parameters:
input - the object for which the transformation origin is searched.- Returns:
true if the origin of the specified object can
be calculated.