Modifier and Type | Method and Description |
---|---|
static <E> void |
forEachRemaining(Iterator<E> it,
Consumer<? super E> action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
static void |
forEachRemaining(PrimitiveIterator.OfDouble it,
DoubleConsumer action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
static void |
forEachRemaining(PrimitiveIterator.OfInt it,
IntConsumer action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
static void |
forEachRemaining(PrimitiveIterator.OfLong it,
LongConsumer action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
public static <E> void forEachRemaining(Iterator<E> it, Consumer<? super E> action)
The implementation behaves as if:
while (it.hasNext())
action.accept(it.next());
E
- the type of the elements for the passed iteratorit
- the Iterator
whose remaining elements should be processedaction
- The action to be performed for each elementNullPointerException
- if the specified iterator is nullNullPointerException
- if the specified action is nullpublic static void forEachRemaining(PrimitiveIterator.OfInt it, IntConsumer action)
The implementation behaves as if:
while (it.hasNext())
action.accept(it.next());
it
- the Iterator
whose remaining elements should be processedaction
- The action to be performed for each elementNullPointerException
- if the specified iterator is nullNullPointerException
- if the specified action is nullpublic static void forEachRemaining(PrimitiveIterator.OfLong it, LongConsumer action)
The implementation behaves as if:
while (it.hasNext())
action.accept(it.next());
it
- the Iterator
whose remaining elements should be processedaction
- The action to be performed for each elementNullPointerException
- if the specified iterator is nullNullPointerException
- if the specified action is nullpublic static void forEachRemaining(PrimitiveIterator.OfDouble it, DoubleConsumer action)
The implementation behaves as if:
while (it.hasNext())
action.accept(it.next());
it
- the Iterator
whose remaining elements should be processedaction
- The action to be performed for each elementNullPointerException
- if the specified iterator is nullNullPointerException
- if the specified action is nullCopyright © 2015. All rights reserved.