GeezerVison is showing docs.oracle.com — Spliterators (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
- Detail:
- Field |
- Constr |
- Method
compact1, compact2, compact3
java.util
Class Spliterators
-
-
Method Summary
All Methods Static Methods Concrete Methods
| Modifier and Type |
Method |
Description |
static Spliterator.OfDouble |
emptyDoubleSpliterator() |
Creates an empty Spliterator.OfDouble
|
static Spliterator.OfInt |
emptyIntSpliterator() |
Creates an empty Spliterator.OfInt
|
static Spliterator.OfLong |
emptyLongSpliterator() |
Creates an empty Spliterator.OfLong
|
static <T> Spliterator<T> |
emptySpliterator() |
Creates an empty Spliterator
|
static PrimitiveIterator.OfDouble |
iterator(Spliterator.OfDouble spliterator) |
Creates an PrimitiveIterator.OfDouble from a
Spliterator.OfDouble.
|
static PrimitiveIterator.OfInt |
iterator(Spliterator.OfInt spliterator) |
Creates an PrimitiveIterator.OfInt from a
Spliterator.OfInt.
|
static PrimitiveIterator.OfLong |
iterator(Spliterator.OfLong spliterator) |
Creates an PrimitiveIterator.OfLong from a
Spliterator.OfLong.
|
static <T> Iterator<T> |
iterator(Spliterator<? extends T> spliterator) |
Creates an Iterator from a Spliterator.
|
static <T> Spliterator<T> |
spliterator(Collection<? extends T> c,
int characteristics) |
|
static Spliterator.OfDouble |
spliterator(double[] array,
int additionalCharacteristics) |
Creates a Spliterator.OfDouble covering the elements of a given array,
using a customized set of spliterator characteristics.
|
static Spliterator.OfDouble |
spliterator(double[] array,
int fromIndex,
int toIndex,
int additionalCharacteristics) |
Creates a Spliterator.OfDouble covering a range of elements of a
given array, using a customized set of spliterator characteristics.
|
static Spliterator.OfInt |
spliterator(int[] array,
int additionalCharacteristics) |
Creates a Spliterator.OfInt covering the elements of a given array,
using a customized set of spliterator characteristics.
|
static Spliterator.OfInt |
spliterator(int[] array,
int fromIndex,
int toIndex,
int additionalCharacteristics) |
Creates a Spliterator.OfInt covering a range of elements of a
given array, using a customized set of spliterator characteristics.
|
static <T> Spliterator<T> |
spliterator(Iterator<? extends T> iterator,
long size,
int characteristics) |
Creates a Spliterator using a given Iterator
as the source of elements, and with a given initially reported size.
|
static Spliterator.OfLong |
spliterator(long[] array,
int additionalCharacteristics) |
Creates a Spliterator.OfLong covering the elements of a given array,
using a customized set of spliterator characteristics.
|
static Spliterator.OfLong |
spliterator(long[] array,
int fromIndex,
int toIndex,
int additionalCharacteristics) |
Creates a Spliterator.OfLong covering a range of elements of a
given array, using a customized set of spliterator characteristics.
|
static <T> Spliterator<T> |
spliterator(Object[] array,
int additionalCharacteristics) |
Creates a Spliterator covering the elements of a given array,
using a customized set of spliterator characteristics.
|
static <T> Spliterator<T> |
spliterator(Object[] array,
int fromIndex,
int toIndex,
int additionalCharacteristics) |
Creates a Spliterator covering a range of elements of a given
array, using a customized set of spliterator characteristics.
|
static Spliterator.OfDouble |
spliterator(PrimitiveIterator.OfDouble iterator,
long size,
int characteristics) |
Creates a Spliterator.OfDouble using a given
DoubleStream.DoubleIterator as the source of elements, and with a
given initially reported size.
|
static Spliterator.OfInt |
spliterator(PrimitiveIterator.OfInt iterator,
long size,
int characteristics) |
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(PrimitiveIterator.OfLong iterator,
long size,
int characteristics) |
Creates a Spliterator.OfLong using a given
LongStream.LongIterator as the source of elements, and with a
given initially reported size.
|
static <T> Spliterator<T> |
spliteratorUnknownSize(Iterator<? extends T> iterator,
int characteristics) |
Creates a Spliterator using a given Iterator
as the source of elements, with no initial size estimate.
|
static Spliterator.OfDouble |
spliteratorUnknownSize(PrimitiveIterator.OfDouble iterator,
int characteristics) |
Creates a Spliterator.OfDouble using a given
DoubleStream.DoubleIterator as the source of elements, with no
initial size estimate.
|
static Spliterator.OfInt |
spliteratorUnknownSize(PrimitiveIterator.OfInt iterator,
int characteristics) |
Creates a Spliterator.OfInt using a given
IntStream.IntIterator as the source of elements, with no initial
size estimate.
|
static Spliterator.OfLong |
spliteratorUnknownSize(PrimitiveIterator.OfLong iterator,
int characteristics) |
Creates a Spliterator.OfLong using a given
LongStream.LongIterator as the source of elements, with no
initial size estimate.
|
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
spliterator
public static <T> Spliterator<T> spliterator(Object[] array,
int fromIndex,
int toIndex,
int additionalCharacteristics)
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.
- Type Parameters:
T - Type of elements
- Parameters:
array - The array, assumed to be unmodified during use
fromIndex - The least index (inclusive) to cover
toIndex - One past the greatest index to cover
additionalCharacteristics - Additional spliterator characteristics
of this spliterator's source or elements beyond SIZED and
SUBSIZED which are are always reported
- Returns:
- A spliterator for an array
- Throws:
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
- See Also:
Arrays.spliterator(Object[], int, int)
-
spliterator
public static Spliterator.OfInt spliterator(int[] array,
int fromIndex,
int toIndex,
int additionalCharacteristics)
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.
- Parameters:
array - The array, assumed to be unmodified during use
fromIndex - The least index (inclusive) to cover
toIndex - One past the greatest index to cover
additionalCharacteristics - Additional spliterator characteristics
of this spliterator's source or elements beyond SIZED and
SUBSIZED which are are always reported
- Returns:
- A spliterator for an array
- Throws:
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
- See Also:
Arrays.spliterator(int[], int, int)
-
spliterator
public static Spliterator.OfLong spliterator(long[] array,
int fromIndex,
int toIndex,
int additionalCharacteristics)
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.
- Parameters:
array - The array, assumed to be unmodified during use
fromIndex - The least index (inclusive) to cover
toIndex - One past the greatest index to cover
additionalCharacteristics - Additional spliterator characteristics
of this spliterator's source or elements beyond SIZED and
SUBSIZED which are are always reported
- Returns:
- A spliterator for an array
- Throws:
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
- See Also:
Arrays.spliterator(long[], int, int)
-
spliterator
public static Spliterator.OfDouble spliterator(double[] array,
int fromIndex,
int toIndex,
int additionalCharacteristics)
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.
- Parameters:
array - The array, assumed to be unmodified during use
fromIndex - The least index (inclusive) to cover
toIndex - One past the greatest index to cover
additionalCharacteristics - Additional spliterator characteristics
of this spliterator's source or elements beyond SIZED and
SUBSIZED which are are always reported
- Returns:
- A spliterator for an array
- Throws:
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
- See Also:
Arrays.spliterator(double[], int, int)
Java™ Platform Standard Ed. 8
- Detail:
- Field |
- Constr |
- Method
Submit a bug or feature 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, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|