|
|||||||||
| Home >> All >> java >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.util
Class AbstractList.SubList

java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.AbstractList.SubList
- All Implemented Interfaces:
- Collection, java.lang.Iterable, List
- Direct Known Subclasses:
- AbstractList.RandomAccessSubList
- Enclosing class:
- AbstractList
- private static class AbstractList.SubList
- extends AbstractList
This class follows the implementation requirements set forth in
AbstractList.subList(int, int) 55 . It matches Sun's implementation
by using a non-public top-level class in the same package.
| 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.SubList(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. |
private void |
checkBoundsExclusive(int index)
This method checks that a value is between 0 (inclusive) and size (exclusive). |
private void |
checkBoundsInclusive(int index)
This method checks that a value is between 0 and size (inclusive). |
(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.SubList
AbstractList.SubList(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.
checkBoundsInclusive
private void checkBoundsInclusive(int index)
- This method checks that a value is between 0 and size (inclusive). If
it is not, an exception is thrown.
checkBoundsExclusive
private void checkBoundsExclusive(int index)
- This method checks that a value is between 0 (inclusive) and size
(exclusive). If it is not, an exception is thrown.
size
public int size()
- Specified by AbstractList.subList to return the private field size.
- Specified by:
sizein interfaceList- Specified by:
sizein classAbstractCollection
set
public java.lang.Object set(int index, java.lang.Object o)
- Specified by AbstractList.subList to delegate to the backing list.
- Specified by:
setin interfaceList- Overrides:
setin classAbstractList
get
public java.lang.Object get(int index)
- Specified by AbstractList.subList to delegate to the backing list.
- Specified by:
getin interfaceList- Specified by:
getin classAbstractList
add
public void add(int index,
java.lang.Object o)
- Specified by AbstractList.subList to delegate to the backing list.
- Specified by:
addin interfaceList- Overrides:
addin classAbstractList
remove
public java.lang.Object remove(int index)
- Specified by AbstractList.subList to delegate to the backing list.
- Specified by:
removein interfaceList- Overrides:
removein classAbstractList
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:
removeRangein classAbstractList
addAll
public boolean addAll(int index,
Collection c)
- Specified by AbstractList.subList to delegate to the backing list.
- Specified by:
addAllin interfaceList- Overrides:
addAllin classAbstractList
addAll
public boolean addAll(Collection c)
- Specified by AbstractList.subList to return addAll(size, c).
- Specified by:
addAllin interfaceList- Overrides:
addAllin classAbstractCollection
iterator
public Iterator iterator()
- Specified by AbstractList.subList to return listIterator().
- Specified by:
iteratorin interfaceList- Overrides:
iteratorin classAbstractList
listIterator
public ListIterator listIterator(int index)
- Specified by AbstractList.subList to return a wrapper around the
backing list's iterator.
- Specified by:
listIteratorin interfaceList- Overrides:
listIteratorin classAbstractList
|
|||||||||
| Home >> All >> java >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC