|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.sf.molae.pipe.trafo.CachedTransformer
A cached transformer. All transformation results are stored in a cache and used the next time the transformation is called with an equal input parameter.
| Constructor Summary | |
CachedTransformer(Map cache,
Map inverted,
TwoWayTransformer base)
Constructs a CachedTransformer on the base of the specified parameters. |
|
CachedTransformer(TwoWayTransformer base)
Constructs an empty CachedTransformer. |
|
| Method Summary | |
Map |
getCache()
Returns the cache. |
Map |
getInverted()
Returns the retransformation cache. |
boolean |
isReadOnly()
Returns true if this object is marked as read only. |
boolean |
isRetrievable(Object input)
Indicates if the origin of the specified object can be calculated. |
Object |
retransform(Object input)
Calculates the transformation origin of the specified object. |
void |
setReadOnly()
Marks this CachedTransformer object as "read only". |
Object |
transform(Object input)
Returns the value to which the base map maps the specified key. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CachedTransformer(Map cache,
Map inverted,
TwoWayTransformer base)
cache - Initial values of the cache.inverted - Initial values of the retransformation cache.base - the default transformer.public CachedTransformer(TwoWayTransformer base)
base - the default transformer.| Method Detail |
public Map getCache()
public Map getInverted()
public void setReadOnly()
isReadOnly()public boolean isReadOnly()
true if this object is marked as read only.
By default, the object is not read only.
It can be set to read only by a call to setReadOnly().true if this object is
marked as readonly, false otherwise.public Object transform(Object input)
transform in interface Transformerinput - key whose associated value is to be returnedpublic Object retransform(Object input)
retransform in interface TwoWayTransformerinput - the object for which the transformation origin is searched.IllegalArgumentException - depending on the base transformer.ClassCastException - depending on the base transformer.UnsupportedOperationException - depending on the base transformer.public boolean isRetrievable(Object input)
TwoWayTransformerretransform 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.
isRetrievable in interface TwoWayTransformernet.sf.molae.pipe.trafo.TwoWayTransformerinput - 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: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||