/** * The converse of indexOf: provided an index between 0 and size, returns the i'th item, in set order. */ public V get(int index) { return BTree.<V>findByIndex(tree, index); }
/** * Returns the ith complex column of this object. * * @param i the index for the complex column to fectch. This must * satisfy {@code 0 <= i < complexColumnCount()}. * * @return the {@code i}th complex column in this object. */ public ColumnDefinition getComplex(int i) { return BTree.findByIndex(columns, complexIdx + i); }
public Cell getCellByIndex(int idx) { return BTree.findByIndex(cells, idx); }
/** * The converse of indexOf: provided an index between 0 and size, returns the i'th item, in set order. */ public V get(int index) { return BTree.<V>findByIndex(tree, index); }
/** * Returns the ith complex column of this object. * * @param i the index for the complex column to fectch. This must * satisfy {@code 0 <= i < complexColumnCount()}. * * @return the {@code i}th complex column in this object. */ public ColumnDefinition getComplex(int i) { return BTree.findByIndex(columns, complexIdx + i); }
/** * Returns the ith simple column of this object. * * @param i the index for the simple column to fectch. This must * satisfy {@code 0 <= i < simpleColumnCount()}. * * @return the {@code i}th simple column in this object. */ public ColumnDefinition getSimple(int i) { return BTree.findByIndex(columns, i); }
/** * Returns the ith complex column of this object. * * @param i the index for the complex column to fectch. This must * satisfy {@code 0 <= i < complexColumnCount()}. * * @return the {@code i}th complex column in this object. */ public ColumnDefinition getComplex(int i) { return BTree.findByIndex(columns, complexIdx + i); }
public V get(int index) { index = upperBound - index; if (outOfBounds(index)) throw new NoSuchElementException(); return BTree.findByIndex(tree, index); }
public static <V> V floor(Object[] btree, Comparator<? super V> comparator, V find) { int i = floorIndex(btree, comparator, find); return i >= 0 ? findByIndex(btree, i) : null; }
public static <V> V floor(Object[] btree, Comparator<? super V> comparator, V find) { int i = floorIndex(btree, comparator, find); return i >= 0 ? findByIndex(btree, i) : null; }
public static <V> V lower(Object[] btree, Comparator<? super V> comparator, V find) { int i = lowerIndex(btree, comparator, find); return i >= 0 ? findByIndex(btree, i) : null; }
public V get(int index) { index = upperBound - index; if (outOfBounds(index)) throw new NoSuchElementException(); return BTree.findByIndex(tree, index); }
public static <V> V higher(Object[] btree, Comparator<? super V> comparator, V find) { int i = higherIndex(btree, comparator, find); return i < size(btree) ? findByIndex(btree, i) : null; }
public static <V> V higher(Object[] btree, Comparator<? super V> comparator, V find) { int i = higherIndex(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 higher(Object[] btree, Comparator<? super V> comparator, V find) { int i = higherIndex(btree, comparator, find); return i < size(btree) ? findByIndex(btree, i) : null; }
public Row lastRow() { Object[] tree = holder().tree; if (BTree.isEmpty(tree)) return null; return BTree.findByIndex(tree, BTree.size(tree) - 1); } }
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); }
public Row lastRow() { Object[] tree = holder().tree; if (BTree.isEmpty(tree)) return null; return BTree.findByIndex(tree, BTree.size(tree) - 1); } }