/** {@inheritDoc} */ @Override public int size() { return tree.size( ); } }
/** * Returns the number of {@link ValueSegment} objects contained within. */ public int size() { return start.size(); } }
/** * Returns the number of {@link ValueSegment} objects contained within. */ public int size() { return start.size(); } }
/** * Returns the number of {@link ValueSegment} objects contained within. */ public int size() { return start.size(); } }
/** {@inheritDoc} */ @Override public int size() { return tree.size( ); } }
/** {@inheritDoc} */ @Override public int size() { return tree.size( ); } }
@Override public int size() { return groupLists.size(); }
/** * 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, int size) { if(size == 0) return; assert(index >= 0); assert(index + size <= size( )); assert(root != null); // remove values from the tree removeFromSubtree(root, index, 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, int size) { if(size == 0) return; assert(index >= 0); assert(index + size <= size( )); assert(root != null); // remove values from the tree removeFromSubtree(root, index, 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, int size) { if(size == 0) return; assert(index >= 0); assert(index + size <= size( )); assert(root != null); // remove values from the tree removeFromSubtree(root, index, size); // clean up any nodes that got deleted drainZeroQueue(); assert(valid()); }
/** * Statically build the separators data structures. */ private void rebuildSeparators() { // clear the initial state of these separators insertedSeparators = new Barcode(); separators = new SimpleTree<GroupSeparator>(); // prepare the separator list insertedSeparators.add(0, SOURCE_ELEMENT, source.size()); for(BarcodeIterator i = grouper.getBarcode().iterator(); i.hasNextColour(Grouper.UNIQUE); ) { i.nextColour(Grouper.UNIQUE); int groupIndex = i.getColourIndex(Grouper.UNIQUE); int sourceIndex = i.getIndex(); insertedSeparators.add(groupIndex + sourceIndex, SEPARATOR, 1); Element<GroupSeparator> node = separators.add(groupIndex, new GroupSeparator(), 1); node.get().setNode(node); node.get().applyLimit(defaultLimit, false); } // update the cached values in all separators for(int i = 0; i < separators.size(); i++) { separators.get(i).get().updateCachedValues(); } }
/** * Statically build the separators data structures. */ private void rebuildSeparators() { // clear the initial state of these separators insertedSeparators = new Barcode(); separators = new SimpleTree<GroupSeparator>(); // prepare the separator list insertedSeparators.add(0, SOURCE_ELEMENT, source.size()); for(BarcodeIterator i = grouper.getBarcode().iterator(); i.hasNextColour(Grouper.UNIQUE); ) { i.nextColour(Grouper.UNIQUE); int groupIndex = i.getColourIndex(Grouper.UNIQUE); int sourceIndex = i.getIndex(); insertedSeparators.add(groupIndex + sourceIndex, SEPARATOR, 1); Element<GroupSeparator> node = separators.add(groupIndex, new GroupSeparator(), 1); node.get().setNode(node); node.get().applyLimit(defaultLimit, false); } // update the cached values in all separators for(int i = 0; i < separators.size(); i++) { separators.get(i).get().updateCachedValues(); } }
/** * Statically build the separators data structures. */ private void rebuildSeparators() { // clear the initial state of these separators insertedSeparators = new Barcode(); separators = new SimpleTree<>(); // prepare the separator list insertedSeparators.add(0, SOURCE_ELEMENT, source.size()); for(BarcodeIterator i = grouper.getBarcode().iterator(); i.hasNextColour(Grouper.UNIQUE); ) { i.nextColour(Grouper.UNIQUE); int groupIndex = i.getColourIndex(Grouper.UNIQUE); int sourceIndex = i.getIndex(); insertedSeparators.add(groupIndex + sourceIndex, SEPARATOR, 1); Element<GroupSeparator> node = separators.add(groupIndex, new GroupSeparator(), 1); node.get().setNode(node); node.get().applyLimit(defaultLimit, false); } // update the cached values in all separators for(int i = 0; i < separators.size(); i++) { separators.get(i).get().updateCachedValues(); } }
/** * Statically build the separators data structures. */ private void rebuildSeparators() { // clear the initial state of these separators insertedSeparators = new Barcode(); separators = new SimpleTree<GroupSeparator>(); // prepare the separator list insertedSeparators.add(0, SOURCE_ELEMENT, source.size()); for(BarcodeIterator i = grouper.getBarcode().iterator(); i.hasNextColour(Grouper.UNIQUE); ) { i.nextColour(Grouper.UNIQUE); int groupIndex = i.getColourIndex(Grouper.UNIQUE); int sourceIndex = i.getIndex(); insertedSeparators.add(groupIndex + sourceIndex, SEPARATOR, 1); Element<GroupSeparator> node = separators.add(groupIndex, new GroupSeparator(), 1); node.get().setNode(node); node.get().applyLimit(defaultLimit, false); } // update the cached values in all separators for(int i = 0; i < separators.size(); i++) { separators.get(i).get().updateCachedValues(); } }