Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned (unless this collection is an instance of some class that provides a guarantee).
Spliterator over the elements in this collection.
Implementations should document characteristic values reported by the
spliterator. Such characteristic values are not required to be reported
if the spliterator reports
Spliterator.SIZED and this collection
contains no elements.
The default implementation should be overridden by subclasses that
can return a more efficient spliterator. In order to
preserve expected laziness behavior for the
parallelStream()} methods, spliterators should either have the
CONCURRENT, or be
If none of these is practical, the overriding class should describe the
spliterator's documented policy of binding and structural interference,
and should override the
methods to create streams using a
Supplier of the spliterator,
Stream<E> s = StreamSupport.stream(() -> spliterator(), spliteratorCharacteristics)
Spliterator over the elements in this collection
The default implementation creates a
from the collections's
Iterator. The spliterator inherits the
fail-fast properties of the collection's iterator.
If a spliterator covers no elements then the reporting of additional
characteristic values, beyond that of
does not aid clients to control, specialize or simplify computation.
However, this does enable shared use of an immutable and empty
spliterator instance (see
empty collections, and enables clients to determine if such a spliterator
covers no elements.