/** {@inheritDoc} */ @Override public int size() { return tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/); } }
/** {@inheritDoc} */ @Override public int size() { return tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/); } }
/** {@inheritDoc} */ @Override public int size() { return tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/); } }
/** * @return <code>true</code> if there's a node of the specified color in this * tree following the current node. */ public boolean hasNextNode(/*[ COLORED_START ]*/ byte colors /*[ COLORED_END ]*/) { if(node == null) { return tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) > 0; } else { return nodeEndIndex(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) < tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/); } }
/** * @return <code>true</code> if there's a node of the specified color in this * tree following the current node. */ public boolean hasNextNode(/*[ COLORED_START ]*/ byte colors /*[ COLORED_END ]*/) { if(node == null) { return tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) > 0; } else { return nodeEndIndex(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) < tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/); } }
/** * @return <code>true</code> if there's a node of the specified color in this * tree following the current node. */ public boolean hasNextNode(/*[ COLORED_START ]*/ byte colors /*[ COLORED_END ]*/) { if(node == null) { return tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) > 0; } else { return nodeEndIndex(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) < tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/); } }
/** * @return <code>true</code> if there's an element of the specified color in * this tree following the current element. */ public boolean hasNext(/*[ COLORED_START ]*/ byte colors /*[ COLORED_END ]*/) { if(node == null) { return tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) > 0; } else if(/*[ COLORED_START(true) ]*/ (colors & node.color) != 0 /*[ COLORED_END ]*/) { return index(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) < tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) - 1; } else { return index(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) < tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/); } }
/** * @return <code>true</code> if there's an element of the specified color in * this tree following the current element. */ public boolean hasNext(/*[ COLORED_START ]*/ byte colors /*[ COLORED_END ]*/) { if(node == null) { return tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) > 0; } else if(/*[ COLORED_START(true) ]*/ (colors & node.color) != 0 /*[ COLORED_END ]*/) { return index(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) < tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) - 1; } else { return index(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) < tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/); } }
/** * @return <code>true</code> if there's an element of the specified color in * this tree following the current element. */ public boolean hasNext(/*[ COLORED_START ]*/ byte colors /*[ COLORED_END ]*/) { if(node == null) { return tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) > 0; } else if(/*[ COLORED_START(true) ]*/ (colors & node.color) != 0 /*[ COLORED_END ]*/) { return index(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) < tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) - 1; } else { return index(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/) < tree.size(/*[ COLORED_START ]*/ colors /*[ COLORED_END ]*/); } }
/** * Remove size values at the specified index. Only values of the type * specified in indexColors will be removed. * * <p>Note that if the two nodes on either side of the removed node could * be merged, they probably will not be merged by this implementation. This * is to simplify the implementation, but it means that when iterating a * tree, sometimes multiple nodes of the same color and value will be * encountered in sequence. */ public void remove(int index, /*[ COLORED_START ]*/ byte indexColors, /*[ COLORED_END ]*/ int size) { if(size == 0) return; assert(index >= 0); assert(index + size <= size(/*[ COLORED_START ]*/ indexColors /*[ COLORED_END ]*/)); assert(root != null); // remove values from the tree removeFromSubtree(root, index, /*[ COLORED_START ]*/ indexColors, /*[ COLORED_END ]*/ size); // clean up any nodes that got deleted drainZeroQueue(); assert(valid()); }
/** * Remove size values at the specified index. Only values of the type * specified in indexColors will be removed. * * <p>Note that if the two nodes on either side of the removed node could * be merged, they probably will not be merged by this implementation. This * is to simplify the implementation, but it means that when iterating a * tree, sometimes multiple nodes of the same color and value will be * encountered in sequence. */ public void remove(int index, /*[ COLORED_START ]*/ byte indexColors, /*[ COLORED_END ]*/ int size) { if(size == 0) return; assert(index >= 0); assert(index + size <= size(/*[ COLORED_START ]*/ indexColors /*[ COLORED_END ]*/)); assert(root != null); // remove values from the tree removeFromSubtree(root, index, /*[ COLORED_START ]*/ indexColors, /*[ COLORED_END ]*/ size); // clean up any nodes that got deleted drainZeroQueue(); assert(valid()); }
/** * Remove size values at the specified index. Only values of the type * specified in indexColors will be removed. * * <p>Note that if the two nodes on either side of the removed node could * be merged, they probably will not be merged by this implementation. This * is to simplify the implementation, but it means that when iterating a * tree, sometimes multiple nodes of the same color and value will be * encountered in sequence. */ public void remove(int index, /*[ COLORED_START ]*/ byte indexColors, /*[ COLORED_END ]*/ int size) { if(size == 0) return; assert(index >= 0); assert(index + size <= size(/*[ COLORED_START ]*/ indexColors /*[ COLORED_END ]*/)); assert(root != null); // remove values from the tree removeFromSubtree(root, index, /*[ COLORED_START ]*/ indexColors, /*[ COLORED_END ]*/ size); // clean up any nodes that got deleted drainZeroQueue(); assert(valid()); }
assert(index <= size(/*[ COLORED_START ]*/ indexColors /*[ COLORED_END ]*/)); assert(size >= 0);
assert(index <= size(/*[ COLORED_START ]*/ indexColors /*[ COLORED_END ]*/)); assert(size >= 0);
assert(index <= size(/*[ COLORED_START ]*/ indexColors /*[ COLORED_END ]*/)); assert(size >= 0);