Modul speiger.src.collections
Schnittstelle ShortIterator
- Alle bekannten Unterschnittstellen:
ShortBidirectionalIterator,ShortListIterator,ShortSplititerator
A Type-Specific
Iterator that reduces (un)boxing-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdefault <E> voidforEachRemaining(E input, ObjectShortConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.default voidforEachRemaining(Consumer<? super Short> action) Veraltet.Please use the corresponding type-specific function instead.default voidforEachRemaining(ShortConsumer action) Performs the given action for each remaining element until all elements have been processed or the action throws an exception.default Shortnext()Veraltet.Please use the corresponding type-specific function instead.shortReturns the next element in the iteration.default intskip(int amount) Skips the Given amount of elements if possible.
-
Methodendetails
-
nextShort
short nextShort()Returns the next element in the iteration.- Gibt zurück:
- the next element in the iteration
- Löst aus:
NoSuchElementException- if the iteration has no more elements- Siehe auch:
-
next
Veraltet.Please use the corresponding type-specific function instead.This default implementation delegates to the corresponding type-specific function.
-
forEachRemaining
Performs the given action for each remaining element until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.- Parameter:
action- The action to be performed for each element- Löst aus:
NullPointerException- if the specified action is null- Siehe auch:
- ImplSpec:
The default implementation behaves as if:
while (hasNext()) action.accept(nextShort());
-
forEachRemaining
Veraltet.Please use the corresponding type-specific function instead.This default implementation delegates to the corresponding type-specific function.
- Angegeben von:
forEachRemainingin SchnittstelleIterator<Short>
-
forEachRemaining
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Typparameter:
E- the generic type of the Object- Parameter:
input- the object that should be includedaction- The action to be performed for each element- Löst aus:
NullPointerException- if the specified action is null
-
skip
default int skip(int amount) Skips the Given amount of elements if possible. A Optimization function to skip elements faster if the implementation allows it.- Parameter:
amount- the amount of elements that should be skipped- Gibt zurück:
- the amount of elements that were skipped
-