public ListIterator<E> listIterator(int index) {
return new SubItr<E>(this, index + offset);
}
public E remove(int index) {
final StampedLock lock = list.lock;
long stamp = lock.writeLock();
try {
Object[] items = list.array;
int i = index + offset;
if (items == null || index < 0 || index >= size || i >= items.length)
throw new ArrayIndexOutOfBoundsException(index);
@SuppressWarnings("unchecked") E result = (E)items[i];
list.rawRemoveAt(i);
size--;
return result;
} finally {
lock.unlockWrite(stamp);
}
}