HashSetIterator<E> Class
Implements
Constructors
Code new HashSetIterator(HashSetImplementation<E> set_) #
HashSetIterator(HashSetImplementation<E> set_) : _nextValidIndex = -1, _entries = set_._backingMap._keys { _advance(); }
Methods
Code bool hasNext() #
bool hasNext() { if (_nextValidIndex >= _entries.length) return false; if (_entries[_nextValidIndex] === HashMapImplementation._DELETED_KEY) { // This happens in case the set was modified in the meantime. // A modification on the set may make this iterator misbehave, // but we should never return the sentinel. _advance(); } return _nextValidIndex < _entries.length; }