@Immutable public class Iterators extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Iterators.PreviewIterator<T>
A read only iterator that is able to preview the next value without consuming it or altering the behavior or semantics
of the normal
Iterator methods. |
static interface |
Iterators.TransformedIterator<F,T>
An iterator that is able to transform its contents to another type.
|
| Constructor and Description |
|---|
Iterators() |
| Modifier and Type | Method and Description |
|---|---|
static <T,U,V> Iterator<V> |
around(Iterable<? extends T> first,
Iterable<? extends U> second,
BiFunction<T,U,V> conversion) |
static <V,T> Iterator<T> |
around(Iterable<? extends V> iterable,
Function<V,T> conversion) |
static <T,U,V> Iterator<V> |
around(Iterator<? extends T> first,
Iterator<? extends U> second,
BiFunction<T,U,V> combineFirstAndSecond) |
static <V,T> Iterator<T> |
around(Iterator<? extends V> iterator,
Function<V,T> conversion) |
static <T> Iterable<T> |
around(Iterator<T> iterator) |
static <T> Iterator<T> |
empty() |
static <T> Iterator<T> |
join(Iterable<T> first,
Iterable<T> second) |
static <T> Iterator<T> |
join(Iterable<T> first,
T last) |
static <T> Iterator<T> |
join(Iterable<T> first,
T last1,
T last2) |
static <T> Iterator<T> |
join(Iterable<T> first,
T last1,
T last2,
T last3) |
static <T> Iterator<T> |
join(Iterable<T> first,
T last1,
T last2,
T last3,
T last4) |
static <T> Iterator<T> |
join(Iterator<T> first,
Iterator<T> second) |
static <T> Iterators.PreviewIterator<T> |
preview(Iterator<T> iter)
Get a read-only iterator that can peek at the next value before it is retrieved with
Iterator.next(). |
static <T> Iterator<T> |
readOnly(Iterable<T> iterable) |
static <V,T> Iterator<T> |
readOnly(Iterable<V> iterable,
Function<V,T> conversion) |
static <V,T> Iterator<T> |
readOnly(Iterator<? extends V> iterator,
Function<V,T> conversion) |
static <T> Iterator<T> |
readOnly(Iterator<T> iterator) |
static <V,T> Iterable<T> |
readOnlyIterable(Iterable<? extends V> iterable,
Function<V,T> conversion) |
static <T> Iterable<T> |
readOnlyIterable(Iterable<T> iterable) |
static <T> Iterable<T> |
toIterable(Iterator<T> iterator)
|
static <F,T> Iterator<T> |
transform(Iterator<F> fromIterator,
Function<? super F,? extends T> function)
Transform an iterator from a given type to super types.
|
static <T> Iterator<T> |
with(T value) |
static <T> Iterator<T> |
with(T[] values) |
static <T> Iterator<T> |
with(T value1,
T value2) |
static <T> Iterator<T> |
with(T value1,
T value2,
T value3) |
static <T> Iterator<T> |
with(T value1,
T value2,
T value3,
T... additional) |
public static <T> Iterator<T> empty()
public static <T> Iterator<T> with(T value)
public static <T> Iterator<T> with(T value1, T value2)
public static <T> Iterator<T> with(T value1, T value2, T value3)
@SafeVarargs public static <T> Iterator<T> with(T value1, T value2, T value3, T... additional)
public static <T> Iterator<T> with(T[] values)
public static <T,U,V> Iterator<V> around(Iterable<? extends T> first, Iterable<? extends U> second, BiFunction<T,U,V> conversion)
public static <T,U,V> Iterator<V> around(Iterator<? extends T> first, Iterator<? extends U> second, BiFunction<T,U,V> combineFirstAndSecond)
public static <V,T> Iterator<T> around(Iterable<? extends V> iterable, Function<V,T> conversion)
public static <V,T> Iterator<T> around(Iterator<? extends V> iterator, Function<V,T> conversion)
public static <V,T> Iterator<T> readOnly(Iterator<? extends V> iterator, Function<V,T> conversion)
public static <V,T> Iterable<T> readOnlyIterable(Iterable<? extends V> iterable, Function<V,T> conversion)
public static <T> Iterable<T> toIterable(Iterator<T> iterator)
T - the iterator typeiterator - the source iteratorpublic static <F,T> Iterator<T> transform(Iterator<F> fromIterator, Function<? super F,? extends T> function)
F - the source transform typeT - the destination transform typefromIterator - the source iteratorfunction - the function to be applied when performing element transformationpublic static <T> Iterators.PreviewIterator<T> preview(Iterator<T> iter)
Iterator.next().iter - the original iteratoriter is nullCopyright © 2021 JBoss by Red Hat. All rights reserved.