Taal

SpliteratorCharacteristics Enum

Definition

public enum SpliteratorCharacteristics
type SpliteratorCharacteristics = 
Inheritance
SpliteratorCharacteristics

Fields

Name Value Description
Distinct 1

Characteristic value signifying that, for each pair of encountered elements x, y, !x.equals(y). This applies for example, to a Spliterator based on a Set.

Java reference for java.util.Spliterator.DISTINCT.

Sorted 4

Characteristic value signifying that encounter order follows a defined sort order. If so, method getComparator() returns the associated Comparator, or null if all elements are Comparable and are sorted by their natural ordering. A Spliterator that reports SORTED must also report ORDERED.

Java reference for java.util.Spliterator.SORTED.

Ordered 16

Characteristic value signifying that an encounter order is defined for elements. If so, this Spliterator guarantees that method trySplit() splits a strict prefix of elements, that method tryAdvance(java.util.function.Consumer<? super T>) steps by one element in prefix order, and that forEachRemaining(java.util.function.Consumer<? super T>) performs actions in encounter order. A Collection has an encounter order if the corresponding Collection.iterator() documents an order. If so, the encounter order is the same as the documented order. Otherwise, a collection does not have an encounter order.

Java reference for java.util.Spliterator.ORDERED.

Sized 64

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.

Java reference for java.util.Spliterator.SIZED.

Nonnull 256

Characteristic value signifying that the source guarantees that encountered elements will not be null. (This applies, for example, to most concurrent collections, queues, and maps.)

Java reference for java.util.Spliterator.NONNULL.

Immutable 1024

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. A Spliterator that does not report IMMUTABLE or CONCURRENT is expected to have a documented policy (for example throwing ConcurrentModificationException) concerning structural interference detected during traversal.

Java reference for java.util.Spliterator.IMMUTABLE.

Concurrent 4096

Characteristic value signifying that the element source may be safely concurrently modified (allowing additions, replacements, and/or removals) by multiple threads without external synchronization. If so, the Spliterator is expected to have a documented policy concerning the impact of modifications during traversal. A top-level Spliterator should not report both CONCURRENT and SIZED, since the finite size, if known, may change if the source is concurrently modified during traversal. Such a Spliterator is inconsistent and no guarantees can be made about any computation using that Spliterator. Sub-spliterators may report SIZED if the sub-split size is known and additions or removals to the source are not reflected when traversing. A top-level Spliterator should not report both CONCURRENT and IMMUTABLE, since they are mutually exclusive. Such a Spliterator is inconsistent and no guarantees can be made about any computation using that Spliterator. Sub-spliterators may report IMMUTABLE if additions or removals to the source are not reflected when traversing.

Java reference for java.util.Spliterator.CONCURRENT.

Subsized 16384

Characteristic value signifying that all Spliterators resulting from trySplit() will be both SIZED and SUBSIZED. (This means that all child Spliterators, whether direct or indirect, will be SIZED.) A Spliterator that does not report SIZED as required by SUBSIZED is inconsistent and no guarantees can be made about any computation using that Spliterator.

Java reference for java.util.Spliterator.SUBSIZED.

Remarks

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