public class ConcurrentCASList<E> extends Object implements List<E>
ConcurrentLinkedDeque.
| Modifier and Type | Field and Description |
|---|---|
protected AtomicInteger |
cachedSize |
protected ConcurrentLinkedDeque<E> |
deque |
| Constructor and Description |
|---|
ConcurrentCASList() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element) |
void |
add(int index,
E element) |
boolean |
addAll(Collection<? extends E> elements) |
boolean |
addAll(int index,
Collection<? extends E> col) |
void |
clear() |
boolean |
contains(Object element) |
boolean |
containsAll(Collection<?> elements) |
E |
get(int index) |
int |
indexOf(Object element) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
int |
lastIndexOf(Object element) |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
E |
remove(int index) |
boolean |
remove(Object element) |
boolean |
removeAll(Collection<?> elements) |
boolean |
retainAll(Collection<?> elements) |
E |
set(int index,
E element) |
int |
size() |
List<E> |
subList(int from,
int to) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] arr) |
protected boolean |
validateIndex(int index)
Checks whether index is 0 or the size of the list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, replaceAll, sort, spliteratorparallelStream, removeIf, streamprotected final ConcurrentLinkedDeque<E> deque
protected final AtomicInteger cachedSize
protected final boolean validateIndex(int index)
UnsupportedOperationException - if index is not 0 or size().public int size()
public boolean addAll(int index,
Collection<? extends E> col)
public boolean add(E element)
public boolean addAll(Collection<? extends E> elements)
public void clear()
public boolean contains(Object element)
public boolean containsAll(Collection<?> elements)
containsAll in interface Collection<E>containsAll in interface List<E>public boolean isEmpty()
public boolean remove(Object element)
public boolean removeAll(Collection<?> elements)
public Object[] toArray()
public <T> T[] toArray(T[] arr)
public boolean retainAll(Collection<?> elements)
public int lastIndexOf(Object element)
lastIndexOf in interface List<E>public ListIterator<E> listIterator()
listIterator in interface List<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>Copyright © 2020. All rights reserved.