Spliterators

class Spliterators
kotlin.Any
   ↳ java.util.Spliterators

Static classes and methods for operating on or creating instances of Spliterator and its primitive specializations Spliterator.OfInt, Spliterator.OfLong, and Spliterator.OfDouble.
Requires API level 24 (Android 7.0, Nougat)

Summary

Nested classes
abstract

An abstract Spliterator.OfDouble that implements trySplit to permit limited parallelism.

abstract

An abstract Spliterator.OfInt that implements trySplit to permit limited parallelism.

abstract

An abstract Spliterator.OfLong that implements trySplit to permit limited parallelism.

abstract

An abstract Spliterator that implements trySplit to permit limited parallelism.

Public methods
static Spliterator<T>!

Creates an empty Spliterator

static Spliterator.OfInt!

Creates an empty Spliterator.OfInt

static Spliterator.OfLong!

Creates an empty Spliterator.OfLong

static Spliterator.OfDouble!

Creates an empty Spliterator.OfDouble

static Spliterator<T>!
spliterator(array: Array<Any!>!, additionalCharacteristics: Int)

Creates a Spliterator covering the elements of a given array, using a customized set of spliterator characteristics.

static Spliterator<T>!
spliterator(array: Array<Any!>!, fromIndex: Int, toIndex: Int, additionalCharacteristics: Int)

Creates a Spliterator covering a range of elements of a given array, using a customized set of spliterator characteristics.

static Spliterator.OfInt!
spliterator(array: IntArray!, additionalCharacteristics: Int)

Creates a Spliterator.OfInt covering the elements of a given array, using a customized set of spliterator characteristics.

static Spliterator.OfInt!
spliterator(array: IntArray!, fromIndex: Int, toIndex: Int, additionalCharacteristics: Int)

Creates a Spliterator.OfInt covering a range of elements of a given array, using a customized set of spliterator characteristics.

static Spliterator.OfLong!
spliterator(array: LongArray!, additionalCharacteristics: Int)

Creates a Spliterator.OfLong covering the elements of a given array, using a customized set of spliterator characteristics.

static Spliterator.OfLong!
spliterator(array: LongArray!, fromIndex: Int, toIndex: Int, additionalCharacteristics: Int)

Creates a Spliterator.OfLong covering a range of elements of a given array, using a customized set of spliterator characteristics.

static Spliterator.OfDouble!
spliterator(array: DoubleArray!, additionalCharacteristics: Int)

Creates a Spliterator.OfDouble covering the elements of a given array, using a customized set of spliterator characteristics.

static Spliterator.OfDouble!
spliterator(array: DoubleArray!, fromIndex: Int, toIndex: Int, additionalCharacteristics: Int)

Creates a Spliterator.OfDouble covering a range of elements of a given array, using a customized set of spliterator characteristics.

static Spliterator<T>!
spliterator(c: MutableCollection<out T>!, characteristics: Int)

Creates a Spliterator using the given collection's java.util.Collection#iterator() as the source of elements, and reporting its java.util.Collection#size() as its initial size.

static Spliterator<T>!
spliterator(iterator: MutableIterator<T>!, size: Long, characteristics: Int)

Creates a Spliterator using a given Iterator as the source of elements, and with a given initially reported size.

static Spliterator.OfInt!
spliterator(iterator: PrimitiveIterator.OfInt!, size: Long, characteristics: Int)

Creates a Spliterator.OfInt using a given IntStream.IntIterator as the source of elements, and with a given initially reported size.

static Spliterator.OfLong!
spliterator(iterator: PrimitiveIterator.OfLong!, size: Long, characteristics: Int)

Creates a Spliterator.OfLong using a given LongStream.LongIterator as the source of elements, and with a given initially reported size.

static Spliterator.OfDouble!
spliterator(iterator: PrimitiveIterator.OfDouble!, size: Long, characteristics: Int)

Creates a Spliterator.OfDouble using a given DoubleStream.DoubleIterator as the source of elements, and with a given initially reported size.

static Spliterator<T>!
spliteratorUnknownSize(iterator: MutableIterator<T>!, characteristics: Int)

Creates a Spliterator using a given Iterator as the source of elements, with no initial size estimate.

static Spliterator.OfInt!
spliteratorUnknownSize(iterator: PrimitiveIterator.OfInt!, characteristics: Int)

Creates a Spliterator.OfInt using a given IntStream.IntIterator as the source of elements, with no initial size estimate.

