Package org.teiid.common.buffer
Class LightWeightCopyOnWriteList<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- org.teiid.common.buffer.LightWeightCopyOnWriteList<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
public class LightWeightCopyOnWriteList<T> extends AbstractList<T> implements RandomAccess
Creates a copy of a reference list when modified.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description LightWeightCopyOnWriteList(List<T> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T element)
boolean
addAll(int index, Collection<? extends T> c)
boolean
addAll(Collection<? extends T> c)
void
clear()
T
get(int index)
List<T>
getList()
T
remove(int index)
T
set(int index, T element)
int
size()
Object[]
toArray()
<U> U[]
toArray(U[] a)
-
Methods inherited from class java.util.AbstractList
add, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.List
contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator
-
-
-
-
Method Detail
-
get
public T get(int index)
-
add
public void add(int index, T element)
-
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAll
in interfaceCollection<T>
- Specified by:
addAll
in interfaceList<T>
- Overrides:
addAll
in classAbstractCollection<T>
-
addAll
public boolean addAll(int index, Collection<? extends T> c)
-
remove
public T remove(int index)
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceList<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
toArray
public <U> U[] toArray(U[] a)
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceList<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<T>
- Specified by:
clear
in interfaceList<T>
- Overrides:
clear
in classAbstractList<T>
-
size
public int size()
- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in classAbstractCollection<T>
-
-