code: private int indexNodes(int startIndex) {
      if (index() < 0) {		// if this node has no index
        if (tg != null) {
          tg.addNodeToIndexMap(startIndex, this);
        }
        setIndex(startIndex++);
      }
      if (!isLeaf()) {
        for (int i = 0; i < children.length; i++) {
          startIndex = children[i].indexNodes(startIndex);
        }
      }
      return startIndex;
    }
docs: Assign sequential integer indices to all nodes of the subtree
  rooted at this <code>TreeGraphNode</code>, beginning with
  <code>startIndex</code>, and doing a pre-order tree traversal.
  Any node which already has an index will not be re-indexed
  &mdash; this is so that we can index the leaves first, and
  then index the rest.
  
  @param startIndex index for this node
  @return the next index still unassigned