use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.
the class TestRecordBuffer method recBuffer03.
// Shift at LHS
@Test
public void recBuffer03() {
RecordBuffer rb = make(4, 5);
contains(rb, 2, 4, 6, 8);
rb.shiftUp(0);
rb.set(0, r(0));
contains(rb, 0, 2, 4, 6, 8);
rb.shiftDown(0);
contains(rb, 2, 4, 6, 8);
}
use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.
the class TestRecordBuffer method recBufferIterate06.
@Test
public void recBufferIterate06() {
RecordBuffer rb = make(3, 5);
Iterator<Record> iter = rb.iterator(null, intToRecord(1));
same(iter);
}
use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.
the class TestRecordBuffer method recBuffer15.
// Remove tests
@Test
public void recBuffer15() {
RecordBuffer rb = make(5, 5);
contains(rb, 2, 4, 6, 8, 10);
rb.removeTop();
contains(rb, 2, 4, 6, 8);
rb.remove(1);
contains(rb, 2, 6, 8);
rb.remove(2);
contains(rb, 2, 6);
rb.remove(0);
contains(rb, 6);
rb.remove(0);
contains(rb);
}
use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.
the class TestRecordBuffer method recBuffer04.
@Test
public void recBuffer04() {
RecordBuffer rb = make(4, 5);
contains(rb, 2, 4, 6, 8);
rb.shiftDown(0);
contains(rb, 4, 6, 8);
rb.shiftUp(0);
rb.set(0, r(1));
contains(rb, 1, 4, 6, 8);
}
use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.
the class TestRecordBuffer method recBuffer02.
@Test
public void recBuffer02() {
RecordBuffer rb = make(4, 4);
int idx = -1;
idx = find(rb, 6);
assertEquals(2, idx);
idx = find(rb, 8);
assertEquals(3, idx);
idx = find(rb, 4);
assertEquals(1, idx);
idx = find(rb, 2);
assertEquals(0, idx);
idx = find(rb, 3);
assertEquals(-2, idx);
idx = find(rb, 0);
assertEquals(-1, idx);
idx = find(rb, 10);
assertEquals(-5, idx);
}
Aggregations