static Spliterator.OfLong!
spliteratorUnknownSize(iterator: PrimitiveIterator.OfLong!, characteristics: Int)

Creates a Spliterator.OfLong using a given LongStream.LongIterator as the source of elements, with no initial size estimate.

static Spliterator.OfDouble!
spliteratorUnknownSize(iterator: PrimitiveIterator.OfDouble!, characteristics: Int)

Creates a Spliterator.OfDouble using a given DoubleStream.DoubleIterator as the source of elements, with no initial size estimate.

static MutableIterator<T>!
iterator(spliterator: Spliterator<out T>!)

Creates an Iterator from a Spliterator.

static PrimitiveIterator.OfInt!
iterator(spliterator: Spliterator.OfInt!)

Creates an PrimitiveIterator.OfInt from a Spliterator.OfInt.

static PrimitiveIterator.OfLong!

Creates an PrimitiveIterator.OfLong from a Spliterator.OfLong.

static PrimitiveIterator.OfDouble!

Creates an PrimitiveIterator.OfDouble from a Spliterator.OfDouble.

Public methods

emptySpliterator

added in API level 24
static fun <T : Any!> emptySpliterator(): Spliterator<T>!

Creates an empty Spliterator

The empty spliterator reports Spliterator#SIZED and Spliterator#SUBSIZED. Calls to java.util.Spliterator#trySplit() always return null.
Requires API level 24 (Android 7.0, Nougat)

Parameters
<T> Type of elements
Return
Spliterator<T>!: An empty spliterator

emptyIntSpliterator

added in API level 24
static fun emptyIntSpliterator(): Spliterator.OfInt!

Creates an empty Spliterator.OfInt

The empty spliterator reports Spliterator#SIZED and Spliterator#SUBSIZED. Calls to java.util.Spliterator#trySplit() always return null.
Requires API level 24 (Android 7.0, Nougat)

Return
Spliterator.OfInt!: An empty spliterator

emptyLongSpliterator

added in API level 24
static fun emptyLongSpliterator(): Spliterator.OfLong!

Creates an empty Spliterator.OfLong

The empty spliterator reports Spliterator#SIZED and Spliterator#SUBSIZED. Calls to java.util.Spliterator#trySplit() always return null.
Requires API level 24 (Android 7.0, Nougat)

Return
Spliterator.OfLong!: An empty spliterator

emptyDoubleSpliterator

added in API level 24
static fun emptyDoubleSpliterator(): Spliterator.OfDouble!

Creates an empty Spliterator.OfDouble

The empty spliterator reports Spliterator#SIZED and Spliterator#SUBSIZED. Calls to java.util.Spliterator#trySplit() always return null.
Requires API level 24 (Android 7.0, Nougat)

Return
Spliterator.OfDouble!: An empty spliterator

spliterator

added in API level 24
static fun <T : Any!> spliterator(array: Array<Any!>!, additionalCharacteristics: Int): Spliterator<T>!

Creates a Spliterator covering the elements of a given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for Spliterators which store portions of their elements in arrays, and need fine control over Spliterator characteristics. Most other situations in which a Spliterator for an array is needed should use Arrays#spliterator(Object[]).

The returned spliterator always reports the characteristics SIZED and SUBSIZED. The caller may provide additional characteristics for the spliterator to report; it is common to additionally specify IMMUTABLE and ORDERED.
Requires API level 24 (Android 7.0, Nougat)

Parameters
<T> Array<Any!>!: Type of elements
array Array<Any!>!: The array, assumed to be unmodified during use
additionalCharacteristics Array<Any!>!: Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are are always reported
Return
Spliterator<T>!: A spliterator for an array
Exceptions
NullPointerException if the given array is null

spliterator

added in API level 24
static fun <T : Any!> spliterator(array: Array<Any!>!, fromIndex: Int, toIndex: Int, additionalCharacteristics: Int): Spliterator<T>!

Creates a Spliterator covering a range of elements of a given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for Spliterators which store portions of their elements in arrays, and need fine control over Spliterator characteristics. Most other situations in which a Spliterator for an array is needed should use Arrays#spliterator(Object[]).

The returned spliterator always reports the characteristics SIZED and SUBSIZED. The caller may provide additional characteristics for the spliterator to report; it is common to additionally specify IMMUTABLE and ORDERED.
Requires API level 24 (Android 7.0, Nougat)

