|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.molae.pipe.basic.ObjectProxy<TwoWayTransformer<T,S>> net.sf.molae.pipe.trafo.InverseTransformer<S,T>
public final class InverseTransformer<S,T>
Exchanges the transform
and
retransform
methods of the base transformer.
Constructor Summary | |
---|---|
InverseTransformer(TwoWayTransformer<T,S> base)
Constructs an InverseTransformer object. |
Method Summary | |
---|---|
boolean |
isRetrievable(T input)
Indicates if the origin of the specified object can be calculated. |
S |
retransform(T input)
Calculates the transformation origin of the specified object. |
T |
transform(S input)
Transforms the input object into some output object. |
Methods inherited from class net.sf.molae.pipe.basic.ObjectProxy |
---|
assertNotNull, equals, getBase, hashCode, toString, toVerboseString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InverseTransformer(TwoWayTransformer<T,S> base)
base
- the underlying transformer.
NullPointerException
- if any of the specified objects is
null
.Method Detail |
---|
public T transform(S input)
retransform(Object)
of the underlying transformer.
If an exception occurred, null
is returned.
transform
in interface TwoWayTransformer<S,T>
input
- the object to transform
public S retransform(T input)
transform(Object)
of the
underlying transformer.
retransform
in interface TwoWayTransformer<S,T>
input
- the object for which the transformation origin is searched.
IllegalArgumentException
- if the retransformation condition
transform(retransform(input)).equals(input)
does not hold.public boolean isRetrievable(T input)
transform(retransform(input)).equals(input)
holds.
As the retransformation of the base transformer must be
injective on its definition set this implies that the result
of the transformation of this transformer is unique and
thereby the specified object is retrievable.
isRetrievable
in interface TwoWayTransformer<S,T>
input
- the object for which the transformation origin is searched.
true
if the origin of the specified object can
be calculated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |