public Object next() { lastKey = super.next(); canRemove = true; return lastKey; }
public void remove() { super.remove(); set.remove(last); last = null; } }
@Override public boolean hasNext() { return index <= to && super.hasNext(); }
@Override public boolean hasNext() { return index <= to && super.hasNext(); }
public Object next() { lastValue = super.next(); canRemove = true; return lastValue; }
public void remove() { super.remove(); set.remove(last); last = null; } }
public Object next() { last = super.next(); return last; }
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.maps[1].remove(lastValue); lastValue = null; canRemove = false; } }
public Object next() { lastValue = super.next(); canRemove = true; return lastValue; }
public void remove() { if (canRemove == false) { throw new IllegalStateException("Iterator remove() can only be called once after next()"); } Object value = parent.maps[0].get(lastKey); super.remove(); parent.maps[1].remove(value); lastKey = null; canRemove = false; } }
public Object next() { lastKey = super.next(); canRemove = true; return lastKey; }
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) Object value = last.getValue(); super.remove(); parent.maps[1].remove(value); last = null; canRemove = false; } }
public Object next() { last = super.next(); return last; }
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.maps[1].remove(lastValue); lastValue = null; canRemove = false; } }
public Object next() { return ((Map.Entry) super.next()).getKey(); } };
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) Object value = last.getValue(); super.remove(); parent.maps[1].remove(value); last = null; canRemove = false; } }
public Object next() { return ((Map.Entry) super.next()).getKey(); } };
public void remove() { if (canRemove == false) { throw new IllegalStateException("Iterator remove() can only be called once after next()"); } Object value = parent.maps[0].get(lastKey); super.remove(); parent.maps[1].remove(value); lastKey = null; canRemove = false; } }