Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.util
Class AbstractList.RandomAccessSubList  view AbstractList.RandomAccessSubList download AbstractList.RandomAccessSubList.java

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.AbstractList.SubList
              extended byjava.util.AbstractList.RandomAccessSubList
All Implemented Interfaces:
Collection, java.lang.Iterable, List, RandomAccess
Enclosing class:
AbstractList

private static final class AbstractList.RandomAccessSubList
extends AbstractList.SubList
implements RandomAccess

This class is a RandomAccess version of SubList, as required by AbstractList.subList(int, int) 55 .


Nested Class Summary
 
Nested classes inherited from class java.util.AbstractList
 
Field Summary
(package private)  AbstractList backingList
          The original list.
(package private)  int offset
          The index of the first element of the sublist.
(package private)  int size
          The size of the sublist.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
(package private) AbstractList.RandomAccessSubList(AbstractList backing, int fromIndex, int toIndex)
          Construct the sublist.
 
Method Summary
 void add(int index, java.lang.Object o)
          Specified by AbstractList.subList to delegate to the backing list.
 boolean addAll(Collection c)
          Specified by AbstractList.subList to return addAll(size, c).
 boolean addAll(int index, Collection c)
          Specified by AbstractList.subList to delegate to the backing list.
(package private)  void checkMod()
          This method checks the two modCount fields to ensure that there has not been a concurrent modification, returning if all is okay.
 java.lang.Object get(int index)
          Specified by AbstractList.subList to delegate to the backing list.
 Iterator iterator()
          Specified by AbstractList.subList to return listIterator().
 ListIterator listIterator(int index)
          Specified by AbstractList.subList to return a wrapper around the backing list's iterator.
 java.lang.Object remove(int index)
          Specified by AbstractList.subList to delegate to the backing list.
protected  void removeRange(int fromIndex, int toIndex)
          Specified by AbstractList.subList to delegate to the backing list.
 java.lang.Object set(int index, java.lang.Object o)
          Specified by AbstractList.subList to delegate to the backing list.
 int size()
          Specified by AbstractList.subList to return the private field size.
 
Methods inherited from class java.util.AbstractList
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, removeAllInternal, retainAll, retainAllInternal, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

backingList

final AbstractList backingList
The original list.


offset

final int offset
The index of the first element of the sublist.


size

int size
The size of the sublist.

Constructor Detail

AbstractList.RandomAccessSubList

AbstractList.RandomAccessSubList(AbstractList backing,
                                 int fromIndex,
                                 int toIndex)
Construct the sublist.

Method Detail

checkMod

void checkMod()
This method checks the two modCount fields to ensure that there has not been a concurrent modification, returning if all is okay.


size

public int size()
Specified by AbstractList.subList to return the private field size.

Specified by:
size in interface List
Specified by:
size in class AbstractCollection

set

public java.lang.Object set(int index,
                            java.lang.Object o)
Specified by AbstractList.subList to delegate to the backing list.

Specified by:
set in interface List
Overrides:
set in class AbstractList

get

public java.lang.Object get(int index)
Specified by AbstractList.subList to delegate to the backing list.

Specified by:
get in interface List
Specified by:
get in class AbstractList

add

public void add(int index,
                java.lang.Object o)
Specified by AbstractList.subList to delegate to the backing list.

Specified by:
add in interface List
Overrides:
add in class AbstractList

remove

public java.lang.Object remove(int index)
Specified by AbstractList.subList to delegate to the backing list.

Specified by:
remove in interface List
Overrides:
remove in class AbstractList

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Specified by AbstractList.subList to delegate to the backing list. This does no bounds checking, as it assumes it will only be called by trusted code like clear() which has already checked the bounds.

Overrides:
removeRange in class AbstractList

addAll

public boolean addAll(int index,
                      Collection c)
Specified by AbstractList.subList to delegate to the backing list.

Specified by:
addAll in interface List
Overrides:
addAll in class AbstractList

addAll

public boolean addAll(Collection c)
Specified by AbstractList.subList to return addAll(size, c).

Specified by:
addAll in interface List
Overrides:
addAll in class AbstractCollection

iterator

public Iterator iterator()
Specified by AbstractList.subList to return listIterator().

Specified by:
iterator in interface List
Overrides:
iterator in class AbstractList

listIterator

public ListIterator listIterator(int index)
Specified by AbstractList.subList to return a wrapper around the backing list's iterator.

Specified by:
listIterator in interface List
Overrides:
listIterator in class AbstractList