Package com.landawn.abacus.util
Class FloatIterator
java.lang.Object
com.landawn.abacus.util.FloatIterator
- Direct Known Subclasses:
FloatIteratorEx
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FloatIterator
defer
(Supplier<? extends FloatIterator> iteratorSupplier) Returns an FloatIterator instance that is created lazily using the provided Supplier.static FloatIterator
empty()
filter
(FloatPredicate predicate) first()
<E extends Exception>
voidforeachIndexed
(Throwables.IntFloatConsumer<E> action) <E extends Exception>
voidforeachRemaining
(Throwables.FloatConsumer<E> action) void
forEachRemaining
(Consumer<? super Float> action) Deprecated.static FloatIterator
generate
(FloatSupplier supplier) Returns an infiniteFloatIterator
.static FloatIterator
generate
(BooleanSupplier hasNext, FloatSupplier supplier) indexed()
indexed
(long startIndex) last()
limit
(long count) next()
Deprecated.abstract float
static FloatIterator
of
(float... a) static FloatIterator
of
(float[] a, int fromIndex, int toIndex) void
remove()
Deprecated.- UnsupportedOperationExceptionskip
(long n) stream()
float[]
toArray()
<C extends Collection<T>>
CtoCollection
(Supplier<? extends C> supplier) toList()
toSet()
-
Field Details
-
EMPTY
-
-
Constructor Details
-
FloatIterator
public FloatIterator()
-
-
Method Details
-
empty
-
of
- Parameters:
a
-- Returns:
-
of
public static FloatIterator of(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException - Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IndexOutOfBoundsException
-
defer
public static FloatIterator defer(Supplier<? extends FloatIterator> iteratorSupplier) throws IllegalArgumentException Returns an FloatIterator instance that is created lazily using the provided Supplier. The Supplier is responsible for producing the FloatIterator instance when the FloatIterator's methods are first called.- Parameters:
iteratorSupplier
- A Supplier that provides the FloatIterator when needed.- Returns:
- A FloatIterator that is initialized on the first call to hasNext() or nextByte().
- Throws:
IllegalArgumentException
- if iteratorSupplier isnull
.
-
generate
Returns an infiniteFloatIterator
.- Parameters:
supplier
-- Returns:
- Throws:
IllegalArgumentException
-
generate
public static FloatIterator generate(BooleanSupplier hasNext, FloatSupplier supplier) throws IllegalArgumentException - Parameters:
hasNext
-supplier
-- Returns:
- Throws:
IllegalArgumentException
-
next
Deprecated.usenextFloat()
instead.- Returns:
-
nextFloat
public abstract float nextFloat() -
skip
- Parameters:
n
-- Returns:
- Throws:
IllegalArgumentException
-
limit
- Parameters:
count
-- Returns:
- Throws:
IllegalArgumentException
-
filter
- Parameters:
predicate
-- Returns:
- Throws:
IllegalArgumentException
-
first
-
last
-
toArray
public float[] toArray() -
toList
-
stream
-
indexed
-
indexed
- Parameters:
startIndex
-- Returns:
-
forEachRemaining
@Deprecated public void forEachRemaining(Consumer<? super Float> action) throws IllegalArgumentException Deprecated.For each remaining.- Parameters:
action
-- Throws:
IllegalArgumentException
-
foreachRemaining
- Type Parameters:
E
-- Parameters:
action
-- Throws:
E
- the e
-
foreachIndexed
public <E extends Exception> void foreachIndexed(Throwables.IntFloatConsumer<E> action) throws IllegalArgumentException, E - Type Parameters:
E
-- Parameters:
action
-- Throws:
IllegalArgumentException
E
- the e
-
remove
Deprecated.- UnsupportedOperationException- Specified by:
remove
in interfaceIterator<T>
- Throws:
UnsupportedOperationException
-
toSet
-
toCollection
- Type Parameters:
C
-- Parameters:
supplier
-- Returns:
-
toImmutableList
-
toImmutableSet
-
nextFloat()
instead.