private static int copyChildren(final Object[] from, final Object[] to, final int offset, final int skipIndex) { assert !BTree.isLeaf(from); final int start = BTree.getChildStart(from); final int childCount = BTree.getChildCount(from); if (skipIndex > 0) System.arraycopy(from, start, to, offset, skipIndex); if (skipIndex + 1 <= childCount) System.arraycopy(from, start + skipIndex + 1, to, offset + skipIndex, childCount - skipIndex - 1); return offset + childCount - 1; }
private static int copyChildren(final Object[] from, final Object[] to, final int offset, final int skipIndex) { assert !BTree.isLeaf(from); final int start = BTree.getChildStart(from); final int childCount = BTree.getChildCount(from); if (skipIndex > 0) System.arraycopy(from, start, to, offset, skipIndex); if (skipIndex + 1 <= childCount) System.arraycopy(from, start + skipIndex + 1, to, offset + skipIndex, childCount - skipIndex - 1); return offset + childCount - 1; }
private static int copyChildren(final Object[] from, final Object[] to, final int offset, final int skipIndex) { assert !BTree.isLeaf(from); final int start = BTree.getChildStart(from); final int childCount = BTree.getChildCount(from); if (skipIndex > 0) System.arraycopy(from, start, to, offset, skipIndex); if (skipIndex + 1 <= childCount) System.arraycopy(from, start + skipIndex + 1, to, offset + skipIndex, childCount - skipIndex - 1); return offset + childCount - 1; }
private static int copyChildren(final Object[] from, final Object[] to, final int offset, final int skipIndex) { assert !BTree.isLeaf(from); final int start = BTree.getChildStart(from); final int childCount = BTree.getChildCount(from); if (skipIndex > 0) System.arraycopy(from, start, to, offset, skipIndex); if (skipIndex + 1 <= childCount) System.arraycopy(from, start + skipIndex + 1, to, offset + skipIndex, childCount - skipIndex - 1); return offset + childCount - 1; }
private static int copyChildren(final Object[] from, final Object[] to, final int offset) { assert !BTree.isLeaf(from); final int start = BTree.getChildStart(from); final int childCount = BTree.getChildCount(from); System.arraycopy(from, start, to, offset, childCount); return offset + childCount; }
private static int copyChildren(final Object[] from, final Object[] to, final int offset) { assert !BTree.isLeaf(from); final int start = BTree.getChildStart(from); final int childCount = BTree.getChildCount(from); System.arraycopy(from, start, to, offset, childCount); return offset + childCount; }
private static int copyChildren(final Object[] from, final Object[] to, final int offset) { assert !BTree.isLeaf(from); final int start = BTree.getChildStart(from); final int childCount = BTree.getChildCount(from); System.arraycopy(from, start, to, offset, childCount); return offset + childCount; }
private static int copyChildren(final Object[] from, final Object[] to, final int offset) { assert !BTree.isLeaf(from); final int start = BTree.getChildStart(from); final int childCount = BTree.getChildCount(from); System.arraycopy(from, start, to, offset, childCount); return offset + childCount; }
NodeCursor(Object[] node, NodeCursor<K> parent, Comparator<? super K> comparator) { this.node = node; this.parent = parent; this.comparator = comparator; // a well formed b-tree (text book, or ours) must be balanced, so by building a stack following the left-most branch // we have a stack capable of visiting any path in the tree this.child = BTree.isLeaf(node) ? null : new NodeCursor<>((Object[]) node[getChildStart(node)], this, comparator); }
NodeCursor<K> descend() { Object[] childNode = (Object[]) node[position + getChildStart(node)]; int childOffset = nodeOffset + treeIndexOffsetOfChild(node, position); child.resetNode(childNode, childOffset); inChild = true; return child; }
NodeCursor<K> descend() { Object[] childNode = (Object[]) node[position + getChildStart(node)]; int childOffset = nodeOffset + treeIndexOffsetOfChild(node, position); child.resetNode(childNode, childOffset); inChild = true; return child; }
NodeCursor(Object[] node, NodeCursor<K> parent, Comparator<? super K> comparator) { this.node = node; this.parent = parent; this.comparator = comparator; // a well formed b-tree (text book, or ours) must be balanced, so by building a stack following the left-most branch // we have a stack capable of visiting any path in the tree this.child = BTree.isLeaf(node) ? null : new NodeCursor<>((Object[]) node[getChildStart(node)], this, comparator); }
NodeCursor<K> descend() { Object[] childNode = (Object[]) node[position + getChildStart(node)]; int childOffset = nodeOffset + treeIndexOffsetOfChild(node, position); child.resetNode(childNode, childOffset); inChild = true; return child; }
NodeCursor<K> descend() { Object[] childNode = (Object[]) node[position + getChildStart(node)]; int childOffset = nodeOffset + treeIndexOffsetOfChild(node, position); child.resetNode(childNode, childOffset); inChild = true; return child; }
NodeCursor(Object[] node, NodeCursor<K> parent, Comparator<? super K> comparator) { this.node = node; this.parent = parent; this.comparator = comparator; // a well formed b-tree (text book, or ours) must be balanced, so by building a stack following the left-most branch // we have a stack capable of visiting any path in the tree this.child = BTree.isLeaf(node) ? null : new NodeCursor<>((Object[]) node[getChildStart(node)], this, comparator); }
NodeCursor(Object[] node, NodeCursor<K> parent, Comparator<? super K> comparator) { this.node = node; this.parent = parent; this.comparator = comparator; // a well formed b-tree (text book, or ours) must be balanced, so by building a stack following the left-most branch // we have a stack capable of visiting any path in the tree this.child = BTree.isLeaf(node) ? null : new NodeCursor<>((Object[]) node[getChildStart(node)], this, comparator); }
public static long sizeOfStructureOnHeap(Object[] tree) { long size = ObjectSizes.sizeOfArray(tree); if (isLeaf(tree)) return size; for (int i = getChildStart(tree) ; i < getChildEnd(tree) ; i++) size += sizeOfStructureOnHeap((Object[]) tree[i]); return size; }
public static long sizeOfStructureOnHeap(Object[] tree) { long size = ObjectSizes.sizeOfArray(tree); if (isLeaf(tree)) return size; for (int i = getChildStart(tree) ; i < getChildEnd(tree) ; i++) size += sizeOfStructureOnHeap((Object[]) tree[i]); return size; }
public static long sizeOfStructureOnHeap(Object[] tree) { long size = ObjectSizes.sizeOfArray(tree); if (isLeaf(tree)) return size; for (int i = getChildStart(tree) ; i < getChildEnd(tree) ; i++) size += sizeOfStructureOnHeap((Object[]) tree[i]); return size; }
public static long sizeOfStructureOnHeap(Object[] tree) { long size = ObjectSizes.sizeOfArray(tree); if (isLeaf(tree)) return size; for (int i = getChildStart(tree) ; i < getChildEnd(tree) ; i++) size += sizeOfStructureOnHeap((Object[]) tree[i]); return size; }