Udostępnij za pośrednictwem


Spliterators.Spliterator Method

Definition

Overloads

Spliterator(Object[], SpliteratorCharacteristics)

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

Spliterator(ICollection, SpliteratorCharacteristics)

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.

Spliterator(IIterator, Int64, SpliteratorCharacteristics)

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

Spliterator(Object[], Int32, Int32, SpliteratorCharacteristics)

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

Spliterator(Object[], SpliteratorCharacteristics)

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

[Android.Runtime.Register("spliterator", "([Ljava/lang/Object;I)Ljava/util/Spliterator;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.ISpliterator? Spliterator (Java.Lang.Object[]? array, Java.Util.SpliteratorCharacteristics additionalCharacteristics);
[<Android.Runtime.Register("spliterator", "([Ljava/lang/Object;I)Ljava/util/Spliterator;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member Spliterator : Java.Lang.Object[] * Java.Util.SpliteratorCharacteristics -> Java.Util.ISpliterator

Parameters

array
Object[]

The array, assumed to be unmodified during use

additionalCharacteristics
SpliteratorCharacteristics

Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported

Returns

A spliterator for an array

Attributes

Remarks

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.

Java documentation for java.util.Spliterators.spliterator(java.lang.Object[], int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Spliterator(ICollection, SpliteratorCharacteristics)

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.

[Android.Runtime.Register("spliterator", "(Ljava/util/Collection;I)Ljava/util/Spliterator;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.ISpliterator? Spliterator (System.Collections.ICollection? c, Java.Util.SpliteratorCharacteristics characteristics);
[<Android.Runtime.Register("spliterator", "(Ljava/util/Collection;I)Ljava/util/Spliterator;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member Spliterator : System.Collections.ICollection * Java.Util.SpliteratorCharacteristics -> Java.Util.ISpliterator

Parameters

c
ICollection

The collection

characteristics
SpliteratorCharacteristics

Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.

Returns

A spliterator from an iterator

Attributes

Remarks

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 <em>late-binding</em>, inherits the <em>fail-fast</em> properties of the collection's iterator, and implements trySplit to permit limited parallelism.

Java documentation for java.util.Spliterators.spliterator(java.util.Collection<? extends T>, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Spliterator(IIterator, Int64, SpliteratorCharacteristics)

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

[Android.Runtime.Register("spliterator", "(Ljava/util/Iterator;JI)Ljava/util/Spliterator;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.ISpliterator? Spliterator (Java.Util.IIterator? iterator, long size, Java.Util.SpliteratorCharacteristics characteristics);
[<Android.Runtime.Register("spliterator", "(Ljava/util/Iterator;JI)Ljava/util/Spliterator;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member Spliterator : Java.Util.IIterator * int64 * Java.Util.SpliteratorCharacteristics -> Java.Util.ISpliterator

Parameters

iterator
IIterator

The iterator for the source

size
Int64

The number of elements in the source, to be reported as initial estimateSize

characteristics
SpliteratorCharacteristics

Characteristics of this spliterator's source or elements. The characteristics SIZED and SUBSIZED are additionally reported unless CONCURRENT is supplied.

Returns

A spliterator from an iterator

Attributes

Remarks

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

The spliterator is not <em>late-binding</em>, inherits the <em>fail-fast</em> 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.

Java documentation for java.util.Spliterators.spliterator(java.util.Iterator<? extends T>, long, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Spliterator(Object[], Int32, Int32, SpliteratorCharacteristics)

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

[Android.Runtime.Register("spliterator", "([Ljava/lang/Object;III)Ljava/util/Spliterator;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.ISpliterator? Spliterator (Java.Lang.Object[]? array, int fromIndex, int toIndex, Java.Util.SpliteratorCharacteristics additionalCharacteristics);
[<Android.Runtime.Register("spliterator", "([Ljava/lang/Object;III)Ljava/util/Spliterator;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member Spliterator : Java.Lang.Object[] * int * int * Java.Util.SpliteratorCharacteristics -> Java.Util.ISpliterator

Parameters

array
Object[]

The array, assumed to be unmodified during use

fromIndex
Int32

The least index (inclusive) to cover

toIndex
Int32

One past the greatest index to cover

additionalCharacteristics
SpliteratorCharacteristics

Additional spliterator characteristics of this spliterator's source or elements beyond SIZED and SUBSIZED which are always reported

Returns

A spliterator for an array

Attributes

Remarks

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.

Java documentation for java.util.Spliterators.spliterator(java.lang.Object[], int, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to