|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TwoWayTransformer<S,T>
Specifies both the methods to transform and to retransform an object. The interface foresees no exceptions for the transformation although in many cases the transformation is reasonable only for certain types of objects. Classes that use transformers that throw exceptions during transformation are responsible for handling these exceptions properly.
TransformedCollection
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 (optional operation). |
T |
transform(S input)
Transforms the input object (leaving it unchanged) into some output object. |
Method Detail |
---|
T transform(S input)
input
- the object to be transformed, should be left unchanged
ClassCastException
- (runtime) if the input is the wrong class
IllegalArgumentException
- (runtime) if the input is invalidS retransform(T input)
transform
.
If implemented, it must at least be ensured thattransform(retransform(input)).equals(input)for all objects, for that the retransformation is defined (that is retransform(input) does not throw an exception).
input
- the object for which the transformation origin is searched.
IllegalArgumentException
- if the retransformation for the input
object is not defined
ClassCastException
- if the retransformation is not defined for
the class of the input element
UnsupportedOperationException
- if not implemented.boolean isRetrievable(T input)
retransform
is implemented for this object and does
not throw an exception.x
returned by retransform
is unique, or more formally:
transform(o1).equals(transform(o2)) &rArr o1.equals(o2)
retransform(transform(input)).equals(input)for all objects where the retransformation is defined.
input
- the object for which the transformation origin is searched.
true
if the origin of the specified object can
be calculated.
ClassCastException
- if the input value can not be cast to
T
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |