public class CopyOnWriteList<E> extends Object implements Iterable<E>
List
-like implementation that has copy-on-write semantics.
This class is suitable where highly concurrent access is needed, yet the write operation is relatively uncommon.
Modifier and Type | Class and Description |
---|---|
static class |
CopyOnWriteList.ConverterImpl
Converter implementation for XStream. |
Constructor and Description |
---|
CopyOnWriteList() |
CopyOnWriteList(List<E> core) |
Modifier and Type | Method and Description |
---|---|
void |
add(E e) |
void |
addAll(Collection<? extends E> items) |
void |
addAllTo(Collection<? super E> dst) |
void |
clear() |
boolean |
contains(Object item) |
E |
get(int index) |
List<E> |
getView() |
boolean |
isEmpty() |
Iterator<E> |
iterator()
Returns an iterator.
|
boolean |
remove(E e)
Removes an item from the list.
|
void |
replaceBy(Collection<? extends E> that)
Completely replaces this list by the contents of the given list.
|
void |
replaceBy(CopyOnWriteList<? extends E> that)
Completely replaces this list by the contents of the given list.
|
void |
replaceBy(E... that)
Completely replaces this list by the contents of the given list.
|
int |
size() |
<E> E[] |
toArray(E[] array) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public void add(E e)
public void addAll(Collection<? extends E> items)
public boolean remove(E e)
public void replaceBy(CopyOnWriteList<? extends E> that)
public void replaceBy(Collection<? extends E> that)
public void replaceBy(E... that)
public void clear()
public <E> E[] toArray(E[] array)
public void addAllTo(Collection<? super E> dst)
public E get(int index)
public boolean isEmpty()
public int size()
public boolean contains(Object item)
Copyright © 2019. All rights reserved.