net.sf.molae.pipe.union
Class Extendable.ExtendableTransformer<T>

java.lang.Object
  extended by net.sf.molae.pipe.union.Extendable.ExtendableTransformer<T>
All Implemented Interfaces:
TwoWayTransformer<T,Extendable<T>>
Enclosing class:
Extendable<T>

protected static class Extendable.ExtendableTransformer<T>
extends Object
implements TwoWayTransformer<T,Extendable<T>>

A transformer that returns a new extendable of the input value.


Constructor Summary
protected Extendable.ExtendableTransformer()
           
 
Method Summary
 boolean isRetrievable(Extendable<T> input)
          Indicates if the origin of the specified object can be calculated.
 T retransform(Extendable<T> input)
          Retrieves the base value of the given extendable
 Extendable<T> transform(T base)
          Creates a new extendable of the input value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Extendable.ExtendableTransformer

protected Extendable.ExtendableTransformer()
Method Detail

transform

public Extendable<T> transform(T base)
Creates a new extendable of the input value.

Specified by:
transform in interface TwoWayTransformer<T,Extendable<T>>
Parameters:
base - the base value of the new extendable
Returns:
a transformed object

retransform

public T retransform(Extendable<T> input)
Retrieves the base value of the given extendable

Specified by:
retransform in interface TwoWayTransformer<T,Extendable<T>>
Parameters:
input - an extendable object
Returns:
the base value of the given extendable

isRetrievable

public boolean isRetrievable(Extendable<T> input)
Description copied from interface: TwoWayTransformer
Indicates if the origin of the specified object can be calculated. This requires that:
  1. retransform is implemented for this object and does not throw an exception.
  2. 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<T,Extendable<T>>
Parameters:
input - an extendable object
Returns:
true if the extendable is of the base type