Parameters
<T> Array<Any!>!: Type of elements
array Array<Any!>!: The array, assumed to be unmodified during use
fromIndex Array<Any!>!: The least index (inclusive) to cover
toIndex Array<Any!>!: One past the greatest index to cover
additionalCharacteristics Array<Any!>!: Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are are always reported
Return
Spliterator<T>!: A spliterator for an array
Exceptions
NullPointerException if the given array is null
ArrayIndexOutOfBoundsException if fromIndex is negative, toIndex is less than fromIndex, or toIndex is greater than the array size

spliterator

added in API level 24
static fun spliterator(array: IntArray!, additionalCharacteristics: Int): Spliterator.OfInt!

Creates a Spliterator.OfInt covering the elements of a given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for Spliterators which store portions of their elements in arrays, and need fine control over Spliterator characteristics. Most other situations in which a Spliterator for an array is needed should use Arrays#spliterator(int[]).

The returned spliterator always reports the characteristics SIZED and SUBSIZED. The caller may provide additional characteristics for the spliterator to report; it is common to additionally specify IMMUTABLE and ORDERED.
Requires API level 24 (Android 7.0, Nougat)

Parameters
array IntArray!: The array, assumed to be unmodified during use
additionalCharacteristics IntArray!: Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are are always reported
Return
Spliterator.OfInt!: A spliterator for an array
Exceptions
NullPointerException if the given array is null

spliterator

added in API level 24
static fun spliterator(array: IntArray!, fromIndex: Int, toIndex: Int, additionalCharacteristics: Int): Spliterator.OfInt!

Creates a Spliterator.OfInt covering a range of elements of a given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for Spliterators which store portions of their elements in arrays, and need fine control over Spliterator characteristics. Most other situations in which a Spliterator for an array is needed should use Arrays#spliterator(int[], int, int).

The returned spliterator always reports the characteristics SIZED and SUBSIZED. The caller may provide additional characteristics for the spliterator to report; it is common to additionally specify IMMUTABLE and ORDERED.
Requires API level 24 (Android 7.0, Nougat)

Parameters
array IntArray!: The array, assumed to be unmodified during use
fromIndex IntArray!: The least index (inclusive) to cover
toIndex IntArray!: One past the greatest index to cover
additionalCharacteristics IntArray!: Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are are always reported
Return
Spliterator.OfInt!: A spliterator for an array
Exceptions
NullPointerException if the given array is null
ArrayIndexOutOfBoundsException if fromIndex is negative, toIndex is less than fromIndex, or toIndex is greater than the array size

spliterator

added in API level 24
static fun spliterator(array: LongArray!, additionalCharacteristics: Int): Spliterator.OfLong!

Creates a Spliterator.OfLong covering the elements of a given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for Spliterators which store portions of their elements in arrays, and need fine control over Spliterator characteristics. Most other situations in which a Spliterator for an array is needed should use Arrays#spliterator(long[]).

The returned spliterator always reports the characteristics SIZED and SUBSIZED. The caller may provide additional characteristics for the spliterator to report; it is common to additionally specify IMMUTABLE and ORDERED.
Requires API level 24 (Android 7.0, Nougat)

Parameters
array LongArray!: The array, assumed to be unmodified during use
additionalCharacteristics LongArray!: Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are are always reported
Return
Spliterator.OfLong!: A spliterator for an array
Exceptions
NullPointerException if the given array is null

spliterator

added in API level 24
static fun spliterator(array: LongArray!, fromIndex: Int, toIndex: Int, additionalCharacteristics: Int): Spliterator.OfLong!

Creates a Spliterator.OfLong covering a range of elements of a given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for Spliterators which store portions of their elements in arrays, and need fine control over Spliterator characteristics. Most other situations in which a Spliterator for an array is needed should use Arrays#spliterator(long[], int, int).

The returned spliterator always reports the characteristics SIZED and SUBSIZED. The caller may provide additional characteristics for the spliterator to report. (For example, if it is known the array will not be further modified, specify IMMUTABLE; if the array data is considered to have an an encounter order, specify ORDERED). The method Arrays#spliterator(long[], int, int) can often be used instead, which returns a spliterator that reports SIZED, SUBSIZED, IMMUTABLE, and ORDERED.
Requires API level 24 (Android 7.0, Nougat)

