public interface ShortIterator extends java.util.PrimitiveIterator<java.lang.Short,ShortConsumer>
Iterator
; provides an additional method to avoid (un)boxing, and
the possibility to skip elements.Iterator
Modifier and Type | Method and Description |
---|---|
default void |
forEachRemaining(java.util.function.Consumer<? super java.lang.Short> action)
Deprecated.
Please use the corresponding type-specific method instead.
|
default void |
forEachRemaining(java.util.function.IntConsumer action)
Performs the given action for each remaining element, performing widening primitive casts,
until all elements have been processed or the action throws an exception.
|
default void |
forEachRemaining(ShortConsumer action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
default java.lang.Short |
next()
Deprecated.
Please use the corresponding type-specific method instead.
|
short |
nextShort()
Returns the next element as a primitive type.
|
default int |
skip(int n)
Skips the given number of elements.
|
short nextShort()
Iterator.next()
@Deprecated default java.lang.Short next()
next
in interface java.util.Iterator<java.lang.Short>
default void forEachRemaining(ShortConsumer action)
forEachRemaining
in interface java.util.PrimitiveIterator<java.lang.Short,ShortConsumer>
action
- the action to be performed for each element.Iterator.forEachRemaining(java.util.function.Consumer)
default void forEachRemaining(java.util.function.IntConsumer action)
action
- the action to be performed for each element.Iterator.forEachRemaining(java.util.function.Consumer)
@Deprecated default void forEachRemaining(java.util.function.Consumer<? super java.lang.Short> action)
forEachRemaining
in interface java.util.Iterator<java.lang.Short>
default int skip(int n)
The effect of this call is exactly the same as that of calling next()
for n
times (possibly stopping if Iterator.hasNext()
becomes false).
n
- the number of elements to skip.Iterator.next()