/** {@inheritDoc} */ @Override public E next() { return getIterator().next(); }
@Override public K next() { lastKey = super.next(); canRemove = true; return lastKey; }
@Override public void remove() { super.remove(); set.remove(last); last = null; } }
/** * {@inheritDoc} * <p> * In case an offset other than 0 was specified, the underlying iterator will be advanced * to this position upon creation. A call to {@link #remove()} will still result in an * {@link IllegalStateException} if no explicit call to {@link #next()} has been made prior * to calling {@link #remove()}. */ @Override public void remove() { if (pos <= offset) { throw new IllegalStateException("remove() can not be called before calling next()"); } super.remove(); }
@Override public E next() { last = super.next(); return last; }
@Override public void remove() { if (canRemove == false) { throw new IllegalStateException("Iterator remove() can only be called once after next()"); } super.remove(); // removes from maps[0] parent.reverseMap.remove(lastValue); lastValue = null; canRemove = false; } }
@Override public E next() { lastElement = super.next(); canRemove = true; return lastElement; }
@Override public void remove() { if (canRemove == false) { throw new IllegalStateException("Iterator remove() can only be called once after next()"); } final Object value = parent.normalMap.get(lastKey); super.remove(); parent.reverseMap.remove(value); lastKey = null; canRemove = false; } }
@Override public V next() { lastValue = super.next(); canRemove = true; return lastValue; }
@Override public void remove() { if (canRemove == false) { throw new IllegalStateException("Iterator remove() can only be called once after next()"); } // store value as remove may change the entry in the decorator (eg.TreeMap) final Object value = last.getValue(); super.remove(); parent.reverseMap.remove(value); last = null; canRemove = false; } }
@Override public E next() { final E next = super.next(); pos++; return next; }
@Override public void remove() { if (canRemove == false) { throw new IllegalStateException("Iterator remove() can only be called once after next()"); } final int count = parent.getCount(lastElement); super.remove(); parent.remove(lastElement, count); lastElement = null; canRemove = false; } }
@Override public Map.Entry<K, V> next() { last = new MapEntry<>(super.next(), parent); canRemove = true; return last; }