Made remove() work in our Interator.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1706 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert@gmail.com
2005-08-25 20:35:41 +00:00
parent abe8dcef25
commit a0f67d5721
@@ -117,7 +117,15 @@ public class ArrayIntSet extends AbstractSet
}
public void remove () {
throw new UnsupportedOperationException();
if (_pos == 0) {
throw new IllegalStateException();
}
// does not correctly return IllegalStateException if
// remove() is called twice in a row...
System.arraycopy(_values, _pos, _values, _pos - 1,
_size - _pos);
_pos--;
_values[--_size] = 0;
}
protected int _pos;