- Type Parameters:
T- the type of elements returned by this PrimitiveIterator. The type must be a wrapper type for a primitive type, such as
Integerfor the primitive
T_CONS- the type of primitive consumer. The type must be a primitive specialization of
T, such as
- All Superinterfaces:
- All Known Subinterfaces:
subtypes are provided for
The specialized subtype default implementations of
primitive values to instances of their corresponding wrapper class. Such
boxing may offset any advantages gained when using the primitive
specializations. To avoid boxing, the corresponding primitive-based methods
should be used. For example,
should be used in preference to
- Implementation Note:
- If the boolean system property
org.openjdk.java.util.stream.tripwireis set to
truethen diagnostic warnings are reported if boxing of primitive values occur when operating on primitive subtype specializations.
Nested Class Summary
(T_CONS action)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.
The behavior of an iterator is unspecified if the action modifies the source of elements in any way (even by calling the
removemethod or other mutator methods of
Iteratorsubtypes), unless an overriding class has specified a concurrent modification policy.
Subsequent behavior of an iterator is unspecified if the action throws an exception.
action- The action to be performed for each element
NullPointerException- if the specified action is null