splitNode method

  1. @protected
RTreeNode<T> splitNode(
  1. RTreeNode<T> node,
  2. List<RTreeEntry<T>> group1,
  3. List<RTreeEntry<T>> group2
)

Splits a given node into two nodes. The original node will have the entries specified in group1, and the newly-created split node will have the entries specified in group2. Both the original and split node will have their children nodes adjusted so they have the correct parent.

Implementation

@protected
RTreeNode<T> splitNode(RTreeNode<T> node, List<RTreeEntry<T>> group1,
    List<RTreeEntry<T>> group2) {
  node.entries = group1;
  final splitNode = RTreeNode<T>(this,
      isLeaf: node.isLeaf, parent: node.parent, entries: group2);
  node.fixChildren();
  splitNode.fixChildren();
  return splitNode;
}