Описание тега copyonwritearraylist

NoneAn implementation of a List collection which makes a copy of the underlying array each time the list is modified

It's a thread-safe random-access list.

Read operations (including get(int)) do not block and may overlap with update operations. Reads reflect the results of the most recently completed operations. Aggregate operations like addAll(int, Collection) and clear() are atomic; they never expose an intermediate state.

Iterators of this list never throw ConcurrentModificationException. When an iterator is created, it keeps a copy of the list's contents. It is always safe to iterate this list, but iterations may not reflect the latest state of the list.

Iterators returned by this list and its sub lists cannot modify the underlying list. In particular, remove(), add(E) and set(E) all throw UnsupportedOperationException.

This class offers extended API beyond the List interface. It includes additional overloads for indexed search (indexOf(E, int) and lastIndexOf(E, int)) and methods for conditional adds (addIfAbsent(E) and addAllAbsent(Collection)).