コード例 #1
0
 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));
 }
コード例 #2
0
 public V higher(V v) {
   return maybe(Math.max(lowerBound, BTree.higherIndex(tree, comparator, v)));
 }