use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_ret_1.
@Test
public void tree_ret_1() {
int[] keys = { 1, 2, 3, 4, 5 };
RangeIndex rIndex = makeRangeIndex(2);
add(rIndex, keys);
boolean b = rIndex.insert(intToRecord(3));
assertFalse(b);
b = rIndex.insert(intToRecord(9));
assertTrue(b);
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_iter_2_07.
@Test
public void tree_iter_2_07() {
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(99)));
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_del_2_09.
@Test
public void tree_del_2_09() {
int[] keys1 = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 };
int[] keys2 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
RangeIndex rIndex = makeRangeIndex(2);
testInsertDelete(rIndex, keys1, keys2);
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_iter_2_03.
@Test
public void tree_iter_2_03() {
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(r(4), null));
List<Integer> expected = toIntList(4, 5, 6, 7, 8, 9);
assertEquals(expected, x);
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_ins_2_05.
@Test
public void tree_ins_2_05() {
int[] keys = { 0, 18, 4, 14, 8, 10, 12, 6, 16, 2 };
RangeIndex rIndex = makeRangeIndex(2);
testInsert(rIndex, keys);
assertFalse(rIndex.contains(r(1)));
assertFalse(rIndex.contains(r(999)));
assertFalse(rIndex.contains(r(-9)));
assertFalse(rIndex.contains(r(7)));
assertEquals(0, r(rIndex.minKey()));
assertEquals(18, r(rIndex.maxKey()));
}
Aggregations