public boolean nextNode() {
if (!setStarted) {
setStarted = true;
currentRootLocation = parentContext.getCurrentNodePointer();
NodePointer parent =
getMaterialPointer(currentRootLocation.getParent());
if (parent != null) {
// TBD: check type
stack.push(
parent.childIterator(null, reverse, currentRootLocation));
}
}
while (true) {
if (stack.isEmpty()) {
currentRootLocation =
getMaterialPointer(currentRootLocation.getParent());
if (currentRootLocation == null
|| currentRootLocation.isRoot()) {
break;
}
NodePointer parent =
getMaterialPointer(currentRootLocation.getParent());
if (parent != null) {
stack.push(
parent.childIterator(
null,
reverse,
currentRootLocation));
}
}