@Override public void remove() { if (lastRet < 0) { throw new IllegalStateException(); } checkForCoModification(); array[lastRet] = null; if (firstNonNullElementIdx == lastRet) { // the element being removed was the first non-null element we knew adjustFirstNonNullElement(); } lastRet = -1; numNonNullElements--; modCount++; expectedModCount = modCount; }
@Override public Cell next() { checkForCoModification(); if (!hasNext()) { throw new NoSuchElementException(); } Cell next = array[nextIndex]; lastRet = nextIndex; moveForward(false); modCount++; expectedModCount = modCount; return next; }
private Itr() { moveForward(true); }
private Itr() { moveForward(true); }
@Override public void remove() { if (lastRet < 0) { throw new IllegalStateException(); } checkForCoModification(); array[lastRet] = null; if (firstNonNullElementIdx == lastRet) { // the element being removed was the first non-null element we knew adjustFirstNonNullElement(); } lastRet = -1; numNonNullElements--; modCount++; expectedModCount = modCount; }
@Override public Iterator<Cell> iterator() { return new Itr(); }
@Override public Cell next() { checkForCoModification(); if (!hasNext()) { throw new NoSuchElementException(); } Cell next = array[nextIndex]; lastRet = nextIndex; moveForward(false); modCount++; expectedModCount = modCount; return next; }
@Override public void remove() { if (lastRet == nextIndex) { moveNextPointer(nextIndex); } super.remove(); expectedModCount = modCount; }
@Override public Iterator<Cell> iterator() { return new Itr(); }
@Override public void remove() { if (lastRet < 0) { throw new IllegalStateException(); } checkForCoModification(); array[lastRet] = null; lastRet = -1; numNonNullElements--; modCount++; expectedModCount = modCount; }
@Override public void remove() { if (lastRet == nextIndex) { moveNextPointer(nextIndex); } super.remove(); expectedModCount = modCount; }
@Override public Cell next() { checkForCoModification(); if (!hasNext()) { throw new NoSuchElementException(); } Cell next = array[nextIndex]; lastRet = nextIndex; moveForward(false); modCount++; expectedModCount = modCount; return next; }
private Itr() { moveForward(true); }
@Override public Iterator<Cell> iterator() { return new Itr(); }
@Override public void remove() { if (lastRet == nextIndex) { moveNextPointer(nextIndex); } super.remove(); expectedModCount = modCount; }