public Interator interator ()
    {
        return new AbstractInterator() {
            public boolean hasNext () {
                return (_pos < _size);
            }

            public int nextInt () {
                if (_pos >= _size) {
                    throw new NoSuchElementException();
                }
                _canRemove = true;
                return _values[_pos++];
            }

            @Override public void remove () {
                if (!_canRemove) {
                    throw new IllegalStateException();
                }
                System.arraycopy(_values, _pos, _values, _pos - 1, _size - _pos);
                _pos--;
                _size--; //_values[--_size] = 0;
                _canRemove = false;
            }

            protected int _pos;
            protected boolean _canRemove;
        };
    }
public Interator interator ( ) { return new AbstractInterator ( ) { public boolean hasNext ( ) { return ( _pos < _size ) ; } public int nextInt ( ) { if ( _pos >= _size ) { throw new NoSuchElementException ( ) ; } _canRemove = true ; return _values [ _pos ++ ] ; } @ Override public void remove ( ) { if ( ! _canRemove ) { throw new IllegalStateException ( ) ; } System . arraycopy ( _values , _pos , _values , _pos - 1 , _size - _pos ) ; _pos -- ; _size -- ; _canRemove = false ; } protected int _pos ; protected boolean _canRemove ; } ; }
from interface IntSet