V
- Value Typepublic class ReadWriteLockList<V>
extends java.lang.Object
implements java.util.List<V>
LinkedList
or ArrayList
synchronized with read and write lockersConstructor and Description |
---|
ReadWriteLockList()
Constructs a
ReadWriteLockList using a LinkedList with a non-fair lock |
ReadWriteLockList(boolean linkedList,
boolean fairReadWriteLock,
int initialArrayListSize)
Constructs a
ReadWriteLockList using |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
V element) |
boolean |
add(V element) |
boolean |
addAll(java.util.Collection<? extends V> collection) |
boolean |
addAll(int index,
java.util.Collection<? extends V> collection) |
void |
clear() |
boolean |
contains(java.lang.Object object) |
boolean |
containsAll(java.util.Collection<?> collection) |
V |
get(int index) |
int |
indexOf(java.lang.Object object) |
boolean |
isEmpty() |
java.util.Iterator<V> |
iterator() |
int |
lastIndexOf(java.lang.Object object) |
java.util.ListIterator<V> |
listIterator() |
java.util.ListIterator<V> |
listIterator(int index) |
V |
remove(int index) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> collection) |
boolean |
retainAll(java.util.Collection<?> collection) |
V |
set(int index,
V element) |
int |
size() |
java.util.List<V> |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
public ReadWriteLockList()
ReadWriteLockList
using a LinkedList
with a non-fair lockpublic ReadWriteLockList(boolean linkedList, boolean fairReadWriteLock, int initialArrayListSize)
ReadWriteLockList
usinglinkedList
- True with should use a LinkedList
, otherwise uses an ArrayList
fairReadWriteLock
- True if is a fair lock, otherwise is non-fairinitialArrayListSize
- The initial ArrayList
capacitypublic boolean add(V element)
public boolean addAll(java.util.Collection<? extends V> collection)
public boolean addAll(int index, java.util.Collection<? extends V> collection)
addAll
in interface java.util.List<V>
public void clear()
public boolean contains(java.lang.Object object)
public boolean containsAll(java.util.Collection<?> collection)
public int indexOf(java.lang.Object object)
indexOf
in interface java.util.List<V>
public boolean isEmpty()
public java.util.Iterator<V> iterator()
public int lastIndexOf(java.lang.Object object)
lastIndexOf
in interface java.util.List<V>
public java.util.ListIterator<V> listIterator()
listIterator
in interface java.util.List<V>
public java.util.ListIterator<V> listIterator(int index)
listIterator
in interface java.util.List<V>
public boolean remove(java.lang.Object object)
public boolean removeAll(java.util.Collection<?> collection)
public boolean retainAll(java.util.Collection<?> collection)
public int size()
public java.util.List<V> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<V>
public java.lang.Object[] toArray()