use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class IndexTestLib method buildIndex.
// ---------- Utilities
// public static RangeIndex buildRangeIndex(RangeIndexMaker maker, int[]
// keys)
// {
// RangeIndex index = maker.make();
// IndexTestLib.add(index, keys);
// return index;
// }
public static Index buildIndex(IndexMaker maker, int[] keys) {
Index index = maker.makeIndex();
IndexTestLib.add(index, keys);
return index;
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class TDB2StorageBuilder method makeTupleIndex.
private TupleIndex makeTupleIndex(String primary, String index, String name) {
TupleMap cmap = TupleMap.create(primary, index);
RecordFactory rf = new RecordFactory(SystemTDB.SizeOfNodeId * cmap.length(), 0);
RangeIndex rIdx = makeRangeIndex(rf, index);
TupleIndex tIdx = new TupleIndexRecord(primary.length(), cmap, index, rf, rIdx);
return tIdx;
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_iter_0_02.
@Test
public void tree_iter_0_02() {
int[] keys = { 1, 2, 3, 4, 5 };
RangeIndex rIndex = makeRangeIndex(5);
add(rIndex, keys);
List<Integer> x = toIntList(rIndex.iterator(null, null));
List<Integer> expected = toIntList(keys);
assertEquals(expected, x);
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_iter_2_05.
@Test
public void tree_iter_2_05() {
int[] keys = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
RangeIndex rIndex = makeRangeIndex(2);
add(rIndex, keys);
List<Integer> x = toIntList(rIndex.iterator(null, r(4)));
List<Integer> expected = toIntList(0, 1, 2, 3);
assertEquals(expected, x);
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_ins_2_03.
@Test
public void tree_ins_2_03() {
int[] keys = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 };
RangeIndex rIndex = makeRangeIndex(2);
testInsert(rIndex, keys);
assertEquals(0, r(rIndex.minKey()));
assertEquals(9, r(rIndex.maxKey()));
}
Aggregations