Each iterator constructed by this package is a Maple object with the following common methods.
ModuleApply : makes the object an appliable object factory. It calls the Object constructor and passes its arguments to the object's ModuleCopy method.
ModuleCopy(self,proto,...) : used to copy an object; see ModuleCopy.
ModuleIterator(self) : returns the two procedures, hasNext and getNext used to implement an iterator; see ModuleIterator. The iterators constructed by this package violate one of the specifications: calling hasNext consecutively, without a call to getNext, does not necessarily return the same value. Each call to hasNext advances the iterator. The reason for this is efficiency; these iterators reuse an Array as output, so there is no need to call getNext.
length(self) : returns the length of the output array of the iterator self. For most iterators, this is a fixed value, but for a few this may change with each iteration.
anditer(p,self,...) : applies the predicate p to each iteration and returns the and of all the evaluations. It returns false immediately if any evaluation returns false. Optional arguments are passed to the predicate, p. The iterator is reset upon exiting.
oriter(p,self,...) : applies the predicate p to each iteration and returns the or of all the evaluations. It returns true immediately if any evaluation returns true. Optional arguments are passed to the predicate, p. The iterator is reset upon exiting.
output(self) : returns the Array used to store the output result.
Print(self,num,opts) : prints num iterations of self. The option showrank prints the rank of each iteration.
Reset(self,rank) : reset self to the given rank. If the iterator does not have an Unrank method, or if rank is omitted, the iterator is reset to the first rank.