Parameters
array LongArray!: The array, assumed to be unmodified during use
fromIndex LongArray!: The least index (inclusive) to cover
toIndex LongArray!: One past the greatest index to cover
additionalCharacteristics LongArray!: Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are are always reported
Return
Spliterator.OfLong!: A spliterator for an array
Exceptions
NullPointerException if the given array is null
ArrayIndexOutOfBoundsException if fromIndex is negative, toIndex is less than fromIndex, or toIndex is greater than the array size

spliterator

added in API level 24
static fun spliterator(array: DoubleArray!, additionalCharacteristics: Int): Spliterator.OfDouble!

Creates a Spliterator.OfDouble covering the elements of a given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for Spliterators which store portions of their elements in arrays, and need fine control over Spliterator characteristics. Most other situations in which a Spliterator for an array is needed should use Arrays#spliterator(double[]).

The returned spliterator always reports the characteristics SIZED and SUBSIZED. The caller may provide additional characteristics for the spliterator to report; it is common to additionally specify IMMUTABLE and ORDERED.
Requires API level 24 (Android 7.0, Nougat)

Parameters
array DoubleArray!: The array, assumed to be unmodified during use
additionalCharacteristics DoubleArray!: Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are are always reported
Return
Spliterator.OfDouble!: A spliterator for an array
Exceptions
NullPointerException if the given array is null

spliterator

added in API level 24
static fun spliterator(array: DoubleArray!, fromIndex: Int, toIndex: Int, additionalCharacteristics: Int): Spliterator.OfDouble!

Creates a Spliterator.OfDouble covering a range of elements of a given array, using a customized set of spliterator characteristics.

This method is provided as an implementation convenience for Spliterators which store portions of their elements in arrays, and need fine control over Spliterator characteristics. Most other situations in which a Spliterator for an array is needed should use Arrays#spliterator(double[], int, int).

The returned spliterator always reports the characteristics SIZED and SUBSIZED. The caller may provide additional characteristics for the spliterator to report. (For example, if it is known the array will not be further modified, specify IMMUTABLE; if the array data is considered to have an an encounter order, specify ORDERED). The method Arrays#spliterator(long[], int, int) can often be used instead, which returns a spliterator that reports SIZED, SUBSIZED, IMMUTABLE, and ORDERED.
Requires API level 24 (Android 7.0, Nougat)

Parameters
array DoubleArray!: The array, assumed to be unmodified during use
fromIndex DoubleArray!: The least index (inclusive) to cover
toIndex DoubleArray!: One past the greatest index to cover
additionalCharacteristics DoubleArray!: Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are are always reported
Return
Spliterator.OfDouble!: A spliterator for an array
Exceptions
NullPointerException if the given array is null
ArrayIndexOutOfBoundsException if fromIndex is negative, toIndex is less than fromIndex, or toIndex is greater than the array size

spliterator

added in API level 24
static fun <T : Any!> spliterator(c: MutableCollection<out T>!, characteristics: Int): Spliterator<T>!

Creates a Spliterator using the given collection's java.util.Collection#iterator() as the source of elements, and reporting its java.util.Collection#size() as its initial size.

The spliterator is late-binding, inherits the fail-fast properties of the collection's iterator, and implements trySplit to permit limited parallelism.
Requires API level 24 (Android 7.0, Nougat)

Parameters
<T> MutableCollection<out T>!: Type of elements
c MutableCollection<out T>!: The collection
characteristics MutableCollection<out T>!: Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
Return
Spliterator<T>!: A spliterator from an iterator
Exceptions
NullPointerException if the given collection is null

spliterator

added in API level 24
static fun <T : Any!> spliterator(iterator: MutableIterator<T>!, size: Long, characteristics: Int): Spliterator<T>!

Creates a Spliterator using a given Iterator as the source of elements, and with a given initially reported size.

The spliterator is not late-binding, inherits the fail-fast properties of the iterator, and implements trySplit to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator. The behaviour of splitting and traversal is undefined if the iterator is operated on after the spliterator is returned, or the initially reported size is not equal to the actual number of elements in the source.
Requires API level 24 (Android 7.0, Nougat)

Parameters
<T> MutableIterator<T>!: Type of elements
iterator MutableIterator<T>!: The iterator for the source
size MutableIterator<T>!: The number of elements in the source, to be reported as initial estimateSize
characteristics MutableIterator<T>!: Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
Return
Spliterator<T>!: A spliterator from an iterator
Exceptions
NullPointerException if the given iterator is null

spliterator

added in API level 24
static fun spliterator(iterator: PrimitiveIterator.OfInt!, size: Long, characteristics: Int): Spliterator.OfInt!

