public abstract class LongIterator extends Object
Modifier and Type | Field and Description |
---|---|
static LongIterator |
EMPTY |
Constructor and Description |
---|
LongIterator() |
Modifier and Type | Method and Description |
---|---|
static LongIterator |
empty() |
<E extends Exception> |
forEachIndexed(Throwables.IndexedLongConsumer<E> action) |
void |
forEachRemaining(Consumer<? super Long> action)
Deprecated.
|
<E extends Exception> |
foreachRemaining(Throwables.LongConsumer<E> action) |
static LongIterator |
generate(BooleanSupplier hasNext,
LongSupplier supplier) |
static LongIterator |
generate(LongSupplier supplier)
Returns an infinite
LongIterator . |
Long |
next()
Deprecated.
|
abstract long |
nextLong() |
static LongIterator |
of(long... a) |
static LongIterator |
of(long[] a,
int fromIndex,
int toIndex) |
static LongIterator |
of(Supplier<? extends LongIterator> iteratorSupplier)
Lazy evaluation.
|
static LongIterator |
oF(Supplier<long[]> arraySupplier)
Lazy evaluation.
|
void |
remove()
Deprecated.
- UnsupportedOperationException
|
LongStream |
stream() |
long[] |
toArray() |
<C extends Collection<T>> |
toCollection(Supplier<? extends C> supplier) |
ImmutableList<T> |
toImmutableList() |
ImmutableSet<T> |
toImmutableSet() |
LongList |
toList() |
Set<T> |
toSet() |
public static final LongIterator EMPTY
public static LongIterator empty()
@SafeVarargs public static LongIterator of(long... a)
a
- public static LongIterator of(long[] a, int fromIndex, int toIndex)
a
- fromIndex
- toIndex
- public static LongIterator of(Supplier<? extends LongIterator> iteratorSupplier)
iteratorSupplier
- public static LongIterator oF(Supplier<long[]> arraySupplier)
arraySupplier
- public static LongIterator generate(LongSupplier supplier)
LongIterator
.supplier
- public static LongIterator generate(BooleanSupplier hasNext, LongSupplier supplier)
hasNext
- supplier
- @Deprecated public Long next()
public abstract long nextLong()
public long[] toArray()
public LongList toList()
public LongStream stream()
public <E extends Exception> void foreachRemaining(Throwables.LongConsumer<E> action) throws E extends Exception
E
- action
- E
- the eE extends Exception
@Deprecated public void forEachRemaining(Consumer<? super Long> action)
action
- public <E extends Exception> void forEachIndexed(Throwables.IndexedLongConsumer<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.