Package com.landawn.abacus.util
Class IntIterator
java.lang.Object
com.landawn.abacus.util.IntIterator
- Direct Known Subclasses:
IntIteratorEx
- Since:
- 0.8
- Author:
- Haiyang Li
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IntIterator
defer
(Supplier<? extends IntIterator> iteratorSupplier) Lazy evaluation.static IntIterator
empty()
filter
(IntPredicate predicate) first()
<E extends Exception>
voidforeachIndexed
(Throwables.IndexedIntConsumer<E> action) <E extends Exception>
voidforeachRemaining
(Throwables.IntConsumer<E> action) void
forEachRemaining
(Consumer<? super Integer> action) Deprecated.static IntIterator
generate
(BooleanSupplier hasNext, IntSupplier supplier) static IntIterator
generate
(IntSupplier supplier) Returns an infiniteIntIterator
.indexed()
indexed
(long startIndex) last()
limit
(long count) next()
Deprecated.abstract int
nextInt()
static IntIterator
of
(int... a) static IntIterator
of
(int[] a, int fromIndex, int toIndex) void
remove()
Deprecated.- UnsupportedOperationExceptionskip
(long n) stream()
int[]
toArray()
<C extends Collection<T>>
CtoCollection
(Supplier<? extends C> supplier) toList()
toSet()
-
Field Details
-
EMPTY
-
-
Constructor Details
-
IntIterator
public IntIterator()
-
-
Method Details
-
empty
- Returns:
-
of
- Parameters:
a
-- Returns:
-
of
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
defer
Lazy evaluation.- Parameters:
iteratorSupplier
-- Returns:
-
generate
Returns an infiniteIntIterator
.- Parameters:
supplier
-- Returns:
-
generate
- Parameters:
hasNext
-supplier
-- Returns:
-
next
Deprecated.usenextInt()
instead.- Returns:
-
nextInt
public abstract int nextInt()- Returns:
-
skip
- Parameters:
n
-- Returns:
-
limit
- Parameters:
count
-- Returns:
-
filter
- Parameters:
predicate
-- Returns:
-
first
- Returns:
-
last
- Returns:
-
toArray
public int[] toArray()- Returns:
-
toList
- Returns:
-
stream
- Returns:
-
indexed
- Returns:
-
indexed
- Parameters:
startIndex
-- Returns:
-
forEachRemaining
Deprecated.For each remaining.- Parameters:
action
-
-
foreachRemaining
- Type Parameters:
E
-- Parameters:
action
-- Throws:
E
- the e
-
foreachIndexed
- Type Parameters:
E
-- Parameters:
action
-- Throws:
E
- the e
-
remove
Deprecated.- UnsupportedOperationException- Specified by:
remove
in interfaceIterator<T>
- Throws:
UnsupportedOperationException
-
toSet
- Returns:
-
toCollection
- Type Parameters:
C
-- Parameters:
supplier
-- Returns:
-
toImmutableList
- Returns:
-
toImmutableSet
- Returns:
-
nextInt()
instead.