Creates a Spliterator.OfInt using a given IntStream.IntIterator as the source of elements, and with a given initially reported size.

The spliterator is not late-binding, inherits the fail-fast properties of the iterator, and implements trySplit to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator. The behaviour of splitting and traversal is undefined if the iterator is operated on after the spliterator is returned, or the initially reported size is not equal to the actual number of elements in the source.
Requires API level 24 (Android 7.0, Nougat)

Parameters
iterator PrimitiveIterator.OfInt!: The iterator for the source
size PrimitiveIterator.OfInt!: The number of elements in the source, to be reported as initial estimateSize.
characteristics PrimitiveIterator.OfInt!: Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
Return
Spliterator.OfInt!: A spliterator from an iterator
Exceptions
NullPointerException if the given iterator is null

spliterator

added in API level 24
static fun spliterator(iterator: PrimitiveIterator.OfLong!, size: Long, characteristics: Int): Spliterator.OfLong!

Creates a Spliterator.OfLong using a given LongStream.LongIterator as the source of elements, and with a given initially reported size.

The spliterator is not late-binding, inherits the fail-fast properties of the iterator, and implements trySplit to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator. The behaviour of splitting and traversal is undefined if the iterator is operated on after the spliterator is returned, or the initially reported size is not equal to the actual number of elements in the source.
Requires API level 24 (Android 7.0, Nougat)

Parameters
iterator PrimitiveIterator.OfLong!: The iterator for the source
size PrimitiveIterator.OfLong!: The number of elements in the source, to be reported as initial estimateSize.
characteristics PrimitiveIterator.OfLong!: Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
Return
Spliterator.OfLong!: A spliterator from an iterator
Exceptions
NullPointerException if the given iterator is null

spliterator

added in API level 24
static fun spliterator(iterator: PrimitiveIterator.OfDouble!, size: Long, characteristics: Int): Spliterator.OfDouble!

Creates a Spliterator.OfDouble using a given DoubleStream.DoubleIterator as the source of elements, and with a given initially reported size.

The spliterator is not late-binding, inherits the fail-fast properties of the iterator, and implements trySplit to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator. The behaviour of splitting and traversal is undefined if the iterator is operated on after the spliterator is returned, or the initially reported size is not equal to the actual number of elements in the source.
Requires API level 24 (Android 7.0, Nougat)

Parameters
iterator PrimitiveIterator.OfDouble!: The iterator for the source
size PrimitiveIterator.OfDouble!: The number of elements in the source, to be reported as initial estimateSize
characteristics PrimitiveIterator.OfDouble!: Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
Return
Spliterator.OfDouble!: A spliterator from an iterator
Exceptions
NullPointerException if the given iterator is null

spliteratorUnknownSize

added in API level 24
static fun <T : Any!> spliteratorUnknownSize(iterator: MutableIterator<T>!, characteristics: Int): Spliterator<T>!

Creates a Spliterator using a given Iterator as the source of elements, with no initial size estimate.

The spliterator is not late-binding, inherits the fail-fast properties of the iterator, and implements trySplit to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator. The behaviour of splitting and traversal is undefined if the iterator is operated on after the spliterator is returned.
Requires API level 24 (Android 7.0, Nougat)

Parameters
<T> MutableIterator<T>!: Type of elements
iterator MutableIterator<T>!: The iterator for the source
characteristics MutableIterator<T>!: Characteristics of this spliterator's source or elements (SIZED and SUBSIZED, if supplied, are ignored and are not reported.)
Return
Spliterator<T>!: A spliterator from an iterator
Exceptions
NullPointerException if the given iterator is null

spliteratorUnknownSize

added in API level 24
static fun spliteratorUnknownSize(iterator: PrimitiveIterator.OfInt!, characteristics: Int): Spliterator.OfInt!

Creates a Spliterator.OfInt using a given IntStream.IntIterator as the source of elements, with no initial size estimate.

The spliterator is not late-binding, inherits the fail-fast properties of the iterator, and implements trySplit to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator. The behaviour of splitting and traversal is undefined if the iterator is operated on after the spliterator is returned.
Requires API level 24 (Android 7.0, Nougat)

Parameters
iterator PrimitiveIterator.OfInt!: The iterator for the source
characteristics PrimitiveIterator.OfInt!: Characteristics of this spliterator's source or elements (SIZED and SUBSIZED, if supplied, are ignored and are not reported.)
Return
Spliterator.OfInt!: A spliterator from an iterator
Exceptions
NullPointerException if the given iterator is null

