use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.
the class TestPtrBuffer method ptrbuffer21.
@Test
public void ptrbuffer21() {
PtrBuffer pb1 = make(3, 5);
contains(pb1, 2, 4, 6);
PtrBuffer pb2 = make(0, 5);
contains(pb2);
pb1.shiftRight(pb2);
contains(pb1, 2, 4);
contains(pb2, 6);
}
use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.
the class TestPtrBuffer method ptrbuffer05.
// Shift at middle
@Test
public void ptrbuffer05() {
PtrBuffer pb = make(4, 5);
contains(pb, 2, 4, 6, 8);
pb.shiftUp(2);
pb.set(2, 0);
contains(pb, 2, 4, 0, 6, 8);
pb.shiftDown(2);
contains(pb, 2, 4, 6, 8);
}
use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.
the class TestPtrBuffer method ptrbuffer09.
// Errors - IllegalArgumentException
@Test(expected = BufferException.class)
public void ptrbuffer09() {
PtrBuffer pb = make(4, 5);
contains(pb, 2, 4, 6, 8);
pb.shiftDown(4);
}
use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.
the class TestPtrBuffer method make.
private static PtrBuffer make(int n, int len) {
ByteBuffer bb = ByteBuffer.allocate(4 * len);
PtrBuffer pb = new PtrBuffer(bb, 0);
for (int i = 0; i < n; i++) pb.add(2 + 2 * i);
return pb;
}
use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.
the class TestPtrBuffer method ptrbuffer27.
@Test
public void ptrbuffer27() {
PtrBuffer pb1 = make(2, 4);
PtrBuffer pb2 = make(2, 4);
pb1.copyToTop(pb2);
contains(pb2, 2, 4, 2, 4);
}
Aggregations