PrimitiveIterator.OfDouble
Stay organized with collections
Save and categorize content based on your preferences.
An Iterator specialized for double
values.
Public Method Summary
void
|
|
void
|
forEachRemaining( DoubleConsumer action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
Double
|
next()
Returns the next element in the iteration.
|
abstract
double
|
nextDouble()
Returns the next double element in the iteration.
|
Inherited Method Summary
From interface
java.util.Iterator
void
|
forEachRemaining( Consumer<? super E> action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
abstract
boolean
|
hasNext()
Returns true if the iteration has more elements.
|
abstract
Double
|
next()
Returns the next element in the iteration.
|
void
|
remove()
Removes from the underlying collection the last element returned
by this iterator (optional operation).
|
Public Methods
public
void
forEachRemaining
(DoubleConsumer 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.
Parameters
action |
The action to be performed for each element |
public
Double
next
()
Returns the next element in the iteration.
Returns
- the next element in the iteration
public
abstract
double
nextDouble
()
Returns the next double
element in the iteration.
Returns
- the next
double
element in the iteration
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003ePrimitiveIterator.OfDouble\u003c/code\u003e is a specialized iterator for handling \u003ccode\u003edouble\u003c/code\u003e values in Java.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods like \u003ccode\u003enextDouble()\u003c/code\u003e to directly access primitive \u003ccode\u003edouble\u003c/code\u003e elements, and \u003ccode\u003eforEachRemaining()\u003c/code\u003e to process remaining elements with a \u003ccode\u003eDoubleConsumer\u003c/code\u003e or \u003ccode\u003eConsumer<Double>\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis iterator inherits functionalities from \u003ccode\u003ePrimitiveIterator\u003c/code\u003e and \u003ccode\u003eIterator\u003c/code\u003e, offering methods such as \u003ccode\u003ehasNext()\u003c/code\u003e, \u003ccode\u003enext()\u003c/code\u003e, and \u003ccode\u003eremove()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003enextDouble()\u003c/code\u003e throws a \u003ccode\u003eNoSuchElementException\u003c/code\u003e if there are no more elements, while \u003ccode\u003eforEachRemaining()\u003c/code\u003e throws a \u003ccode\u003eNullPointerException\u003c/code\u003e if the provided action is null.\u003c/p\u003e\n"]]],[],null,["public static interface **PrimitiveIterator.OfDouble** implements [PrimitiveIterator](../../../reference/java/util/PrimitiveIterator.html)\\\u003c[Double](../../../reference/java/lang/Double.html), [DoubleConsumer](../../../reference/java/util/function/DoubleConsumer.html)\\\u003e \nAn Iterator specialized for `double` values. \n\nPublic Method Summary\n\n|----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [forEachRemaining](../../../reference/java/util/PrimitiveIterator.OfDouble.html#forEachRemaining(java.util.function.Consumer\u003c?%20super%20java.lang.Double\u003e))([Consumer](../../../reference/java/util/function/Consumer.html)\\\u003c? super [Double](../../../reference/java/lang/Double.html)\\\u003e action) |\n| void | [forEachRemaining](../../../reference/java/util/PrimitiveIterator.OfDouble.html#forEachRemaining(java.util.function.DoubleConsumer))([DoubleConsumer](../../../reference/java/util/function/DoubleConsumer.html) action) Performs the given action for each remaining element until all elements have been processed or the action throws an exception. |\n| [Double](../../../reference/java/lang/Double.html) | [next](../../../reference/java/util/PrimitiveIterator.OfDouble.html#next())() Returns the next element in the iteration. |\n| abstract double | [nextDouble](../../../reference/java/util/PrimitiveIterator.OfDouble.html#nextDouble())() Returns the next `double` element in the iteration. |\n\nInherited Method Summary \nFrom interface [java.util.PrimitiveIterator](../../../reference/java/util/PrimitiveIterator.html) \n\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [forEachRemaining](../../../reference/java/util/PrimitiveIterator.html#forEachRemaining(T_CONS))([DoubleConsumer](../../../reference/java/util/function/DoubleConsumer.html) action) Performs the given action for each remaining element, in the order elements occur when iterating, until all elements have been processed or the action throws an exception. |\n\nFrom interface [java.util.Iterator](../../../reference/java/util/Iterator.html) \n\n|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [forEachRemaining](../../../reference/java/util/Iterator.html#forEachRemaining(java.util.function.Consumer\u003c?%20super%20E\u003e))([Consumer](../../../reference/java/util/function/Consumer.html)\\\u003c? super E\\\u003e action) Performs the given action for each remaining element until all elements have been processed or the action throws an exception. |\n| abstract boolean | [hasNext](../../../reference/java/util/Iterator.html#hasNext())() Returns `true` if the iteration has more elements. |\n| abstract [Double](../../../reference/java/lang/Double.html) | [next](../../../reference/java/util/Iterator.html#next())() Returns the next element in the iteration. |\n| void | [remove](../../../reference/java/util/Iterator.html#remove())() Removes from the underlying collection the last element returned by this iterator (optional operation). |\n\nPublic Methods \n\npublic void\n**forEachRemaining**\n([Consumer](../../../reference/java/util/function/Consumer.html)\\\u003c? super [Double](../../../reference/java/lang/Double.html)\\\u003e action) \n\u003cbr /\u003e\n\nParameters\n\n| action | |\n|--------|---|\n\npublic void\n**forEachRemaining**\n([DoubleConsumer](../../../reference/java/util/function/DoubleConsumer.html) action) \nPerforms the given action for each remaining element until all elements\nhave been processed or the action throws an exception. Actions are\nperformed in the order of iteration, if that order is specified.\nExceptions thrown by the action are relayed to the caller. \n\nParameters\n\n| action | The action to be performed for each element |\n|--------|---------------------------------------------|\n\nThrows\n\n| [NullPointerException](../../../reference/java/lang/NullPointerException.html) | if the specified action is null |\n|--------------------------------------------------------------------------------|---------------------------------|\n\npublic [Double](../../../reference/java/lang/Double.html)\n**next**\n() \nReturns the next element in the iteration. \n\nReturns\n\n- the next element in the iteration \n\npublic abstract double\n**nextDouble**\n() \nReturns the next `double` element in the iteration. \n\nReturns\n\n- the next `double` element in the iteration \n\nThrows\n\n| [NoSuchElementException](../../../reference/java/util/NoSuchElementException.html) | if the iteration has no more elements |\n|------------------------------------------------------------------------------------|---------------------------------------|"]]