@Override public long removeLong(int index) { if (fullImpl != null) { return fullImpl.removeLong(index); } else { assert compactImpl != null; return compactImpl.removeInt(index); } }
@Override public void remove() { if (last == -1) throw new IllegalStateException(); IntArrayList.this.removeInt(last); /* * If the last operation was a next(), we are removing an element *before* us, * and we must decrease pos correspondingly. */ if (last < pos) pos--; last = -1; } };
@Override public boolean rem(final int k) { int index = indexOf(k); if (index == -1) return false; removeInt(index); assert size <= a.length; return true; } @Override
@Override public long removeLong(int index) { if (fullImpl != null) { return fullImpl.removeLong(index); } else { assert compactImpl != null; return compactImpl.removeInt(index); } }
@Override public long removeLong(int index) { if (fullImpl != null) { return fullImpl.removeLong(index); } else { assert compactImpl != null; return compactImpl.removeInt(index); } }
/** Removes the given arc. * * @param x the start of the arc. * @param y the end of the arc. */ public void removeArc(final int x, final int y) { ensureNode(x); ensureNode(y); final int pos = successors[x].indexOf(y); if (pos == -1) throw new IllegalArgumentException("Node " + y + " is not a successor of node " + x); modificationCount++; successors[x].removeInt(pos); m--; }
/** Removes the given node. All arcs incident on the node are removed, too. * * @param x the node to be removed. */ public void removeNode(final int x) { ensureNode(x); modificationCount++; System.arraycopy(successors, x + 1, successors, x, --n - x); int t; for(int i = n; i-- != 0;) for(int j = successors[i].size(); j-- != 0;) { t = successors[i].getInt(j); if (t == x) successors[i].removeInt(j); else if (t > x) successors[i].set(j, t - 1); } }