public class TransformIterator extends ProxyIterator
Iterator which uses a Transformer instance to
transform the contents of the Iterator into some other form| Constructor and Description |
|---|
TransformIterator()
Constructs a new
TransformIterator that will not function
until the setIterator method is
invoked. |
TransformIterator(java.util.Iterator iterator)
Constructs a new
TransformIterator that won't transform
elements from the given iterator. |
TransformIterator(java.util.Iterator iterator,
Transformer transformer)
Constructs a new
TransformIterator that will use the
given iterator and transformer. |
| Modifier and Type | Method and Description |
|---|---|
Transformer |
getTransformer()
Getter for property transformer.
|
java.lang.Object |
next()
Returns the next element from the underlying iterator.
|
void |
setTransformer(Transformer transformer)
Setter for property transformer.
|
protected java.lang.Object |
transform(java.lang.Object source)
Transforms the given object using the transformer.
|
getIterator, hasNext, remove, setIteratorpublic TransformIterator()
TransformIterator that will not function
until the setIterator method is
invoked.public TransformIterator(java.util.Iterator iterator)
TransformIterator that won't transform
elements from the given iterator.iterator - the iterator to usepublic TransformIterator(java.util.Iterator iterator,
Transformer transformer)
TransformIterator that will use the
given iterator and transformer. If the given transformer is null,
then objects will not be transformed.iterator - the iterator to usetransformer - the transformer to usepublic Transformer getTransformer()
public java.lang.Object next()
ProxyIteratornext in interface java.util.Iteratornext in class ProxyIteratorpublic void setTransformer(Transformer transformer)
transformer - New value of property transformer.protected java.lang.Object transform(java.lang.Object source)
source - the object to transformCopyright © 2001-2004 Apache Software Foundation. Documenation generated April 29 2013.