| Modifier and Type | Field and Description |
|---|---|
| private Iterator | iterator
The iterator being used |
| private Transformer | transformer
The transformer being used |
| Access | Constructor and Description |
|---|---|
| public | TransformIterator()
Constructs a new |
| public | TransformIterator(final Iterator<? extends I>
the iterator to use iterator)Constructs a new |
| public | TransformIterator(final Iterator<? extends I>
the iterator to use iterator, final Transformer<? super I, ? extends O> the transformer to use transformer)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public Iterator | |
| public Transformer | |
| public boolean | |
| public O | Returns: the next objectImplements java. |
| public void | remove()
Overrides default java. |
| public void | setIterator(final Iterator<? extends I>
the iterator to use iterator)Sets the iterator for this iterator to use. |
| public void | setTransformer(final Transformer<? super I, ? extends O>
the transformer to use transformer)Sets the transformer this the iterator to use. |
| protected O | Returns: the transformed objectthe object to transform source)Transforms the given object using the transformer. |
| iterator | back to summary |
|---|---|
| private Iterator<? extends I> iterator The iterator being used | |
| transformer | back to summary |
|---|---|
| private Transformer<? super I, ? extends O> transformer The transformer being used | |
| TransformIterator | back to summary |
|---|---|
| public TransformIterator() Constructs a new | |
| TransformIterator | back to summary |
|---|---|
| public TransformIterator(final Iterator<? extends I> iterator) Constructs a new
| |
| TransformIterator | back to summary |
|---|---|
| public TransformIterator(final Iterator<? extends I> iterator, final Transformer<? super I, ? extends O> transformer) Constructs a new
| |
| getIterator | back to summary |
|---|---|
| public Iterator Gets the iterator this iterator is using.
| |
| getTransformer | back to summary |
|---|---|
| public Transformer Gets the transformer this iterator is using.
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public O next() Implements java. 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.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |
| setIterator | back to summary |
|---|---|
| public void setIterator(final Iterator<? extends I> iterator) Sets the iterator for this iterator to use. If iteration has started, this effectively resets the iterator.
| |
| setTransformer | back to summary |
|---|---|
| public void setTransformer(final Transformer<? super I, ? extends O> transformer) Sets the transformer this the iterator to use. A null transformer is a no-op transformer.
| |
| transform | back to summary |
|---|---|
| protected O transform(final I source) Transforms the given object using the transformer. If the transformer is null, the original object is returned as-is.
| |