Class IntSet.Iterator

java.lang.Object
  |
  +--IntSet.Iterator

public class IntSet.Iterator
extends java.lang.Object

Provides an iterator over IntSet objects.

State variables
intSet0: set of int


Constructor Summary
IntSet.Iterator()
          Creates a new iterator over the elements in intSet.
 
Method Summary
 boolean hasMore()
          Determines whether more elements remain in intSet0.
 int next()
          Returns the next element of intSet0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntSet.Iterator

public IntSet.Iterator()
Creates a new iterator over the elements in intSet.
Exceptions
if insufficient memory then throw OutOfMemoryError
Transitions
intSet0 = intSet
Method Detail

next

public int next()
         throws EmptyException
Returns the next element of intSet0.
Preconditions
No calls have been made to intSet.insert or intSet.remove since this object was constructed
Exceptions
if intSet0 == {} then throw EmptyException
Transition-output
remove x from intSet0 and return x, where x is some element in intSet0

hasMore

public boolean hasMore()
Determines whether more elements remain in intSet0.
Preconditions
No calls have been made to intSet.insert or intSet.remove since this object was constructed
Output
return intSet0 != {}