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,
Function<? 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,
Function<? 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,
Function<? super E,? extends T> func)
Get a Transformed Iterator instance.
|
public 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, Function<? 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, Function<? super E,?> func)
E
- the iterator elements typeiter
- to decorate, if null result is nullfunc
- transforming function, if null result is iterCopyright © 2003–2014 The Apache Software Foundation. All rights reserved.