Spec-Zone .ru
спецификации, руководства, описания, API
|
T
- the boxed type of the primitive typepublic interface PrimitiveIterator<T> extends Iterator<T>
Iterator
. Specialized
subtypes are provided for int
, long
, and
double
values.
The specialized subtype default implementations of Iterator.next()
and Iterator.forEachRemaining(java.util.function.Consumer)
box
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, PrimitiveIterator.OfInt.nextInt()
and
PrimitiveIterator.OfInt.forEachRemaining(java.util.function.IntConsumer)
should be used in preference to PrimitiveIterator.OfInt.next()
and
PrimitiveIterator.OfInt.forEachRemaining(java.util.function.Consumer)
.
Iteration of primitive values using boxing-based methods
next()
and
forEachRemaining()
,
does not affect the order in which the values, transformed to boxed values,
are encountered.
org.openjdk.java.util.stream.tripwire
is set to true
then diagnostic warnings are reported if boxing of
primitive values occur when operating on primitive subtype specializations.Modifier and Type | Interface and Description |
---|---|
static interface |
PrimitiveIterator.OfDouble
An Iterator specialized for
double values. |
static interface |
PrimitiveIterator.OfInt
An Iterator specialized for
int values. |
static interface |
PrimitiveIterator.OfLong
An Iterator specialized for
long values. |
forEachRemaining, hasNext, next, remove
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.
DRAFT ea-b92