java.util.Iteratorpublic class TransformIterator
extends java.lang.Object
implements java.util.Iterator
| Constructor | 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 | Description |
|---|---|---|
java.util.Iterator |
getIterator() |
Gets the iterator this iterator is using.
|
Transformer |
getTransformer() |
Gets the transformer this iterator is using.
|
boolean |
hasNext() |
|
java.lang.Object |
next() |
Gets the next object from the iteration, transforming it using the
current transformer.
|
void |
remove() |
|
void |
setIterator(java.util.Iterator iterator) |
Sets the iterator for this iterator to use.
|
void |
setTransformer(Transformer transformer) |
Sets the transformer this the iterator to use.
|
protected java.lang.Object |
transform(java.lang.Object source) |
Transforms the given object using the transformer.
|
public 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 boolean hasNext()
hasNext in interface java.util.Iteratorpublic java.lang.Object next()
next in interface java.util.Iteratorjava.util.NoSuchElementException - if there are no more elementspublic void remove()
remove in interface java.util.Iteratorpublic java.util.Iterator getIterator()
public void setIterator(java.util.Iterator iterator)
iterator - the iterator to usepublic Transformer getTransformer()
public void setTransformer(Transformer transformer)
transformer - the transformer to useprotected java.lang.Object transform(java.lang.Object source)
source - the object to transformCopyright © 2001-2018 Apache Software Foundation. All Rights Reserved.