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
Nested ClassesModifier and TypeClassDescriptionstatic final classConverterimplementation for XStream. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddAll(Collection<? extends E> items) voidaddAllTo(Collection<? super E> dst) voidclear()booleanget(int index) getView()booleanisEmpty()iterator()Returns an iterator.booleanRemoves an item from the list.voidCompletely replaces this list by the contents of the given list.voidreplaceBy(CopyOnWriteList<? extends E> that) Completely replaces this list by the contents of the given list.voidreplaceBy(Collection<? extends E> that) Completely replaces this list by the contents of the given list.intsize()<T> T[]toArray(T[] array) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
-