T1
- The element type of the delegate iteratorT2
- The element type of this iteratorpublic abstract class TransformingIterator<T1,T2>
extends java.lang.Object
implements java.util.Iterator<T2>
Iterator
that transforms its elements on-the-fly.Modifier and Type | Field and Description |
---|---|
private java.util.Iterator<T1> |
delegate |
Constructor and Description |
---|
TransformingIterator(java.util.Iterator<T1> delegate) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
T2 |
next() |
void |
remove() |
protected abstract T2 |
transform(T1 o)
Derived classes must implement this method such that it does the desired transformation.
|
private final java.util.Iterator<T1> delegate
public TransformingIterator(java.util.Iterator<T1> delegate)