public V ceiling(V v) { return maybe(Math.max(lowerBound, BTree.ceilIndex(tree, comparator, v))); }
public V ceiling(V v) { return maybe(Math.max(lowerBound, BTree.ceilIndex(tree, comparator, v))); }
public V ceiling(V v) { return maybe(Math.max(lowerBound, BTree.ceilIndex(tree, comparator, v))); }
public V ceiling(V v) { return maybe(Math.max(lowerBound, BTree.ceilIndex(tree, comparator, v))); }
public static <V> V ceil(Object[] btree, Comparator<? super V> comparator, V find) { int i = ceilIndex(btree, comparator, find); return i < size(btree) ? findByIndex(btree, i) : null; }
public static <V> V ceil(Object[] btree, Comparator<? super V> comparator, V find) { int i = ceilIndex(btree, comparator, find); return i < size(btree) ? findByIndex(btree, i) : null; }
public static <V> V ceil(Object[] btree, Comparator<? super V> comparator, V find) { int i = ceilIndex(btree, comparator, find); return i < size(btree) ? findByIndex(btree, i) : null; }
public static <V> V ceil(Object[] btree, Comparator<? super V> comparator, V find) { int i = ceilIndex(btree, comparator, find); return i < size(btree) ? findByIndex(btree, i) : null; }
private static int findFirstComplexIdx(Object[] tree) { // have fast path for common no-complex case int size = BTree.size(tree); if (!BTree.isEmpty(tree) && BTree.<ColumnDefinition>findByIndex(tree, size - 1).isSimple()) return size; return BTree.ceilIndex(tree, Comparator.naturalOrder(), FIRST_COMPLEX); }
private static int findFirstComplexIdx(Object[] tree) { // have fast path for common no-complex case int size = BTree.size(tree); if (!BTree.isEmpty(tree) && BTree.<ColumnDefinition>findByIndex(tree, size - 1).isSimple()) return size; return BTree.ceilIndex(tree, Comparator.naturalOrder(), FIRST_COMPLEX); }
private static int findFirstComplexIdx(Object[] tree) { // have fast path for common no-complex case int size = BTree.size(tree); if (!BTree.isEmpty(tree) && BTree.<ColumnDefinition>findByIndex(tree, size - 1).isSimple()) return size; return BTree.ceilIndex(tree, Comparator.naturalOrder(), FIRST_COMPLEX); }
private static int findFirstComplexIdx(Object[] tree) { // have fast path for common no-complex case int size = BTree.size(tree); if (!BTree.isEmpty(tree) && BTree.<ColumnDefinition>findByIndex(tree, size - 1).isSimple()) return size; return BTree.ceilIndex(tree, Comparator.naturalOrder(), FIRST_COMPLEX); }
BTreeRange(Object[] tree, Comparator<? super V> comparator, V lowerBound, boolean inclusiveLowerBound, V upperBound, boolean inclusiveUpperBound) { this(tree, comparator, lowerBound == null ? 0 : inclusiveLowerBound ? BTree.ceilIndex(tree, comparator, lowerBound) : BTree.higherIndex(tree, comparator, lowerBound), upperBound == null ? BTree.size(tree) - 1 : inclusiveUpperBound ? BTree.floorIndex(tree, comparator, upperBound) : BTree.lowerIndex(tree, comparator, upperBound)); }
BTreeRange(Object[] tree, Comparator<? super V> comparator, V lowerBound, boolean inclusiveLowerBound, V upperBound, boolean inclusiveUpperBound) { this(tree, comparator, lowerBound == null ? 0 : inclusiveLowerBound ? BTree.ceilIndex(tree, comparator, lowerBound) : BTree.higherIndex(tree, comparator, lowerBound), upperBound == null ? BTree.size(tree) - 1 : inclusiveUpperBound ? BTree.floorIndex(tree, comparator, upperBound) : BTree.lowerIndex(tree, comparator, upperBound)); }
/** * @param btree the tree to iterate over * @param comparator the comparator that defines the ordering over the items in the tree * @param start low bound of the range * @param startInclusive inclusivity of lower bound * @param end high bound of the range * @param endInclusive inclusivity of higher bound * @param dir direction of iteration * @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, boolean startInclusive, K end, boolean endInclusive, Dir dir) { int inclusiveLowerBound = max(0, start == null ? Integer.MIN_VALUE : startInclusive ? ceilIndex(btree, comparator, start) : higherIndex(btree, comparator, start)); int inclusiveUpperBound = min(size(btree) - 1, end == null ? Integer.MAX_VALUE : endInclusive ? floorIndex(btree, comparator, end) : lowerIndex(btree, comparator, end)); return new BTreeSearchIterator<>(btree, comparator, dir, inclusiveLowerBound, inclusiveUpperBound); }
BTreeRange(Object[] tree, Comparator<? super V> comparator, V lowerBound, boolean inclusiveLowerBound, V upperBound, boolean inclusiveUpperBound) { this(tree, comparator, lowerBound == null ? 0 : inclusiveLowerBound ? BTree.ceilIndex(tree, comparator, lowerBound) : BTree.higherIndex(tree, comparator, lowerBound), upperBound == null ? BTree.size(tree) - 1 : inclusiveUpperBound ? BTree.floorIndex(tree, comparator, upperBound) : BTree.lowerIndex(tree, comparator, upperBound)); }
BTreeRange(Object[] tree, Comparator<? super V> comparator, V lowerBound, boolean inclusiveLowerBound, V upperBound, boolean inclusiveUpperBound) { this(tree, comparator, lowerBound == null ? 0 : inclusiveLowerBound ? BTree.ceilIndex(tree, comparator, lowerBound) : BTree.higherIndex(tree, comparator, lowerBound), upperBound == null ? BTree.size(tree) - 1 : inclusiveUpperBound ? BTree.floorIndex(tree, comparator, upperBound) : BTree.lowerIndex(tree, comparator, upperBound)); }
/** * @param btree the tree to iterate over * @param comparator the comparator that defines the ordering over the items in the tree * @param start low bound of the range * @param startInclusive inclusivity of lower bound * @param end high bound of the range * @param endInclusive inclusivity of higher bound * @param dir direction of iteration * @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, boolean startInclusive, K end, boolean endInclusive, Dir dir) { int inclusiveLowerBound = max(0, start == null ? Integer.MIN_VALUE : startInclusive ? ceilIndex(btree, comparator, start) : higherIndex(btree, comparator, start)); int inclusiveUpperBound = min(size(btree) - 1, end == null ? Integer.MAX_VALUE : endInclusive ? floorIndex(btree, comparator, end) : lowerIndex(btree, comparator, end)); return new BTreeSearchIterator<>(btree, comparator, dir, inclusiveLowerBound, inclusiveUpperBound); }
/** * @param btree the tree to iterate over * @param comparator the comparator that defines the ordering over the items in the tree * @param start low bound of the range * @param startInclusive inclusivity of lower bound * @param end high bound of the range * @param endInclusive inclusivity of higher bound * @param dir direction of iteration * @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, boolean startInclusive, K end, boolean endInclusive, Dir dir) { int inclusiveLowerBound = max(0, start == null ? Integer.MIN_VALUE : startInclusive ? ceilIndex(btree, comparator, start) : higherIndex(btree, comparator, start)); int inclusiveUpperBound = min(size(btree) - 1, end == null ? Integer.MAX_VALUE : endInclusive ? floorIndex(btree, comparator, end) : lowerIndex(btree, comparator, end)); return new BTreeSearchIterator<>(btree, comparator, dir, inclusiveLowerBound, inclusiveUpperBound); }
/** * @param btree the tree to iterate over * @param comparator the comparator that defines the ordering over the items in the tree * @param start low bound of the range * @param startInclusive inclusivity of lower bound * @param end high bound of the range * @param endInclusive inclusivity of higher bound * @param dir direction of iteration * @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, boolean startInclusive, K end, boolean endInclusive, Dir dir) { int inclusiveLowerBound = max(0, start == null ? Integer.MIN_VALUE : startInclusive ? ceilIndex(btree, comparator, start) : higherIndex(btree, comparator, start)); int inclusiveUpperBound = min(size(btree) - 1, end == null ? Integer.MAX_VALUE : endInclusive ? floorIndex(btree, comparator, end) : lowerIndex(btree, comparator, end)); return new BTreeSearchIterator<>(btree, comparator, dir, inclusiveLowerBound, inclusiveUpperBound); }