609 |
*/ |
*/ |
610 |
class SubList extends AbstractList |
class SubList extends AbstractList |
611 |
{ |
{ |
612 |
private AbstractList backingList; |
private final AbstractList backingList; |
613 |
private int offset; |
private final int offset; |
614 |
private int size; |
private int size; |
615 |
|
|
616 |
/** |
/** |
623 |
SubList(AbstractList backing, int fromIndex, int toIndex) |
SubList(AbstractList backing, int fromIndex, int toIndex) |
624 |
{ |
{ |
625 |
backingList = backing; |
backingList = backing; |
626 |
modCount = backingList.modCount; |
modCount = backing.modCount; |
627 |
offset = fromIndex; |
offset = fromIndex; |
628 |
size = toIndex - fromIndex; |
size = toIndex - fromIndex; |
629 |
} |
} |
811 |
|
|
812 |
return new ListIterator() |
return new ListIterator() |
813 |
{ |
{ |
814 |
ListIterator i = backingList.listIterator(index + offset); |
private final ListIterator i = backingList.listIterator(index + offset); |
815 |
int position = index; |
private int position = index; |
816 |
|
|
817 |
public boolean hasNext() |
public boolean hasNext() |
818 |
{ |
{ |