/** * Returns a ListIterator on the elements of this list. The elements are * iterated in the same order that they occur in the list. * * @return a ListIterator on the elements of this list * @see ListIterator */ public ListIterator<E> listIterator() { return listIterator(0); }
public ListIterator<T> listIterator(int index) { return adapter.listIterator(index); } public T remove(int index) {
public ListIterator<T> listIterator(int index) { return listAdapter.listIterator(index); } public T remove(int index) {
public ListIterator<T> listIterator() { return adapter.listIterator(); } public ListIterator<T> listIterator(int index) {
public Iterator<Object> iterator() { return super.listIterator(); }
public ListIterator<T> listIterator() { return listAdapter.listIterator(); } public ListIterator<T> listIterator(int index) {
public ListIterator listIterator() { return UnmodifiableListIterator.decorate(super.listIterator()); }
public ListIterator listIterator(int fromIndex) { return UnmodifiableListIterator.decorate(super.listIterator(fromIndex)); }
/** * Removes the objects in the specified range from the start to the end * index minus one. * * @param start * the index at which to start removing. * @param end * the index after the last element to remove. * @throws UnsupportedOperationException * if removing from this list is not supported. * @throws IndexOutOfBoundsException * if {@code start < 0} or {@code start >= size()}. */ protected void removeRange(int start, int end) { Iterator<?> it = listIterator(start); for (int i = start; i < end; i++) { it.next(); it.remove(); } }
@Override public ListIterator<E> listIterator(int location) { if (modCount == fullList.modCount) { if (location >= 0 && location <= size) { return new SubAbstractListIterator<E>(fullList .listIterator(location + offset), this, offset, size); } throw new IndexOutOfBoundsException(); } throw new ConcurrentModificationException(); }
public ListIterator listIterator() { return UnmodifiableListIterator.decorate(super.listIterator()); }
public ListIterator listIterator(int fromIndex) { return UnmodifiableListIterator.decorate(super.listIterator(fromIndex)); }
@Override public ListIterator<K> listIterator(final int fromIndex) { return UnmodifiableListIterator.umodifiableListIterator(super.listIterator(fromIndex)); }
@Override public ListIterator<K> listIterator() { return UnmodifiableListIterator.umodifiableListIterator(super.listIterator()); }
public ListIterator<K> listIterator() { return UnmodifiableListIterator.decorate(super.listIterator()); }
public ListIterator<Object> listIterator() { return UnmodifiableListIterator.decorate(super.listIterator()); }
public ListIterator<Object> listIterator(int fromIndex) { return UnmodifiableListIterator.decorate(super.listIterator(fromIndex)); }
public ListIterator<K> listIterator(int fromIndex) { return UnmodifiableListIterator.decorate(super.listIterator(fromIndex)); }
/** * Searches this list for the specified object and returns the index of the * first occurrence. * * @param object * the object to search for. * @return the index of the first occurrence of the object, or -1 if it was * not found. */ public int indexOf(Object object) { ListIterator<?> it = listIterator(); if (object != null) { while (it.hasNext()) { if (object.equals(it.next())) { return it.previousIndex(); } } } else { while (it.hasNext()) { if (it.next() == null) { return it.previousIndex(); } } } return -1; }
/** * Searches this list for the specified object and returns the index of the * last occurrence. * * @param object * the object to search for. * @return the index of the last occurrence of the object, or -1 if the * object was not found. */ public int lastIndexOf(Object object) { ListIterator<?> it = listIterator(size()); if (object != null) { while (it.hasPrevious()) { if (object.equals(it.previous())) { return it.nextIndex(); } } } else { while (it.hasPrevious()) { if (it.previous() == null) { return it.nextIndex(); } } } return -1; }