java.lang.Object | |
↳ | org.apache.commons.collections.iterators.TransformIterator |
Decorates an iterator such that each element returned is transformed.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
TransformIterator that will not function
until the setIterator method is
invoked. | |||||||||||
Constructs a new
TransformIterator that won't transform
elements from the given iterator. | |||||||||||
Constructs a new
TransformIterator that will use the
given iterator and transformer. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the iterator this iterator is using.
| |||||||||||
Gets the transformer this iterator is using.
| |||||||||||
Gets the next object from the iteration, transforming it using the
current transformer.
| |||||||||||
Sets the iterator for this iterator to use.
| |||||||||||
Sets the transformer this the iterator to use.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Transforms the given object using the transformer.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.util.Iterator
|
Constructs a new TransformIterator
that will not function
until the setIterator
method is
invoked.
Constructs a new TransformIterator
that won't transform
elements from the given iterator.
iterator | the iterator to use |
---|
Constructs a new 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 use |
---|---|
transformer | the transformer to use |
Gets the transformer this iterator is using.
Gets the next object from the iteration, transforming it using the current transformer. If the transformer is null, no transformation occurs and the object from the iterator is returned directly.
NoSuchElementException | if there are no more elements |
---|
Sets the iterator for this iterator to use. If iteration has started, this effectively resets the iterator.
iterator | the iterator to use |
---|
Sets the transformer this the iterator to use. A null transformer is a no-op transformer.
transformer | the transformer to use |
---|
Transforms the given object using the transformer. If the transformer is null, the original object is returned as-is.
source | the object to transform |
---|