Package hudson.util
Class CopyOnWriteList<E>
java.lang.Object
hudson.util.CopyOnWriteList<E>
- All Implemented Interfaces:
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.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Converter
implementation for XStream. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addAll
(Collection<? extends E> items) void
addAllTo
(Collection<? super E> dst) void
clear()
boolean
get
(int index) getView()
boolean
isEmpty()
iterator()
Returns an iterator.boolean
Removes an item from the list.void
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
(Collection<? extends E> that) Completely replaces this list by the contents of the given list.int
size()
<T> T[]
toArray
(T[] array) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CopyOnWriteList
-
CopyOnWriteList
public CopyOnWriteList()
-
-
Method Details
-
add
-
addAll
-
remove
Removes an item from the list.- Returns:
- true if the list contained the item. False if it didn't, in which case there's no change.
-
iterator
Returns an iterator. -
replaceBy
Completely replaces this list by the contents of the given list. -
replaceBy
Completely replaces this list by the contents of the given list. -
replaceBy
Completely replaces this list by the contents of the given list. -
clear
public void clear() -
toArray
public <T> T[] toArray(T[] array) -
getView
-
addAllTo
-
get
-
isEmpty
public boolean isEmpty() -
size
public int size() -
contains
-
toString
-