Package EDU.oswego.cs.dl.util.concurrent
Class CopyOnWriteArrayList.COWSubList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList
-
- EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArrayList.COWSubList
-
- All Implemented Interfaces:
Iterable
,Collection
,List
- Enclosing class:
- CopyOnWriteArrayList
protected static class CopyOnWriteArrayList.COWSubList extends AbstractList
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CopyOnWriteArrayList.COWSubList.COWSubListIterator
-
Field Summary
Fields Modifier and Type Field Description protected Object[]
expectedArray
protected CopyOnWriteArrayList
l
protected int
offset
protected int
size
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
COWSubList(CopyOnWriteArrayList list, int fromIndex, int toIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, Object element)
protected void
checkForComodification()
Object
get(int index)
Iterator
iterator()
ListIterator
listIterator(int index)
protected void
rangeCheck(int index)
Object
remove(int index)
Object
set(int index, Object element)
int
size()
List
subList(int fromIndex, int toIndex)
-
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, 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, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Field Detail
-
l
protected final CopyOnWriteArrayList l
-
offset
protected final int offset
-
size
protected int size
-
expectedArray
protected Object[] expectedArray
-
-
Constructor Detail
-
COWSubList
protected COWSubList(CopyOnWriteArrayList list, int fromIndex, int toIndex)
-
-
Method Detail
-
checkForComodification
protected void checkForComodification()
-
rangeCheck
protected void rangeCheck(int index)
-
set
public Object set(int index, Object element)
- Specified by:
set
in interfaceList
- Overrides:
set
in classAbstractList
-
get
public Object get(int index)
- Specified by:
get
in interfaceList
- Specified by:
get
in classAbstractList
-
size
public int size()
- Specified by:
size
in interfaceCollection
- Specified by:
size
in interfaceList
- Specified by:
size
in classAbstractCollection
-
add
public void add(int index, Object element)
- Specified by:
add
in interfaceList
- Overrides:
add
in classAbstractList
-
remove
public Object remove(int index)
- Specified by:
remove
in interfaceList
- Overrides:
remove
in classAbstractList
-
iterator
public Iterator iterator()
- Specified by:
iterator
in interfaceCollection
- Specified by:
iterator
in interfaceIterable
- Specified by:
iterator
in interfaceList
- Overrides:
iterator
in classAbstractList
-
listIterator
public ListIterator listIterator(int index)
- Specified by:
listIterator
in interfaceList
- Overrides:
listIterator
in classAbstractList
-
subList
public List subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceList
- Overrides:
subList
in classAbstractList
-
-