spliteratorUnknownSize

added in API level 24
static fun spliteratorUnknownSize(iterator: PrimitiveIterator.OfLong!, characteristics: Int): Spliterator.OfLong!

Creates a Spliterator.OfLong using a given LongStream.LongIterator as the source of elements, with no initial size estimate.

The spliterator is not late-binding, inherits the fail-fast properties of the iterator, and implements trySplit to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator. The behaviour of splitting and traversal is undefined if the iterator is operated on after the spliterator is returned.
Requires API level 24 (Android 7.0, Nougat)

Parameters
iterator PrimitiveIterator.OfLong!: The iterator for the source
characteristics PrimitiveIterator.OfLong!: Characteristics of this spliterator's source or elements (SIZED and SUBSIZED, if supplied, are ignored and are not reported.)
Return
Spliterator.OfLong!: A spliterator from an iterator
Exceptions
NullPointerException if the given iterator is null

spliteratorUnknownSize

added in API level 24
static fun spliteratorUnknownSize(iterator: PrimitiveIterator.OfDouble!, characteristics: Int): Spliterator.OfDouble!

Creates a Spliterator.OfDouble using a given DoubleStream.DoubleIterator as the source of elements, with no initial size estimate.

The spliterator is not late-binding, inherits the fail-fast properties of the iterator, and implements trySplit to permit limited parallelism.

Traversal of elements should be accomplished through the spliterator. The behaviour of splitting and traversal is undefined if the iterator is operated on after the spliterator is returned.
Requires API level 24 (Android 7.0, Nougat)

Parameters
iterator PrimitiveIterator.OfDouble!: The iterator for the source
characteristics PrimitiveIterator.OfDouble!: Characteristics of this spliterator's source or elements (SIZED and SUBSIZED, if supplied, are ignored and are not reported.)
Return
Spliterator.OfDouble!: A spliterator from an iterator
Exceptions
NullPointerException if the given iterator is null

iterator

added in API level 24
static fun <T : Any!> iterator(spliterator: Spliterator<out T>!): MutableIterator<T>!

Creates an Iterator from a Spliterator.

Traversal of elements should be accomplished through the iterator. The behaviour of traversal is undefined if the spliterator is operated after the iterator is returned.
Requires API level 24 (Android 7.0, Nougat)

Parameters
<T> Spliterator<out T>!: Type of elements
spliterator Spliterator<out T>!: The spliterator
Return
MutableIterator<T>!: An iterator
Exceptions
NullPointerException if the given spliterator is null

iterator

added in API level 24
static fun iterator(spliterator: Spliterator.OfInt!): PrimitiveIterator.OfInt!

Creates an PrimitiveIterator.OfInt from a Spliterator.OfInt.

Traversal of elements should be accomplished through the iterator. The behaviour of traversal is undefined if the spliterator is operated after the iterator is returned.
Requires API level 24 (Android 7.0, Nougat)

Parameters
spliterator Spliterator.OfInt!: The spliterator
Return
PrimitiveIterator.OfInt!: An iterator
Exceptions
NullPointerException if the given spliterator is null

iterator

added in API level 24
static fun iterator(spliterator: Spliterator.OfLong!): PrimitiveIterator.OfLong!

Creates an PrimitiveIterator.OfLong from a Spliterator.OfLong.

Traversal of elements should be accomplished through the iterator. The behaviour of traversal is undefined if the spliterator is operated after the iterator is returned.
Requires API level 24 (Android 7.0, Nougat)

Parameters
spliterator Spliterator.OfLong!: The spliterator
Return
PrimitiveIterator.OfLong!: An iterator
Exceptions
NullPointerException if the given spliterator is null

iterator

added in API level 24
static fun iterator(spliterator: Spliterator.OfDouble!): PrimitiveIterator.OfDouble!

Creates an PrimitiveIterator.OfDouble from a Spliterator.OfDouble.

Traversal of elements should be accomplished through the iterator. The behaviour of traversal is undefined if the spliterator is operated after the iterator is returned.
Requires API level 24 (Android 7.0, Nougat)

Parameters
spliterator Spliterator.OfDouble!: The spliterator
Return
PrimitiveIterator.OfDouble!: An iterator
Exceptions
NullPointerException if the given spliterator is null