depthWithNode method

int depthWithNode(
  1. AbstractNode node
)

Implementation

int depthWithNode(AbstractNode node) {
  int maxChildDepth = 0;
  for (Iterator i = node.getChildBoundables().iterator; i.moveNext();) {
    Boundable childBoundable = i.current as Boundable;
    if (childBoundable is AbstractNode) {
      int childDepth = depthWithNode(childBoundable as AbstractNode);
      if (childDepth > maxChildDepth) maxChildDepth = childDepth;
    }
  }
  return maxChildDepth + 1;
}