/** * @param btree the tree to iterate over * @param comparator the comparator that defines the ordering over the items in the tree * @param start the beginning of the range to return, inclusive (in ascending order) * @param end the end of the range to return, exclusive (in ascending order) * @param dir if false, the iterator will start at the last item and move backwards * @return an Iterator over the defined sub-range of the tree */ public static <K, V extends K> BTreeSearchIterator<K, V> slice(Object[] btree, Comparator<? super K> comparator, K start, K end, Dir dir) { return slice(btree, comparator, start, true, end, false, dir); }
/** * @param btree the tree to iterate over * @param comparator the comparator that defines the ordering over the items in the tree * @param start the beginning of the range to return, inclusive (in ascending order) * @param end the end of the range to return, exclusive (in ascending order) * @param dir if false, the iterator will start at the last item and move backwards * @return an Iterator over the defined sub-range of the tree */ public static <K, V extends K> BTreeSearchIterator<K, V> slice(Object[] btree, Comparator<? super K> comparator, K start, K end, Dir dir) { return slice(btree, comparator, start, true, end, false, dir); }
public BTreeSearchIterator<ColumnDefinition, ColumnData> searchIterator() { return BTree.slice(btree, ColumnDefinition.asymmetricColumnDataComparator, BTree.Dir.ASC); }
public BTreeSearchIterator<ColumnDefinition, ColumnData> searchIterator() { return BTree.slice(btree, ColumnDefinition.asymmetricColumnDataComparator, BTree.Dir.ASC); }
protected Cursor<V, V> slice(boolean forwards, boolean permitInversion) { return BTree.slice(tree, forwards); }
@Override protected Cursor<V, V> slice(boolean forwards, boolean permitInversion) { return BTree.slice(tree, comparator, lowerBound, inclusiveLowerBound, upperBound, inclusiveUpperBound, forwards); }
protected BTreeSearchIterator<V, V> slice(Dir dir) { return BTree.slice(tree, comparator, dir); }
protected BTreeSearchIterator<V, V> slice(Dir dir) { return BTree.slice(tree, comparator, dir); }
protected BTreeSearchIterator<V, V> slice(Dir dir) { return BTree.slice(tree, comparator, dir); }
/** * @param btree the tree to iterate over * @param comparator the comparator that defines the ordering over the items in the tree * @param start the beginning of the range to return, inclusive (in ascending order) * @param end the end of the range to return, exclusive (in ascending order) * @param dir if false, the iterator will start at the last item and move backwards * @return an Iterator over the defined sub-range of the tree */ public static <K, V extends K> BTreeSearchIterator<K, V> slice(Object[] btree, Comparator<? super K> comparator, K start, K end, Dir dir) { return slice(btree, comparator, start, true, end, false, dir); }
/** * Iterator over all the columns of this object. * * @return an iterator over all the columns of this object. */ public BTreeSearchIterator<ColumnDefinition, ColumnDefinition> iterator() { return BTree.<ColumnDefinition, ColumnDefinition>slice(columns, Comparator.naturalOrder(), BTree.Dir.ASC); }
/** * Iterator over all the columns of this object. * * @return an iterator over all the columns of this object. */ public BTreeSearchIterator<ColumnDefinition, ColumnDefinition> iterator() { return BTree.<ColumnDefinition, ColumnDefinition>slice(columns, Comparator.naturalOrder(), BTree.Dir.ASC); }
public int size() { return BTree.slice(ref.tree, true).count(); } };
/** * Returns a predicate to test whether columns are included in this {@code Columns} object, * assuming that tes tested columns are passed to the predicate in sorted order. * * @return a predicate to test the inclusion of sorted columns in this object. */ public Predicate<ColumnDefinition> inOrderInclusionTester() { SearchIterator<ColumnDefinition, ColumnDefinition> iter = BTree.slice(columns, Comparator.naturalOrder(), BTree.Dir.ASC); return column -> iter.next(column) != null; }
/** * Returns a predicate to test whether columns are included in this {@code Columns} object, * assuming that tes tested columns are passed to the predicate in sorted order. * * @return a predicate to test the inclusion of sorted columns in this object. */ public Predicate<ColumnDefinition> inOrderInclusionTester() { SearchIterator<ColumnDefinition, ColumnDefinition> iter = BTree.slice(columns, Comparator.naturalOrder(), BTree.Dir.ASC); return column -> iter.next(column) != null; }
/** * Returns a predicate to test whether columns are included in this {@code Columns} object, * assuming that tes tested columns are passed to the predicate in sorted order. * * @return a predicate to test the inclusion of sorted columns in this object. */ public Predicate<ColumnDefinition> inOrderInclusionTester() { SearchIterator<ColumnDefinition, ColumnDefinition> iter = BTree.slice(columns, Comparator.naturalOrder(), BTree.Dir.ASC); return column -> iter.next(column) != null; }
private static Iterator<Cell> slice(Object[] btree, Comparator<Object> comparator, Composite start, Composite finish, boolean forwards) { return BTree.slice(btree, comparator, start.isEmpty() ? null : start, true, finish.isEmpty() ? null : finish, true, forwards); } }
private UnfilteredRowIterator sliceIterator(ColumnFilter selection, Slice slice, boolean reversed, Holder current, Row staticRow) { ClusteringBound start = slice.start() == ClusteringBound.BOTTOM ? null : slice.start(); ClusteringBound end = slice.end() == ClusteringBound.TOP ? null : slice.end(); Iterator<Row> rowIter = BTree.slice(current.tree, metadata.comparator, start, true, end, true, desc(reversed)); Iterator<RangeTombstone> deleteIter = current.deletionInfo.rangeIterator(slice, reversed); return merge(rowIter, deleteIter, selection, reversed, current, staticRow); }
private UnfilteredRowIterator sliceIterator(ColumnFilter selection, Slice slice, boolean reversed, Holder current, Row staticRow) { ClusteringBound start = slice.start() == ClusteringBound.BOTTOM ? null : slice.start(); ClusteringBound end = slice.end() == ClusteringBound.TOP ? null : slice.end(); Iterator<Row> rowIter = BTree.slice(current.tree, metadata.comparator, start, true, end, true, desc(reversed)); Iterator<RangeTombstone> deleteIter = current.deletionInfo.rangeIterator(slice, reversed); return merge(rowIter, deleteIter, selection, reversed, current, staticRow); }
private UnfilteredRowIterator sliceIterator(ColumnFilter selection, Slice slice, boolean reversed, Holder current, Row staticRow) { ClusteringBound start = slice.start() == ClusteringBound.BOTTOM ? null : slice.start(); ClusteringBound end = slice.end() == ClusteringBound.TOP ? null : slice.end(); Iterator<Row> rowIter = BTree.slice(current.tree, metadata.comparator, start, true, end, true, desc(reversed)); Iterator<RangeTombstone> deleteIter = current.deletionInfo.rangeIterator(slice, reversed); return merge(rowIter, deleteIter, selection, reversed, current, staticRow); }