/** * Returns the element at the specified position in this list. */ @Override @SuppressWarnings("unchecked") public E get(int index) { rangeCheck(index); return (E) buffer[start + index]; }
/** * Replaces the element at the specified position in this list with * the specified element. */ @SuppressWarnings("unchecked") @Override public E set(int index, E element) { rangeCheck(index); index += start; E oldValue = (E) buffer[index]; buffer[index] = element; return oldValue; }
/** * Inserts all array elements to this list. */ public boolean addAll(int index, E... array) { rangeCheck(index); return doAddAll(index, array); }
/** * Inserts all of the elements in the specified collection into this * list, starting at the specified position. Shifts the element * currently at that position (if any) and any subsequent elements. * The new elements will appear in the list in the order that they are returned by the * specified collection's iterator. */ @Override public boolean addAll(int index, Collection<? extends E> collection) { rangeCheck(index); Object[] array = collection.toArray(); return doAddAll(index, array); }
/** * Removes the element at the specified position in this list. * Shifts any subsequent elements. */ @Override @SuppressWarnings("unchecked") public E remove(int index) { rangeCheck(index); modCount++; return doRemove(index); }
/** * Returns a list iterator over the elements in this list (in proper * sequence), starting at the specified position in the list. */ @Override public ListIterator<E> listIterator(int index) { rangeCheck(index); return new ListItr(index); }
return; rangeCheck(index);
/** * Replaces the element at the specified position in this list with * the specified element. */ @SuppressWarnings("unchecked") @Override public E set(int index, E element) { rangeCheck(index); index += start; E oldValue = (E) buffer[index]; buffer[index] = element; return oldValue; }
/** * Returns the element at the specified position in this list. */ @Override @SuppressWarnings("unchecked") public E get(int index) { rangeCheck(index); return (E) buffer[start + index]; }
/** * Returns a list iterator over the elements in this list (in proper * sequence), starting at the specified position in the list. */ @Override public ListIterator<E> listIterator(int index) { rangeCheck(index); return new ListItr(index); }
/** * Inserts all array elements to this list. */ public boolean addAll(int index, E... array) { rangeCheck(index); return doAddAll(index, array); }
/** * Removes the element at the specified position in this list. * Shifts any subsequent elements. */ @Override @SuppressWarnings("unchecked") public E remove(int index) { rangeCheck(index); modCount++; return doRemove(index); }
/** * Inserts all of the elements in the specified collection into this * list, starting at the specified position. Shifts the element * currently at that position (if any) and any subsequent elements. * The new elements will appear in the list in the order that they are returned by the * specified collection's iterator. */ @Override public boolean addAll(int index, Collection<? extends E> collection) { rangeCheck(index); Object[] array = collection.toArray(); return doAddAll(index, array); }
return; rangeCheck(index);