public interface PrimitiveFloatIterator extends java.util.PrimitiveIterator<java.lang.Float,FloatConsumer>
float
values.
This is missing in the standard library: an iterator
for raw float
values which does everything what
OfInt
does for
[@code int}s.
Modifier and Type | Field and Description |
---|---|
static PrimitiveFloatIterator |
EMPTY
Empty iterator of primitive float values.
|
Modifier and Type | Method and Description |
---|---|
default java.util.PrimitiveIterator.OfDouble |
asDoubleIterator()
View this float iterator as a double iterator.
|
default void |
forEachRemaining(java.util.function.Consumer<? super java.lang.Float> action)
If the action is an instance of
FloatConsumer then it is cast
to FloatConsumer and passed to forEachRemaining(de.caff.generics.function.FloatConsumer) ;
otherwise the action is adapted to an instance of
FloatConsumer , by boxing the argument of FloatConsumer ,
and then passed to forEachRemaining(de.caff.generics.function.FloatConsumer) . |
default void |
forEachRemaining(FloatConsumer action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
default java.lang.Float |
next()
The default implementation boxes the result of calling
nextFloat() , and returns that boxed result. |
float |
nextFloat()
Returns the next
float element in the iteration. |
static final PrimitiveFloatIterator EMPTY
float nextFloat()
float
element in the iteration.float
element in the iterationjava.util.NoSuchElementException
- if the iteration has no more elementsdefault void forEachRemaining(@NotNull FloatConsumer action)
The default implementation behaves as if:
while (hasNext())
action.accept(nextFloat());
forEachRemaining
in interface java.util.PrimitiveIterator<java.lang.Float,FloatConsumer>
action
- The action to be performed for each elementjava.lang.NullPointerException
- if the specified action is nulldefault java.lang.Float next()
nextFloat()
, and returns that boxed result.next
in interface java.util.Iterator<java.lang.Float>
default void forEachRemaining(@NotNull java.util.function.Consumer<? super java.lang.Float> action)
FloatConsumer
then it is cast
to FloatConsumer
and passed to forEachRemaining(de.caff.generics.function.FloatConsumer)
;
otherwise the action is adapted to an instance of
FloatConsumer
, by boxing the argument of FloatConsumer
,
and then passed to forEachRemaining(de.caff.generics.function.FloatConsumer)
.forEachRemaining
in interface java.util.Iterator<java.lang.Float>
@NotNull default java.util.PrimitiveIterator.OfDouble asDoubleIterator()