public Object previous() { checkModCount(); if (!hasPrevious()) { throw new NoSuchElementException("Already at start of list."); } next = next.previous; Object value = next.getValue(); current = next; nextIndex--; return value; }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } Object value = next.getValue(); current = next; next = next.next; nextIndex++; return value; }
public Object previous() { checkModCount(); if (!hasPrevious()) { throw new NoSuchElementException("Already at start of list."); } next = next.previous; Object value = next.getValue(); current = next; nextIndex--; return value; }
public Object previous() { checkModCount(); if (!hasPrevious()) { throw new NoSuchElementException("Already at start of list."); } next = next.previous; Object value = next.getValue(); current = next; nextIndex--; return value; }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } Object value = next.getValue(); current = next; next = next.next; nextIndex++; return value; }
public Object previous() { checkModCount(); if (!hasPrevious()) { throw new NoSuchElementException("Already at start of list."); } next = next.previous; Object value = next.getValue(); current = next; nextIndex--; return value; }
public void add(Object obj) { checkModCount(); parent.addNodeBefore(next, obj); current = null; nextIndex++; expectedModCount++; }
public Object previous() { checkModCount(); if (!hasPrevious()) { throw new NoSuchElementException("Already at start of list."); } next = next.previous; Object value = next.getValue(); current = next; nextIndex--; return value; }
public Object previous() { checkModCount(); if (!hasPrevious()) { throw new NoSuchElementException("Already at start of list."); } next = next.previous; Object value = next.getValue(); current = next; nextIndex--; return value; }
public void add(Object obj) { checkModCount(); parent.addNodeBefore(next, obj); current = null; nextIndex++; expectedModCount++; }
public Object previous() { checkModCount(); if (!hasPrevious()) { throw new NoSuchElementException("Already at start of list."); } next = next.previous; Object value = next.getValue(); current = next; nextIndex--; return value; }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } Object value = next.getValue(); current = next; next = next.next; nextIndex++; return value; }
public void remove() { checkModCount(); if (current == next) { // remove() following previous() next = next.next; parent.removeNode(getLastNodeReturned()); } else { // remove() following next() parent.removeNode(getLastNodeReturned()); nextIndex--; } current = null; expectedModCount++; }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } Object value = next.getValue(); current = next; next = next.next; nextIndex++; return value; }
public void remove() { checkModCount(); if (current == next) { // remove() following previous() next = next.next; parent.removeNode(getLastNodeReturned()); } else { // remove() following next() parent.removeNode(getLastNodeReturned()); nextIndex--; } current = null; expectedModCount++; }
public void add(Object obj) { checkModCount(); parent.addNodeBefore(next, obj); current = null; nextIndex++; expectedModCount++; }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
public void add(Object obj) { checkModCount(); parent.addNodeBefore(next, obj); current = null; nextIndex++; expectedModCount++; }