/** * @return <code>true</code> if this node has at least one child node, * according to our structure cache. */ public boolean isLeaf() { Node<E> next = next(); if(next == null) return true; return next.parent != this; }
/** * @return <code>true</code> if this node has at least one child node, * according to our structure cache. */ public boolean isLeaf() { Node<E> next = next(); if(next == null) return true; return next.parent != this; }
/** * Get the first child of this node, or <code>null</code> if no * such child exists. This is <strong>not</strong> by value, but by the * current tree structure. */ private Node<E> firstChild() { // the first child is always the node immediately after Node<E> possibleChild = next(); if(possibleChild == null) return null; if(possibleChild.parent != this) return null; return possibleChild; }
/** * @return <code>true</code> if this node has at least one child node, * according to our structure cache. */ public boolean isLeaf() { Node<E> next = next(); if(next == null) return true; return next.parent != this; }
/** * Get the first child of this node, or <code>null</code> if no * such child exists. This is <strong>not</strong> by value, but by the * current tree structure. */ private Node<E> firstChild() { // the first child is always the node immediately after Node<E> possibleChild = next(); if(possibleChild == null) return null; if(possibleChild.parent != this) return null; return possibleChild; }
/** * Get the first child of this node, or <code>null</code> if no * such child exists. This is <strong>not</strong> by value, but by the * current tree structure. */ private Node<E> firstChild() { // the first child is always the node immediately after Node<E> possibleChild = next(); if(possibleChild == null) return null; if(possibleChild.parent != this) return null; return possibleChild; }