The depth of the node
@return the depth of the node
773836
public int depth() {
        if (isLeaf())
            return 1;
        return 1 + max(max(northWest.depth(), northEast.depth()), max(southWest.depth(), southEast.depth()));
    }
1143809
public Node getRoot(Node node)
  {

    Node root = null;

    while (node != null)
    {
      root = node;
      node = getParentOfNode(node);
    }

    return root;
  }
472933
@Override
  public Node next() {
    Node cur = this.nodelist.item(this.index);
    this.index++;
    return cur;
  }
736797
@Override
    public Layer getLayer()
    {
        final Node<?> parent = getParent();// change, no iteration, no testing, no casting, recurses upwards to a Layer, and Layer returns itself, CYCLES!!!

        if (null != parent)
        {
            return parent.getLayer();
        }
        return null;
    }
1183111
public List depthFirst() {
        List answer = new NodeList();
        answer.add(this);
        answer.addAll(depthFirstRest());
        return answer;
    }
1357894
public function getLevel()
    {
        if ($this->_level !== null) {
            return $this->_level;
        }

        if ($this->isRoot()) {
            $this->_level = -1;
            return $this->_level;
        }

        $parents = array($this);
        $node = $this;

        while ($parent = $node->getParent()){
            if (!$parent->isRoot()) {
                $parents[] = $parent;
            }
            $node = $parent;
        }

        $this->_level = count($parents);

        return $this->_level;
    }
319604
public Node currentNode() {
        if (!isInit) {
            init();
        }
        // See if we need to store state information.
        if ((lastUUIDTimeStored + nodeState.getSynchInterval()) > (findMaxTimestamp() / Clock.INTERVALS_PER_MILLI)) {
            try {
                nodeState.store(nodesSet);
            } catch (IOException ioe) {
               //@TODO add listener and send notify
            }
        }
        return allNodes[currentNodeIndex];
    }
1330557
public Node getScopeRoot() {
    int roots = scopeRoots.size();
    if (roots > 0) {
      return scopeRoots.get(roots - 1);
    } else {
      AbstractScope<?, ?> s = scopes.peek();
      return s != null ? s.getRootNode() : null;
    }
  }
1182227
public function getDepth(){

        if($this->depth === NULL){

            if($this->isRootNode()){
                $this->depth = -1;
            }
            else{
                $parents = [$this];
                $node = $this;
                while($parent = $node->parentNode()){
                    if(!$parent->isRootNode()){
                        $parents[] = $parent;
                    }
                    $node = $parent;
                }
                $this->depth = count($parents);
            }
        }

        return $this->depth;
    }
1015789
def _depth(self):
        """"""
        terminals = [0]
        depth = 1
        for node in self.program:
            if isinstance(node, _Function):
                terminals.append(node.arity)
                depth = max(len(terminals), depth)
            else:
                terminals[-1] -= 1
                while terminals[-1] == 0:
                    terminals.pop()
                    terminals[-1] -= 1
        return depth - 1
759213
static private int getPathDepth(INode inode) throws IOException {
    // calculate the depth of this inode from root
    int depth = 1;
    INode node; // node on the path to the root
    for (node = inode; node.parent != null; node = node.parent) {
      depth++;
    }

    // parent should be root
    if (node.isRoot()) {
      return depth;
    }
    
    // invalid inode
    throw new IOException("Invalid inode: " + inode.getLocalName());
  }
164487
public int getHeight() {
    int levels = 0;
    N node = getRoot();

    while(!node.isLeaf()) {
      if(node.getNumEntries() > 0) {
        node = getNode(node.getEntry(0));
        levels++;
      }
    }
    return levels;
  }
681566
public int getClassDepth() {
        int depth = 0;

        ClassFile outer = mOuterClass;
        while (outer != null) {
            depth++;
            outer = outer.mOuterClass;
        }

        return depth;
    }
81627
public int maxDepth()
    {
        Map<DFAState<T>,Integer> indexOf = new NumMap<>();
        Map<DFAState<T>,Long> depth = new NumMap<>();
        Deque<DFAState<T>> stack = new ArrayDeque<>();
        maxDepth(root, indexOf, stack, depth);
        long d = depth.get(root);
        assert d >= 0;
        if (d >= Integer.MAX_VALUE)
        {
            return Integer.MAX_VALUE;
        }
        else
        {
            return (int) d;
        }
    }
553839
public final Layer getTopLayer()
    {
        final NFastArrayList<Layer> layers = getChildNodes();

        final int n = layers.size();

        return n == 0 ? null : layers.get(n - 1);
    }
487017
public List<T> getElements() {
		ArrayList<T> list = new ArrayList<>(nodes.size());
		for (Node<T> node : nodes)
			list.add(node.element);
		return list;
	}
	
	/** Return the number of elements. */
	public int size() { return nodes.size(); }
	
}
1233320
public final Node getDisclosureNode() {
        if (disclosureNode.get() == null) {
            final StackPane disclosureNode = new StackPane();
            disclosureNode.getStyleClass().setAll("tree-disclosure-node");
            disclosureNode.setMouseTransparent(true);

            final StackPane disclosureNodeArrow = new StackPane();
            disclosureNodeArrow.getStyleClass().setAll("arrow");
            disclosureNode.getChildren().add(disclosureNodeArrow);
            setDisclosureNode(disclosureNode);
        }
        return disclosureNode.get();
    }