T
- public abstract class ObjIterator<T> extends Object
Constructor and Description |
---|
ObjIterator() |
Modifier and Type | Method and Description |
---|---|
static <T> ObjIterator<T> |
empty() |
<E extends Exception> |
forEachIndexed(Throwables.IndexedConsumer<? super T,E> action) |
<E extends Exception> |
foreachRemaining(Throwables.Consumer<? super T,E> action) |
static <T> ObjIterator<T> |
generate(BooleanSupplier hasNext,
Supplier<T> supplier) |
static <T> ObjIterator<T> |
generate(Supplier<T> supplier)
Returns an infinite
ObjIterator . |
static <T> ObjIterator<T> |
just(T val) |
static <T> ObjIterator<T> |
of(Collection<T> iterable) |
static <T> ObjIterator<T> |
of(Iterable<T> iterable) |
static <T> ObjIterator<T> |
of(Iterator<T> iter) |
static <T> ObjIterator<T> |
of(Supplier<? extends Iterator<? extends T>> iteratorSupplier)
Lazy evaluation.
|
static <T> ObjIterator<T> |
oF(Supplier<T[]> arraySupplier)
Lazy evaluation.
|
static <T> ObjIterator<T> |
of(T... a) |
static <T> ObjIterator<T> |
of(T[] a,
int fromIndex,
int toIndex) |
void |
remove()
Deprecated.
- UnsupportedOperationException
|
Stream<T> |
stream() |
Object[] |
toArray() |
<A> A[] |
toArray(A[] a) |
<C extends Collection<T>> |
toCollection(Supplier<? extends C> supplier) |
ImmutableList<T> |
toImmutableList() |
ImmutableSet<T> |
toImmutableSet() |
List<T> |
toList() |
Set<T> |
toSet() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, hasNext, next
public static <T> ObjIterator<T> empty()
T
- public static <T> ObjIterator<T> just(T val)
T
- val
- @SafeVarargs public static <T> ObjIterator<T> of(T... a)
T
- a
- public static <T> ObjIterator<T> of(T[] a, int fromIndex, int toIndex)
T
- a
- fromIndex
- toIndex
- public static <T> ObjIterator<T> of(Iterator<T> iter)
T
- iter
- public static <T> ObjIterator<T> of(Collection<T> iterable)
T
- iterable
- public static <T> ObjIterator<T> of(Iterable<T> iterable)
T
- iterable
- public static <T> ObjIterator<T> of(Supplier<? extends Iterator<? extends T>> iteratorSupplier)
T
- iteratorSupplier
- public static <T> ObjIterator<T> oF(Supplier<T[]> arraySupplier)
T
- arraySupplier
- public static <T> ObjIterator<T> generate(Supplier<T> supplier)
ObjIterator
.T
- supplier
- public static <T> ObjIterator<T> generate(BooleanSupplier hasNext, Supplier<T> supplier)
T
- hasNext
- supplier
- public Object[] toArray()
public <A> A[] toArray(A[] a)
A
- a
- public <E extends Exception> void foreachRemaining(Throwables.Consumer<? super T,E> action) throws E extends Exception
E
- action
- E
- the eE extends Exception
public <E extends Exception> void forEachIndexed(Throwables.IndexedConsumer<? super T,E> action) throws E extends Exception
E
- action
- E
- the eE extends Exception
@Deprecated public void remove() throws UnsupportedOperationException
remove
in interface Iterator<T>
UnsupportedOperationException
public Set<T> toSet()
public <C extends Collection<T>> C toCollection(Supplier<? extends C> supplier)
C
- supplier
- public ImmutableList<T> toImmutableList()
public ImmutableSet<T> toImmutableSet()
Copyright © 2020. All rights reserved.