SnapshotCloneListIterable
returns a list iterator on a "snapshot" of a list, allowing for concurrent access to the original list. A copy of the list is created when the list iterable is constructed. As a result, the contents of the list will be the same with every call to {@link #iterator()}, even if the original list is modified via the list iterator's mutation methods. The original list passed to the SnapshotCloneListIterable
's constructor should be thread-safe (e.g. {@link java.util.Vector}); otherwise you run the risk of a corrupted list.
By default, the list iterator returned by a SnapshotCloneListIterable
does not support the {@link ListIterator} mutation operations; this is because it does nothave access to the original list. But if the SnapshotCloneListIterable
is supplied with a {@link org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator.Mutator}it will delegate the {@link ListIterator} mutation operations to the Mutator
.Alternatively, a subclass can override the list iterable's mutation methods.
This list iterable is useful for multiple passes over a list that should not be changed (e.g. by another thread) between passes. @param < E> the type of elements returned by the list iterable's list iterator @see CloneListIterator @see LiveCloneListIterable @see SnapshotCloneIterable
|
|