CopyOnWriteArrayList (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
boolean
[add](../../../java/util/concurrent/CopyOnWriteArrayList.html#add-E-)([E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList") e)
Appends the specified element to the end of this list.
void
[add](../../../java/util/concurrent/CopyOnWriteArrayList.html#add-int-E-)(int index,[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList") element)
Inserts the specified element at the specified position in this list.
boolean
[addAll](../../../java/util/concurrent/CopyOnWriteArrayList.html#addAll-java.util.Collection-)([Collection](../../../java/util/Collection.html "interface in java.util")<? extends [E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")> c)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator.
boolean
[addAll](../../../java/util/concurrent/CopyOnWriteArrayList.html#addAll-int-java.util.Collection-)(int index,[Collection](../../../java/util/Collection.html "interface in java.util")<? extends [E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")> c)
Inserts all of the elements in the specified collection into this list, starting at the specified position.
int
[addAllAbsent](../../../java/util/concurrent/CopyOnWriteArrayList.html#addAllAbsent-java.util.Collection-)([Collection](../../../java/util/Collection.html "interface in java.util")<? extends [E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")> c)
Appends all of the elements in the specified collection that are not already contained in this list, to the end of this list, in the order that they are returned by the specified collection's iterator.
boolean
[addIfAbsent](../../../java/util/concurrent/CopyOnWriteArrayList.html#addIfAbsent-E-)([E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList") e)
Appends the element, if not present.
void
[clear](../../../java/util/concurrent/CopyOnWriteArrayList.html#clear--)()
Removes all of the elements from this list.
[Object](../../../java/lang/Object.html "class in java.lang")
[clone](../../../java/util/concurrent/CopyOnWriteArrayList.html#clone--)()
Returns a shallow copy of this list.
boolean
[contains](../../../java/util/concurrent/CopyOnWriteArrayList.html#contains-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Returns true
if this list contains the specified element.
boolean
[containsAll](../../../java/util/concurrent/CopyOnWriteArrayList.html#containsAll-java.util.Collection-)([Collection](../../../java/util/Collection.html "interface in java.util")<?> c)
Returns true
if this list contains all of the elements of the specified collection.
boolean
[equals](../../../java/util/concurrent/CopyOnWriteArrayList.html#equals-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Compares the specified object with this list for equality.
void
[forEach](../../../java/util/concurrent/CopyOnWriteArrayList.html#forEach-java.util.function.Consumer-)([Consumer](../../../java/util/function/Consumer.html "interface in java.util.function")<? super [E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")> action)
Performs the given action for each element of the Iterable
until all elements have been processed or the action throws an exception.
[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")
[get](../../../java/util/concurrent/CopyOnWriteArrayList.html#get-int-)(int index)
Returns the element at the specified position in this list.
int
[hashCode](../../../java/util/concurrent/CopyOnWriteArrayList.html#hashCode--)()
Returns the hash code value for this list.
int
[indexOf](../../../java/util/concurrent/CopyOnWriteArrayList.html#indexOf-E-int-)([E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList") e, int index)
Returns the index of the first occurrence of the specified element in this list, searching forwards from index
, or returns -1 if the element is not found.
int
[indexOf](../../../java/util/concurrent/CopyOnWriteArrayList.html#indexOf-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
boolean
[isEmpty](../../../java/util/concurrent/CopyOnWriteArrayList.html#isEmpty--)()
Returns true
if this list contains no elements.
[Iterator](../../../java/util/Iterator.html "interface in java.util")<[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")>
[iterator](../../../java/util/concurrent/CopyOnWriteArrayList.html#iterator--)()
Returns an iterator over the elements in this list in proper sequence.
int
[lastIndexOf](../../../java/util/concurrent/CopyOnWriteArrayList.html#lastIndexOf-E-int-)([E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList") e, int index)
Returns the index of the last occurrence of the specified element in this list, searching backwards from index
, or returns -1 if the element is not found.
int
[lastIndexOf](../../../java/util/concurrent/CopyOnWriteArrayList.html#lastIndexOf-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
[ListIterator](../../../java/util/ListIterator.html "interface in java.util")<[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")>
[listIterator](../../../java/util/concurrent/CopyOnWriteArrayList.html#listIterator--)()
Returns a list iterator over the elements in this list (in proper sequence).
[ListIterator](../../../java/util/ListIterator.html "interface in java.util")<[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")>
[listIterator](../../../java/util/concurrent/CopyOnWriteArrayList.html#listIterator-int-)(int index)
Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")
[remove](../../../java/util/concurrent/CopyOnWriteArrayList.html#remove-int-)(int index)
Removes the element at the specified position in this list.
boolean
[remove](../../../java/util/concurrent/CopyOnWriteArrayList.html#remove-java.lang.Object-)([Object](../../../java/lang/Object.html "class in java.lang") o)
Removes the first occurrence of the specified element from this list, if it is present.
boolean
[removeAll](../../../java/util/concurrent/CopyOnWriteArrayList.html#removeAll-java.util.Collection-)([Collection](../../../java/util/Collection.html "interface in java.util")<?> c)
Removes from this list all of its elements that are contained in the specified collection.
boolean
[removeIf](../../../java/util/concurrent/CopyOnWriteArrayList.html#removeIf-java.util.function.Predicate-)([Predicate](../../../java/util/function/Predicate.html "interface in java.util.function")<? super [E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")> filter)
Removes all of the elements of this collection that satisfy the given predicate.
void
[replaceAll](../../../java/util/concurrent/CopyOnWriteArrayList.html#replaceAll-java.util.function.UnaryOperator-)([UnaryOperator](../../../java/util/function/UnaryOperator.html "interface in java.util.function")<[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")> operator)
Replaces each element of this list with the result of applying the operator to that element.
boolean
[retainAll](../../../java/util/concurrent/CopyOnWriteArrayList.html#retainAll-java.util.Collection-)([Collection](../../../java/util/Collection.html "interface in java.util")<?> c)
Retains only the elements in this list that are contained in the specified collection.
[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")
[set](../../../java/util/concurrent/CopyOnWriteArrayList.html#set-int-E-)(int index,[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList") element)
Replaces the element at the specified position in this list with the specified element.
int
[size](../../../java/util/concurrent/CopyOnWriteArrayList.html#size--)()
Returns the number of elements in this list.
void
[sort](../../../java/util/concurrent/CopyOnWriteArrayList.html#sort-java.util.Comparator-)([Comparator](../../../java/util/Comparator.html "interface in java.util")<? super [E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")> c)
Sorts this list according to the order induced by the specifiedComparator.
[Spliterator](../../../java/util/Spliterator.html "interface in java.util")<[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")>
[spliterator](../../../java/util/concurrent/CopyOnWriteArrayList.html#spliterator--)()
Returns a Spliterator over the elements in this list.
[List](../../../java/util/List.html "interface in java.util")<[E](../../../java/util/concurrent/CopyOnWriteArrayList.html "type parameter in CopyOnWriteArrayList")>
[subList](../../../java/util/concurrent/CopyOnWriteArrayList.html#subList-int-int-)(int fromIndex, int toIndex)
Returns a view of the portion of this list betweenfromIndex
, inclusive, and toIndex
, exclusive.
[Object](../../../java/lang/Object.html "class in java.lang")[]
[toArray](../../../java/util/concurrent/CopyOnWriteArrayList.html#toArray--)()
Returns an array containing all of the elements in this list in proper sequence (from first to last element).
<T> T[]
[toArray](../../../java/util/concurrent/CopyOnWriteArrayList.html#toArray-T:A-)(T[] a)
Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.
[String](../../../java/lang/String.html "class in java.lang")
[toString](../../../java/util/concurrent/CopyOnWriteArrayList.html#toString--)()
Returns a string representation of this list.