E - the function argument typeT - the iterator elements typepublic final class TransformedIterator<E,T> extends Object implements Iterator<T>
| Constructor and Description |
|---|
TransformedIterator(Iterator<? extends E> iterator,
UnaryFunction<? super E,? extends T> function)
Create a new TransformedIterator.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
hasNext() |
static <E> Iterator<?> |
maybeTransform(Iterator<? extends E> iter,
UnaryFunction<? super E,?> func)
Get an Iterator instance that may be transformed.
|
T |
next() |
void |
remove() |
String |
toString() |
static <E,T> Iterator<T> |
transform(Iterator<? extends E> iter,
UnaryFunction<? super E,? extends T> func)
Get a Transformed Iterator instance.
|
public TransformedIterator(Iterator<? extends E> iterator, UnaryFunction<? super E,? extends T> function)
iterator - Iterator to decoratefunction - to applypublic boolean hasNext()
hasNext in interface Iterator<T>Iterator.hasNext()public void remove()
remove in interface Iterator<T>Iterator.remove()public static <E,T> Iterator<T> transform(Iterator<? extends E> iter, UnaryFunction<? super E,? extends T> func)
E - the function argument typeT - the iterator elements typeiter - to decorate, if null result is nullfunc - transforming function, cannot be nullpublic static <E> Iterator<?> maybeTransform(Iterator<? extends E> iter, UnaryFunction<? super E,?> func)
E - the iterator elements typeiter - to decorate, if null result is nullfunc - transforming function, if null result is iterCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.