Interface RrbTree.Node<T>

All Superinterfaces:
org.organicdesign.fp.indent.Indented
Enclosing class:
RrbTree<E>

protected static interface RrbTree.Node<T> extends org.organicdesign.fp.indent.Indented
  • Method Details

    • child

      RrbTree.Node<T> child(int childIdx)
      Returns the immediate child node at the given index.
    • endChild

      RrbTree.Node<T> endChild(boolean leftMost)
      Returns the leftMost (first) or right-most (last) child
    • addEndChild

      RrbTree.Node<T> addEndChild(boolean leftMost, RrbTree.Node<T> shorter)
      Adds a node as the first/leftmost or last/rightmost child
    • addEndChildren

      RrbTree.Node<T> addEndChildren(boolean leftMost, RrbTree.Node<T>[] newKids)
      Adds kids as leftmost or rightmost of current children
    • get

      T get(int i)
      Return the item at the given index
    • height

      int height()
      Returns the maximum depth below this node. Leaf nodes are height 1.
    • size

      int size()
      Number of items stored in this node
    • thisNodeHasRelaxedCapacity

      boolean thisNodeHasRelaxedCapacity(int numItems)
      Can this node take the specified number of children?
    • hasRelaxedCapacity

      boolean hasRelaxedCapacity(int index, int size)
      Can we put focus at the given index without reshuffling nodes?
      Parameters:
      index - the index we want to insert at
      size - the number of items to insert. Must be size invalid input: '<' MAX_NODE_LENGTH
      Returns:
      true if we can do so without otherwise adjusting the tree.
    • numChildren

      int numChildren()
      Returns the number of immediate children of this node, not all descendants.
    • pushFocus

      RrbTree.Node<T> pushFocus(int index, T[] oldFocus)
    • replace

      RrbTree.Node<T> replace(int idx, T t)
    • splitAt

      RrbTree.SplitNode<T> splitAt(int splitIndex)