org.apache.commons.collections.iterators
public class TransformIterator extends Object implements Iterator
Since: Commons Collections 1.0
Version: $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
| Constructor Summary | |
|---|---|
| TransformIterator()
Constructs a new TransformIterator that will not function
until the setIterator method is
invoked. | |
| TransformIterator(Iterator iterator)
Constructs a new TransformIterator that won't transform
elements from the given iterator.
| |
| TransformIterator(Iterator iterator, Transformer transformer)
Constructs a new TransformIterator that will use the
given iterator and transformer. | |
| Method Summary | |
|---|---|
| Iterator | getIterator()
Gets the iterator this iterator is using.
|
| Transformer | getTransformer()
Gets the transformer this iterator is using.
|
| boolean | hasNext() |
| Object | next()
Gets the next object from the iteration, transforming it using the
current transformer. |
| void | remove() |
| void | setIterator(Iterator iterator)
Sets the iterator for this iterator to use.
|
| void | setTransformer(Transformer transformer)
Sets the transformer this the iterator to use.
|
| protected Object | transform(Object source)
Transforms the given object using the transformer.
|
TransformIterator that will not function
until the setIterator method is
invoked.TransformIterator that won't transform
elements from the given iterator.
Parameters: iterator the iterator to use
TransformIterator that will use the
given iterator and transformer. If the given transformer is null,
then objects will not be transformed.
Parameters: iterator the iterator to use transformer the transformer to use
Returns: the iterator.
Returns: the transformer.
Returns: the next object
Throws: java.util.NoSuchElementException if there are no more elements
Parameters: iterator the iterator to use
Parameters: transformer the transformer to use
Parameters: source the object to transform
Returns: the transformed object