Spliterator.IMMUTABLE
Paul Sandoz
paul.sandoz at oracle.com
Mon Mar 11 02:04:58 PDT 2013
On Mar 10, 2013, at 3:15 PM, Doug Lea <dl at cs.oswego.edu> wrote:
> IMMUTABLE: The structure and elements cannot change during traversal.
>
> [Other] Any change in structure and/or elements represents a usage error,
> in which case the Spliterator is expected to have a documented course
> of action upon any detected change (normally a best-effort ConcurrentModificationException check).
>
> Now, whether an IMMUTABLE spliterator arises because the source is
> immutable (for example a raw input stream) or because it
> is a snapshot (for example CopyOnWriteArrayList) doesn't matter.
>
An example of the former are the Spliterators for ranges (which also happen to report DISTINCT, and SORTED when step > 0).
Paul.
More information about the lambda-libs-spec-observers
mailing list