An iterator encapsulates a list of objects. An application uses an iterator to access object in turn.
An iterator also encapsulates a cursor that maintains the current position in the list. When an iterator is created, the position of the cursor is before the first object.
An application cannot create an iterator directly using a constructor. An iterator is created only by certain methods in order to pass a list of objects back to the application.
This class is a helper class.
Method | Description |
---|---|
~Iterator | Delete the iterator. |
getHandle | Get the handle that a C application would use to access the iterator. |
getNext | Move the cursor to the next object and get the object at the new position of the cursor. |
hasNext | Check whether there are any more objects beyond the current position of the cursor. |
isNull | Determine whether the Iterator object is a null object. |
reset | Move the cursor back to a position before the first object. |
xmsVOID * getNext() const;
Move the cursor to the next object and get the object at the new position of the cursor.
xmsBOOL hasNext();
Check whether there are any more objects beyond the current position of the cursor. The call does not move the cursor.