public final class IteratorUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Iterable<T> |
concatIterables(Iterable<T> first,
Iterable<T> second) |
static <T> Iterable<T> |
concatIterablesDistinct(Iterable<T> first,
Iterable<T> second,
BiPredicate<T,T> comparator) |
static <T> List<T> |
concatLists(List<T> list0,
List<T> list1) |
static <S,T> Iterable<T> |
convertIterable(Iterable<S> source,
Function<S,T> converter) |
static <S,T> Iterator<T> |
convertIterator(Iterator<S> source,
Function<S,T> converter) |
static <S,T> List<T> |
convertList(List<S> source,
Function<S,T> converter) |
static <T> Iterable<T> |
filterIterable(Iterable<T> iterable,
Predicate<T> filter) |
static <T> Iterator<T> |
filterIterator(Iterator<T> iterator,
Predicate<T> filter) |
static Iterable<Integer> |
rangeIterable(int length) |
static Iterator<Integer> |
rangeIterator(int length) |
static <T> Iterator<T> |
simpleArrayIterator(T[] array)
Like
Arrays.asList(array).iterator(), but without concurrent modification checks. |
static <T> Iterator<T> |
simpleListIterator(List<T> list)
Like
AbstractList.iterator(), but without concurrent modification checks. |
public static <S,T> Iterable<T> convertIterable(Iterable<S> source, Function<S,T> converter)
public static <S,T> Iterator<T> convertIterator(Iterator<S> source, Function<S,T> converter)
public static <T> Iterable<T> concatIterables(Iterable<T> first, Iterable<T> second)
public static <T> Iterable<T> concatIterablesDistinct(Iterable<T> first, Iterable<T> second, BiPredicate<T,T> comparator)
public static <T> Iterable<T> filterIterable(Iterable<T> iterable, Predicate<T> filter)
public static <T> Iterator<T> filterIterator(Iterator<T> iterator, Predicate<T> filter)
public static <T> Iterator<T> simpleArrayIterator(T[] array)
Arrays.asList(array).iterator(), but without concurrent modification checks.public static <T> Iterator<T> simpleListIterator(List<T> list)
AbstractList.iterator(), but without concurrent modification checks.