public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } if (next == null) { next = parent.root.get(nextIndex); } Object value = next.getValue(); current = next; currentIndex = nextIndex++; next = next.next(); return value; }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } if (next == null) { next = parent.root.get(nextIndex); } Object value = next.getValue(); current = next; currentIndex = nextIndex++; next = next.next(); return value; }
public void remove() { checkModCount(); if (currentIndex == -1) { throw new IllegalStateException(); } if (nextIndex == currentIndex) { // remove() following previous() next = next.next(); parent.remove(currentIndex); } else { // remove() following next() parent.remove(currentIndex); nextIndex--; } current = null; currentIndex = -1; expectedModCount++; }
public void remove() { checkModCount(); if (currentIndex == -1) { throw new IllegalStateException(); } if (nextIndex == currentIndex) { // remove() following previous() next = next.next(); parent.remove(currentIndex); } else { // remove() following next() parent.remove(currentIndex); nextIndex--; } current = null; currentIndex = -1; expectedModCount++; }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } if (next == null) { next = parent.root.get(nextIndex); } Object value = next.getValue(); current = next; currentIndex = nextIndex++; next = next.next(); return value; }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } if (next == null) { next = parent.root.get(nextIndex); } Object value = next.getValue(); current = next; currentIndex = nextIndex++; next = next.next(); return value; }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } if (next == null) { next = parent.root.get(nextIndex); } Object value = next.getValue(); current = next; currentIndex = nextIndex++; next = next.next(); return value; }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } if (next == null) { next = parent.root.get(nextIndex); } Object value = next.getValue(); current = next; currentIndex = nextIndex++; next = next.next(); return value; }
public Object next() { checkModCount(); if (!hasNext()) { throw new NoSuchElementException("No element at index " + nextIndex + "."); } if (next == null) { next = parent.root.get(nextIndex); } Object value = next.getValue(); current = next; currentIndex = nextIndex++; next = next.next(); return value; }