public final class IteratorUtil
extends java.lang.Object
Iterator-related utility methods.| Modifier and Type | Class and Description |
|---|---|
static interface |
IteratorUtil.ArrayIterator<T>
An
Iterator that has a notion of an "array index", which is the index of the "next" element in an
array. |
| Modifier and Type | Field and Description |
|---|---|
static java.util.Iterator |
AT_END
An iterator which is at its end.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.Iterator<T> |
atEnd() |
static <T> java.util.Iterator<T> |
filter(java.util.Iterator<? extends T> delegate,
Predicate<? super T> qualifies)
Returns an iterator which skips the elements of the delegate which do not qualifiy.
|
static <T> IteratorUtil.ArrayIterator<T> |
iterator(T[] array) |
static <T> java.util.Iterator<T> |
repeat(int n,
T value) |
static <T> java.util.Iterator<T> |
repeat(T value) |
static <I,O> java.util.Iterator<O> |
transform(java.util.Iterator<? extends I> delegate,
Transformer<? super I,? extends O> transform)
Returns an iterator which iterates the transformed elements of the delegate
|
public static final java.util.Iterator AT_END
To get the non-rawe type, use atEnd().
public static <T> java.util.Iterator<T> atEnd()
Iterator which is always at its endpublic static <T> java.util.Iterator<T> filter(java.util.Iterator<? extends T> delegate,
Predicate<? super T> qualifies)
public static <I,O> java.util.Iterator<O> transform(java.util.Iterator<? extends I> delegate,
Transformer<? super I,? extends O> transform)
public static <T> java.util.Iterator<T> repeat(T value)
public static <T> java.util.Iterator<T> repeat(int n,
T value)
public static <T> IteratorUtil.ArrayIterator<T> iterator(T[] array)