| Method from java.util.SubList Detail: |
public void add(int index,
E element) {
rangeCheckForAdd(index);
checkForComodification();
l.add(index+offset, element);
this.modCount = l.modCount;
size++;
}
|
public boolean addAll(Collection c) {
return addAll(size, c);
}
|
public boolean addAll(int index,
Collection c) {
rangeCheckForAdd(index);
int cSize = c.size();
if (cSize==0)
return false;
checkForComodification();
l.addAll(offset+index, c);
this.modCount = l.modCount;
size += cSize;
return true;
}
|
public E get(int index) {
rangeCheck(index);
checkForComodification();
return l.get(index+offset);
}
|
public Iterator iterator() {
return listIterator();
}
|
public ListIterator listIterator(int index) {
checkForComodification();
rangeCheckForAdd(index);
return new ListIterator< E >() {
private final ListIterator< E > i = l.listIterator(index+offset);
public boolean hasNext() {
return nextIndex() < size;
}
public E next() {
if (hasNext())
return i.next();
else
throw new NoSuchElementException();
}
public boolean hasPrevious() {
return previousIndex() >= 0;
}
public E previous() {
if (hasPrevious())
return i.previous();
else
throw new NoSuchElementException();
}
public int nextIndex() {
return i.nextIndex() - offset;
}
public int previousIndex() {
return i.previousIndex() - offset;
}
public void remove() {
i.remove();
SubList.this.modCount = l.modCount;
size--;
}
public void set(E e) {
i.set(e);
}
public void add(E e) {
i.add(e);
SubList.this.modCount = l.modCount;
size++;
}
};
}
|
public E remove(int index) {
rangeCheck(index);
checkForComodification();
E result = l.remove(index+offset);
this.modCount = l.modCount;
size--;
return result;
}
|
protected void removeRange(int fromIndex,
int toIndex) {
checkForComodification();
l.removeRange(fromIndex+offset, toIndex+offset);
this.modCount = l.modCount;
size -= (toIndex-fromIndex);
}
|
public E set(int index,
E element) {
rangeCheck(index);
checkForComodification();
return l.set(index+offset, element);
}
|
public int size() {
checkForComodification();
return size;
}
|
public List subList(int fromIndex,
int toIndex) {
return new SubList< E >(this, fromIndex, toIndex);
}
|