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:
@@ -117,7 +117,15 @@ public class ArrayIntSet extends AbstractSet
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void remove () {
|
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;
|
protected int _pos;
|
||||||
|
|||||||
Reference in New Issue
Block a user