Save This Page
Home » openjdk-7 » java » util » concurrent » [javadoc | source]
java.util.concurrent
static class: CopyOnWriteArrayList.COWSubList [javadoc | source]
java.lang.Object
   java.util.AbstractCollection
      java.util.AbstractList
         java.util.concurrent.CopyOnWriteArrayList$COWSubList

All Implemented Interfaces:
    RandomAccess, List, Collection

Sublist for CopyOnWriteArrayList. This class extends AbstractList merely for convenience, to avoid having to define addAll, etc. This doesn't hurt, but is wasteful. This class does not need or use modCount mechanics in AbstractList, but does need to check for concurrent modification using similar mechanics. On each operation, the array that we expect the backing list to use is checked and updated. Since we do this for all of the base operations invoked by those defined in AbstractList, all is well. While inefficient, this is not worth improving. The kinds of list operations inherited from AbstractList are already so slow on COW sublists that adding a bit more space/time doesn't seem even noticeable.
Fields inherited from java.util.AbstractList:
modCount
Constructor:
 COWSubList(CopyOnWriteArrayList list,
    int fromIndex,
    int toIndex) 
Method from java.util.concurrent.CopyOnWriteArrayList$COWSubList Summary:
add,   clear,   get,   iterator,   listIterator,   remove,   remove,   set,   size,   subList
Methods from java.util.AbstractList:
add,   add,   addAll,   clear,   equals,   get,   hashCode,   indexOf,   iterator,   lastIndexOf,   listIterator,   listIterator,   remove,   removeRange,   set,   subList
Methods from java.util.AbstractCollection:
add,   addAll,   clear,   contains,   containsAll,   isEmpty,   iterator,   remove,   removeAll,   retainAll,   size,   toArray,   toArray,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.util.concurrent.CopyOnWriteArrayList$COWSubList Detail:
 public  void add(int index,
    E element) 
 public  void clear() 
 public E get(int index) 
 public Iterator iterator() 
 public ListIterator listIterator(int index) 
 public E remove(int index) 
 public boolean remove(Object o) 
 public E set(int index,
    E element) 
 public int size() 
 public List subList(int fromIndex,
    int toIndex)