Top Description Inners Fields Constructors Methods
java.util

public final Class Spliterators

extends Object
Class Inheritance
Imports
java.util.function.Consumer, .DoubleConsumer, .IntConsumer, .LongConsumer

Static classes and methods for operating on or creating instances of Spliterator and its primitive specializations Spliterator.OfInt, Spliterator.OfLong, and Spliterator.OfDouble.
Since
1.8
See Also
Spliterator

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
Spliterators.AbstractDoubleSpliterator

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

public abstract static class
Spliterators.AbstractIntSpliterator

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

public abstract static class
Spliterators.AbstractLongSpliterator

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

public abstract static class
Spliterators.AbstractSpliterator<
the type of elements returned by this Spliterator
T
>

An abstract Spliterator that implements trySplit to permit limited parallelism.

pack-priv static class
Spliterators.ArraySpliterator<T>

A Spliterator designed for use by sources that traverse and split elements maintained in an unmodifiable Object[] array.

pack-priv static class
Spliterators.DoubleArraySpliterator

A Spliterator.OfDouble designed for use by sources that traverse and split elements maintained in an unmodifiable int[] array.

pack-priv static class
private abstract static class
pack-priv static class
Spliterators.IntArraySpliterator

A Spliterator.OfInt designed for use by sources that traverse and split elements maintained in an unmodifiable int[] array.

pack-priv static class
Spliterators.IntIteratorSpliterator

A Spliterator.OfInt using a given IntStream.IntIterator for element operations.

pack-priv static class
Spliterators.IteratorSpliterator<T>

A Spliterator using a given Iterator for element operations.

pack-priv static class
Spliterators.LongArraySpliterator

A Spliterator.OfLong designed for use by sources that traverse and split elements maintained in an unmodifiable int[] array.

pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final Spliterator.OfDouble
private static final Spliterator.OfInt
private static final Spliterator.OfLong
private static final Spliterator<Object>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
checkFromToBounds(int
The length of the array
arrayLength
,
int
The inclusive start index
origin
,
int
The exclusive end index
fence
)

Validate inclusive start index and exclusive end index against the length of an array.

public static Spliterator.OfDouble

Returns:

An empty spliterator
emptyDoubleSpliterator
()

Creates an empty Spliterator.OfDouble

The empty spliterator reports Spliterator#SIZED and Spliterator#SUBSIZED.

public static Spliterator.OfInt

Returns:

An empty spliterator
emptyIntSpliterator
()

Creates an empty Spliterator.OfInt

The empty spliterator reports Spliterator#SIZED and Spliterator#SUBSIZED.

public static Spliterator.OfLong

Returns:

An empty spliterator
emptyLongSpliterator
()

Creates an empty Spliterator.OfLong

The empty spliterator reports Spliterator#SIZED and Spliterator#SUBSIZED.

public static <
Type of elements
T
>
Spliterator<T>

Returns:

An empty spliterator
emptySpliterator
()

Creates an empty Spliterator

The empty spliterator reports Spliterator#SIZED and Spliterator#SUBSIZED.

public static <
Type of elements
T
>
Iterator<T>

Returns:

An iterator
iterator
(Spliterator<? extends T>
The spliterator
spliterator
)

Creates an Iterator from a Spliterator.

public static PrimitiveIterator.OfInt

Returns:

An iterator
iterator
(Spliterator.OfInt
The spliterator
spliterator
)

Creates an PrimitiveIterator.OfInt from a Spliterator.OfInt.

public static PrimitiveIterator.OfLong

Returns:

An iterator
iterator
(Spliterator.OfLong
The spliterator
spliterator
)

Creates an PrimitiveIterator.OfLong from a Spliterator.OfLong.

public static PrimitiveIterator.OfDouble

Returns:

An iterator
iterator
(Spliterator.OfDouble
The spliterator
spliterator
)

Creates an PrimitiveIterator.OfDouble from a Spliterator.OfDouble.

public static <
Type of elements
T
>
Spliterator<T>

Returns:

A spliterator for an array
spliterator
(Object[]
The array, assumed to be unmodified during use
array
,
int
Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported
additionalCharacteristics
)

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

public static <
Type of elements
T
>
Spliterator<T>

Returns:

