MCPcopy Create free account
hub / github.com/apache/poi / rotateLeft

Method rotateLeft

src/java/org/apache/poi/util/BinaryTree.java:743–769  ·  view source on GitHub ↗

do a rotate left. standard fare in the world of balanced trees @param node the node to be rotated @param index _KEY or _VALUE

(Node node, int index)

Source from the content-addressed store, hash-verified

741 * @param index _KEY or _VALUE
742 */
743 private void rotateLeft(Node node, int index)
744 {
745 Node right_child = node.getRight(index);
746
747 node.setRight(right_child.getLeft(index), index);
748 if (right_child.getLeft(index) != null)
749 {
750 right_child.getLeft(index).setParent(node, index);
751 }
752 right_child.setParent(node.getParent(index), index);
753 if (node.getParent(index) == null)
754 {
755
756 // node was the root ... now its right child is the root
757 _root[ index ] = right_child;
758 }
759 else if (node.getParent(index).getLeft(index) == node)
760 {
761 node.getParent(index).setLeft(right_child, index);
762 }
763 else
764 {
765 node.getParent(index).setRight(right_child, index);
766 }
767 right_child.setLeft(node, index);
768 node.setParent(right_child, index);
769 }
770
771 /**
772 * do a rotate right. standard fare in the world of balanced trees

Callers 2

doRedBlackInsertMethod · 0.95
doRedBlackDeleteFixupMethod · 0.95

Calls 8

getLeftMethod · 0.95
setParentMethod · 0.95
setLeftMethod · 0.95
getRightMethod · 0.65
setRightMethod · 0.65
getParentMethod · 0.65
getLeftMethod · 0.65
setLeftMethod · 0.65

Tested by

no test coverage detected