Info on getNextObjectPos

I am using JGo 5.0 and Java 1.5.0_09 under Windows XP

Does doc.getNextObjectPos(pos) return a null when there are no more objects in the document. The documentation doesn’t say what happens when no more objects are available it says


public JGoListPosition getNextObjectPos(JGoListPosition pos)
Return the next object position, recursing into any JGoAreas. Use getNextObjectPosAtTop to only look at top-level objects in the document.
Specified by:
getNextObjectPos in interface JGoObjectSimpleCollection
pos - the current position
the next object position
        JGoDocument doc = node.getDocument();
        JGoListPosition pos = doc.getFirstObjectPos();
        JGoObject currentObject = doc.getObjectAtPos(pos);
        while (pos !=null) {
            pos = doc.getNextObjectPos(pos);
            if (pos != null)
                currentObject = doc.getObjectAtPos(pos);

Yes, you are correct – it does return null when there are no more objects in the collection.

This is documented for JGoObjectSimpleCollection.getNextObjectPos, but such documentation is missing in some of the classes that implement that interface, such as JGoDocument.
A typical iteration is written in this form:
[code]JGoListPosition pos = document.getFirstObjectPos();
while (pos != null) {
JGoObject obj = document.getObjectAtPos(pos);
pos = document.getNextObjectPosAtTop(pos);
... use obj, a top-level JGoObject ...