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 classCopyOnWriteArrayList.COWSubList.COWSubListIterator
-
Field Summary
Fields Modifier and Type Field Description protected Object[]expectedArrayprotected CopyOnWriteArrayListlprotected intoffsetprotected intsize-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCOWSubList(CopyOnWriteArrayList list, int fromIndex, int toIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Object element)protected voidcheckForComodification()Objectget(int index)Iteratoriterator()ListIteratorlistIterator(int index)protected voidrangeCheck(int index)Objectremove(int index)Objectset(int index, Object element)intsize()ListsubList(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:
setin interfaceList- Overrides:
setin classAbstractList
-
get
public Object get(int index)
- Specified by:
getin interfaceList- Specified by:
getin classAbstractList
-
size
public int size()
- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceList- Specified by:
sizein classAbstractCollection
-
add
public void add(int index, Object element)- Specified by:
addin interfaceList- Overrides:
addin classAbstractList
-
remove
public Object remove(int index)
- Specified by:
removein interfaceList- Overrides:
removein classAbstractList
-
iterator
public Iterator iterator()
- Specified by:
iteratorin interfaceCollection- Specified by:
iteratorin interfaceIterable- Specified by:
iteratorin interfaceList- Overrides:
iteratorin classAbstractList
-
listIterator
public ListIterator listIterator(int index)
- Specified by:
listIteratorin interfaceList- Overrides:
listIteratorin classAbstractList
-
subList
public List subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceList- Overrides:
subListin classAbstractList
-
-