A spliterator for an array
spliterator
(Object[]
The array, assumed to be unmodified during use
array
,
int
The least index (inclusive) to cover
fromIndex
,
int
One past the greatest index to cover
toIndex
,
int
Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported
additionalCharacteristics
)

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

public static Spliterator.OfInt

Returns:

A spliterator for an array
spliterator
(int[]
The array, assumed to be unmodified during use
array
,
int
Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported
additionalCharacteristics
)

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

public static Spliterator.OfInt

Returns:

A spliterator for an array
spliterator
(int[]
The array, assumed to be unmodified during use
array
,
int
The least index (inclusive) to cover
fromIndex
,
int
One past the greatest index to cover
toIndex
,
int
Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported
additionalCharacteristics
)

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

public static Spliterator.OfLong

Returns:

A spliterator for an array
spliterator
(long[]
The array, assumed to be unmodified during use
array
,
int
Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported
additionalCharacteristics
)

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

public static Spliterator.OfLong

Returns:

A spliterator for an array
spliterator
(long[]
The array, assumed to be unmodified during use
array
,
int
The least index (inclusive) to cover
fromIndex
,
int
One past the greatest index to cover
toIndex
,
int
Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported
additionalCharacteristics
)

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

public static Spliterator.OfDouble

Returns:

A spliterator for an array
spliterator
(double[]
The array, assumed to be unmodified during use
array
,
int
Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported
additionalCharacteristics
)

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

public static Spliterator.OfDouble

Returns:

A spliterator for an array
spliterator
(double[]
The array, assumed to be unmodified during use
array
,
int
The least index (inclusive) to cover
fromIndex
,
int
One past the greatest index to cover
toIndex
,
int
Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported
additionalCharacteristics
)

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

public static <
Type of elements
T
>
Spliterator<T>

Returns:

A spliterator from an iterator
spliterator
(Collection<? extends T>
The collection
c
,
int
Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
characteristics
)

Creates a Spliterator using the given collection's iterator as the source of elements, and reporting its size as its initial size.

public static <
Type of elements
T
>
Spliterator<T>

Returns:

A spliterator from an iterator
spliterator
(Iterator<? extends T>
The iterator for the source
iterator
,
long
The number of elements in the source, to be reported as initial estimateSize
size
,
int
Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
characteristics
)

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

public static Spliterator.OfInt

Returns:

A spliterator from an iterator
spliterator
(PrimitiveIterator.OfInt
The iterator for the source
iterator
,
long
The number of elements in the source, to be reported as initial estimateSize.
size
,
int
Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
characteristics
)

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

public static Spliterator.OfLong

Returns:

A spliterator from an iterator
spliterator
(PrimitiveIterator.OfLong
The iterator for the source
iterator
,
long
The number of elements in the source, to be reported as initial estimateSize.
size
,
int
Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
characteristics
)

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

public static Spliterator.OfDouble

Returns:

A spliterator from an iterator
spliterator
(PrimitiveIterator.OfDouble
The iterator for the source
iterator
,
long
The number of elements in the source, to be reported as initial estimateSize
size
,
int
Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.
characteristics
)

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

public static <
Type of elements
T
>
Spliterator<T>

Returns:

A spliterator from an iterator
spliteratorUnknownSize
(Iterator<? extends T>
The iterator for the source
iterator
,
int
Characteristics of this spliterator's source or elements (SIZED and SUBSIZED, if supplied, are ignored and are not reported.)
characteristics
)

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

public static Spliterator.OfInt

Returns:

A spliterator from an iterator
spliteratorUnknownSize
(PrimitiveIterator.OfInt
The iterator for the source
iterator
,
int
Characteristics of this spliterator's source or elements (SIZED and SUBSIZED, if supplied, are ignored and are not reported.)
characteristics
)

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

public static Spliterator.OfLong

Returns:

A spliterator from an iterator
spliteratorUnknownSize
(PrimitiveIterator.OfLong
The iterator for the source
iterator
,
int
Characteristics of this spliterator's source or elements (SIZED and SUBSIZED, if supplied, are ignored and are not reported.)
characteristics
)

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

public static Spliterator.OfDouble

Returns:

A spliterator from an iterator
spliteratorUnknownSize
(PrimitiveIterator.OfDouble
The iterator for the source
iterator
,
int
Characteristics of this spliterator's source or elements (SIZED and SUBSIZED, if supplied, are ignored and are not reported.)
characteristics
)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait