|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Transformer<K,L>
Transformer interface, which knows how to transform the original
data to some custom representation.
A Transformer implementation could be stateful or stateless. However
it's very easy to write stateful Transformer, which actaully doesn't
save any state internally, but uses AttributeStorage as an external
state storage. Please note, that AttributeStorage is being passed
as the parameter to all Transformer methods. This way it's
possible to reuse single instance of a stateful Transformer to
process lots of concurrent transformations.
| Method Summary | |
|---|---|
TransformationResult<K,L> |
getLastResult(AttributeStorage storage)
Gets the last returned Transformer result. |
java.lang.String |
getName()
Get the Transformer name. |
boolean |
hasInputRemaining(AttributeStorage storage,
K input)
|
void |
release(AttributeStorage storage)
The Transformer has done its work and can release all associated resource. |
TransformationResult<K,L> |
transform(AttributeStorage storage,
K input)
Transforms an input data to some custom representation. |
| Method Detail |
|---|
java.lang.String getName()
TransformationResult<K,L> transform(AttributeStorage storage,
K input)
throws TransformationException
AttributeStorage).
storage - the external state storage, where Transformer could
get/put a state.
TransformationResult
TransformationExceptionTransformationResult<K,L> getLastResult(AttributeStorage storage)
storage - the external state storage, where Transformer
could retrieve or store its state.
void release(AttributeStorage storage)
storage - the external state storage, where Transformer
could retrieve or store its state.
boolean hasInputRemaining(AttributeStorage storage,
K input)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||