public abstract class AbstractTransformer<K,L> extends Object implements Transformer<K,L>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractTransformer.LastResultAwareState<K,L> |
Modifier and Type | Field and Description |
---|---|
protected AttributeBuilder |
attributeBuilder |
protected Attribute<AbstractTransformer.LastResultAwareState<K,L>> |
stateAttr |
Constructor and Description |
---|
AbstractTransformer() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, hasInputRemaining
protected final AttributeBuilder attributeBuilder
protected final Attribute<AbstractTransformer.LastResultAwareState<K,L>> stateAttr
protected String getNamePrefix()
public final TransformationResult<K,L> transform(AttributeStorage storage, K input) throws TransformationException
Transformer
AttributeStorage
).transform
in interface Transformer<K,L>
storage
- the external state storage, where Transformer could
get/put a state.TransformationResult
TransformationException
protected abstract TransformationResult<K,L> transformImpl(AttributeStorage storage, K input) throws TransformationException
TransformationException
public final TransformationResult<K,L> getLastResult(AttributeStorage storage)
Transformer
getLastResult
in interface Transformer<K,L>
storage
- the external state storage, where Transformer
could retrieve or store its state.protected final TransformationResult<K,L> saveLastResult(AttributeStorage storage, TransformationResult<K,L> result)
public void release(AttributeStorage storage)
Transformer
release
in interface Transformer<K,L>
storage
- the external state storage, where Transformer
could retrieve or store its state.protected MemoryManager obtainMemoryManager(AttributeStorage storage)
public MemoryManager getMemoryManager()
public void setMemoryManager(MemoryManager memoryManager)
public static <T> T getValue(AttributeStorage storage, Attribute<T> attribute, T defaultValue)
protected final AbstractTransformer.LastResultAwareState<K,L> obtainStateObject(AttributeStorage storage)
protected AbstractTransformer.LastResultAwareState<K,L> createStateObject()
Copyright © 2015 Oracle Corporation. All Rights Reserved.