# Spliterator.OfDouble

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Inherited Constants](https://developer.android.com/reference/java/util/Spliterator.OfDouble#inhconstants)\|[Methods](https://developer.android.com/reference/java/util/Spliterator.OfDouble#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/java/util/Spliterator.OfDouble#inhmethods)  

# Spliterator.OfDouble

`
public
static


interface
Spliterator.OfDouble
`  
`


implements

`[OfPrimitive](https://developer.android.com/reference/java/util/Spliterator.OfPrimitive)`<`[Double](https://developer.android.com/reference/java/lang/Double)`, `[DoubleConsumer](https://developer.android.com/reference/java/util/function/DoubleConsumer)`, `[Spliterator.OfDouble](https://developer.android.com/reference/java/util/Spliterator.OfDouble)`>


`

|--------------------------------|
| java.util.Spliterator.OfDouble |

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [Spliterators.AbstractDoubleSpliterator](https://developer.android.com/reference/java/util/Spliterators.AbstractDoubleSpliterator) |------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------| | [Spliterators.AbstractDoubleSpliterator](https://developer.android.com/reference/java/util/Spliterators.AbstractDoubleSpliterator) | An abstract`Spliterator.OfDouble`that implements`trySplit`to permit limited parallelism. | |

<br />

*** ** * ** ***

A Spliterator specialized for`double`values.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[java.util.Spliterator](https://developer.android.com/reference/java/util/Spliterator) |-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CONCURRENT](https://developer.android.com/reference/java/util/Spliterator#CONCURRENT) Characteristic value signifying that the element source may be safely concurrently modified (allowing additions, replacements, and/or removals) by multiple threads without external synchronization.                                                                                     | | `int` | [DISTINCT](https://developer.android.com/reference/java/util/Spliterator#DISTINCT) Characteristic value signifying that, for each pair of encountered elements`x, y`,`!x.equals(y)`.                                                                                                                                                                                             | | `int` | [IMMUTABLE](https://developer.android.com/reference/java/util/Spliterator#IMMUTABLE) Characteristic value signifying that the element source cannot be structurally modified; that is, elements cannot be added, replaced, or removed, so such changes cannot occur during traversal.                                                                                            | | `int` | [NONNULL](https://developer.android.com/reference/java/util/Spliterator#NONNULL) Characteristic value signifying that the source guarantees that encountered elements will not be`null`.                                                                                                                                                                                         | | `int` | [ORDERED](https://developer.android.com/reference/java/util/Spliterator#ORDERED) Characteristic value signifying that an encounter order is defined for elements.                                                                                                                                                                                                                | | `int` | [SIZED](https://developer.android.com/reference/java/util/Spliterator#SIZED) Characteristic value signifying that the value returned from`estimateSize()`prior to traversal or splitting represents a finite size that, in the absence of structural source modification, represents an exact count of the number of elements that would be encountered by a complete traversal. | | `int` | [SORTED](https://developer.android.com/reference/java/util/Spliterator#SORTED) Characteristic value signifying that encounter order follows a defined sort order.                                                                                                                                                                                                                | | `int` | [SUBSIZED](https://developer.android.com/reference/java/util/Spliterator#SUBSIZED) Characteristic value signifying that all Spliterators resulting from`trySplit()`will be both[SIZED](https://developer.android.com/reference/java/util/Spliterator#SIZED)and[SUBSIZED](https://developer.android.com/reference/java/util/Spliterator#SUBSIZED).                                | |

|                                                                                                                                                                                                                           ### Public methods                                                                                                                                                                                                                            ||
|------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` default void`                                                                                            | ` `[forEachRemaining](https://developer.android.com/reference/java/util/Spliterator.OfDouble#forEachRemaining(java.util.function.Consumer<?%20super%20java.lang.Double>))`(`[Consumer](https://developer.android.com/reference/java/util/function/Consumer)`<? super `[Double](https://developer.android.com/reference/java/lang/Double)`> action) ` <br /> |
| ` default void`                                                                                            | ` `[forEachRemaining](https://developer.android.com/reference/java/util/Spliterator.OfDouble#forEachRemaining(java.util.function.DoubleConsumer))`(`[DoubleConsumer](https://developer.android.com/reference/java/util/function/DoubleConsumer)` action) `                                                                                                  |
| ` abstract boolean`                                                                                        | ` `[tryAdvance](https://developer.android.com/reference/java/util/Spliterator.OfDouble#tryAdvance(java.util.function.DoubleConsumer))`(`[DoubleConsumer](https://developer.android.com/reference/java/util/function/DoubleConsumer)` action) `                                                                                                              |
| ` default boolean`                                                                                         | ` `[tryAdvance](https://developer.android.com/reference/java/util/Spliterator.OfDouble#tryAdvance(java.util.function.Consumer<?%20super%20java.lang.Double>))`(`[Consumer](https://developer.android.com/reference/java/util/function/Consumer)`<? super `[Double](https://developer.android.com/reference/java/lang/Double)`> action) ` <br />             |
| ` abstract `[Spliterator.OfDouble](https://developer.android.com/reference/java/util/Spliterator.OfDouble) | ` `[trySplit](https://developer.android.com/reference/java/util/Spliterator.OfDouble#trySplit())`() ` If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.                                                                                         |

| ### Inherited methods |
|-----------------------|---|
| From interface` `[java.util.Spliterator.OfPrimitive](https://developer.android.com/reference/java/util/Spliterator.OfPrimitive)` ` |----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` default void`      | ` `[forEachRemaining](https://developer.android.com/reference/java/util/Spliterator.OfPrimitive#forEachRemaining(T_CONS))`(`[DoubleConsumer](https://developer.android.com/reference/java/util/function/DoubleConsumer)` action) ` Performs the given action for each remaining element, sequentially in the current thread, until all elements have been processed or the action throws an exception. | | ` abstract boolean`  | ` `[tryAdvance](https://developer.android.com/reference/java/util/Spliterator.OfPrimitive#tryAdvance(T_CONS))`(`[DoubleConsumer](https://developer.android.com/reference/java/util/function/DoubleConsumer)` action) ` If a remaining element exists, performs the given action on it, returning`true`; else returns`false`.                                                                           | | ` abstract T_SPLITR` | ` `[trySplit](https://developer.android.com/reference/java/util/Spliterator.OfPrimitive#trySplit())`() ` If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.                                                                                                                                 | ||
| From interface` `[java.util.Spliterator](https://developer.android.com/reference/java/util/Spliterator)` ` |------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int`                                                                                                                                                  | ` `[characteristics](https://developer.android.com/reference/java/util/Spliterator#characteristics())`() ` Returns a set of characteristics of this Spliterator and its elements.                                                                                                                                                                                                                                                                                                                  | | ` abstract long`                                                                                                                                                 | ` `[estimateSize](https://developer.android.com/reference/java/util/Spliterator#estimateSize())`() ` Returns an estimate of the number of elements that would be encountered by a[forEachRemaining(Consumer)](https://developer.android.com/reference/java/util/Spliterator#forEachRemaining(java.util.function.Consumer<?%20super%20T>))traversal, or returns[Long.MAX_VALUE](https://developer.android.com/reference/java/lang/Long#MAX_VALUE)if infinite, unknown, or too expensive to compute. | | ` default void`                                                                                                                                                  | ` `[forEachRemaining](https://developer.android.com/reference/java/util/Spliterator#forEachRemaining(java.util.function.Consumer<?%20super%20T>))`(`[Consumer](https://developer.android.com/reference/java/util/function/Consumer)`<? super T> action) ` Performs the given action for each remaining element, sequentially in the current thread, until all elements have been processed or the action throws an exception.                                                                      | | ` default `[Comparator](https://developer.android.com/reference/java/util/Comparator)`<? super T>`                                                               | ` `[getComparator](https://developer.android.com/reference/java/util/Spliterator#getComparator())`() ` If this Spliterator's source is[SORTED](https://developer.android.com/reference/java/util/Spliterator#SORTED)by a[Comparator](https://developer.android.com/reference/java/util/Comparator), returns that`Comparator`.                                                                                                                                                                      | | ` default long`                                                                                                                                                  | ` `[getExactSizeIfKnown](https://developer.android.com/reference/java/util/Spliterator#getExactSizeIfKnown())`() ` Convenience method that returns[estimateSize()](https://developer.android.com/reference/java/util/Spliterator#estimateSize())if this Spliterator is[SIZED](https://developer.android.com/reference/java/util/Spliterator#SIZED), else`-1`.                                                                                                                                      | | ` default boolean`                                                                                                                                               | ` `[hasCharacteristics](https://developer.android.com/reference/java/util/Spliterator#hasCharacteristics(int))`(int characteristics) ` Returns`true`if this Spliterator's[characteristics()](https://developer.android.com/reference/java/util/Spliterator#characteristics())contain all of the given characteristics.                                                                                                                                                                             | | ` abstract boolean`                                                                                                                                              | ` `[tryAdvance](https://developer.android.com/reference/java/util/Spliterator#tryAdvance(java.util.function.Consumer<?%20super%20T>))`(`[Consumer](https://developer.android.com/reference/java/util/function/Consumer)`<? super T> action) ` If a remaining element exists: performs the given action on it, returning`true`; else returns`false`.                                                                                                                                                | | ` abstract `[Spliterator](https://developer.android.com/reference/java/util/Spliterator)`<`[Double](https://developer.android.com/reference/java/lang/Double)`>` | ` `[trySplit](https://developer.android.com/reference/java/util/Spliterator#trySplit())`() ` If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.                                                                                                                                                                                                                                         | ||

## Public methods

### forEachRemaining

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void forEachRemaining (Consumer<? super Double> action)
```

<br />

<br />

##### Implementation Requirements:

- If the action is an instance of`DoubleConsumer`then it is cast to`DoubleConsumer`and passed to[forEachRemaining(java.util.function.DoubleConsumer)](https://developer.android.com/reference/java/util/Spliterator.OfDouble#forEachRemaining(java.util.function.DoubleConsumer)); otherwise the action is adapted to an instance of`DoubleConsumer`, by boxing the argument of`DoubleConsumer`, and then passed to[forEachRemaining(java.util.function.DoubleConsumer)](https://developer.android.com/reference/java/util/Spliterator.OfDouble#forEachRemaining(java.util.function.DoubleConsumer)).

|         Parameters          ||
|----------|-------------------|
| `action` | `Consumer` <br /> |

### forEachRemaining

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void forEachRemaining (DoubleConsumer action)
```

<br />

<br />

|            Parameters             ||
|----------|-------------------------|
| `action` | `DoubleConsumer` <br /> |

### tryAdvance

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract boolean tryAdvance (DoubleConsumer action)
```

<br />

<br />

|            Parameters             ||
|----------|-------------------------|
| `action` | `DoubleConsumer` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### tryAdvance

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean tryAdvance (Consumer<? super Double> action)
```

<br />

<br />

##### Implementation Requirements:

- If the action is an instance of`DoubleConsumer`then it is cast to`DoubleConsumer`and passed to[tryAdvance(java.util.function.DoubleConsumer)](https://developer.android.com/reference/java/util/Spliterator.OfDouble#tryAdvance(java.util.function.DoubleConsumer)); otherwise the action is adapted to an instance of`DoubleConsumer`, by boxing the argument of`DoubleConsumer`, and then passed to[tryAdvance(java.util.function.DoubleConsumer)](https://developer.android.com/reference/java/util/Spliterator.OfDouble#tryAdvance(java.util.function.DoubleConsumer)).

|         Parameters          ||
|----------|-------------------|
| `action` | `Consumer` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### trySplit

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract Spliterator.OfDouble trySplit ()
```

If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.

If this Spliterator is[ORDERED](https://developer.android.com/reference/java/util/Spliterator#ORDERED), the returned Spliterator must cover a strict prefix of the elements.

Unless this Spliterator covers an infinite number of elements, repeated calls to`trySplit()`must eventually return`null`. Upon non-null return:

- the value reported for`estimateSize()`before splitting, must, after splitting, be greater than or equal to`estimateSize()`for this and the returned Spliterator; and
- if this Spliterator is`SUBSIZED`, then`estimateSize()`for this spliterator before splitting must be equal to the sum of`estimateSize()`for this and the returned Spliterator after splitting.

This method may return`null`for any reason, including emptiness, inability to split after traversal has commenced, data structure constraints, and efficiency considerations.

<br />

|                                                                                                 Returns                                                                                                 ||
|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| [Spliterator.OfDouble](https://developer.android.com/reference/java/util/Spliterator.OfDouble) | a`Spliterator`covering some portion of the elements, or`null`if this spliterator cannot be split <br /> |