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
getNextObjectPos
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 interfaceJGoObjectSimpleCollection
-
- Parameters:
-
pos
- the current position - Returns:
- 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);
}