Search in sources :

Example 21 with PtrBuffer

use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.

the class TestPtrBuffer method ptrbuffer14.

@Test
public void ptrbuffer14() {
    PtrBuffer pb = make(5, 5);
    contains(pb, 2, 4, 6, 8, 10);
    PtrBuffer pb2 = make(5, 5);
    contains(pb2, 2, 4, 6, 8, 10);
    pb.copy(0, pb2, 1, 4);
    contains(pb2, 2, 2, 4, 6, 8);
}
Also used : PtrBuffer(org.apache.jena.tdb.base.buffer.PtrBuffer) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 22 with PtrBuffer

use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.

the class TestPtrBuffer method ptrbuffer26.

@Test
public void ptrbuffer26() {
    PtrBuffer pb1 = make(2, 5);
    contains(pb1, 2, 4);
    PtrBuffer pb2 = make(3, 5);
    contains(pb2, 2, 4, 6);
    pb1.shiftLeft(pb2);
    contains(pb1, 2, 4, 2);
    contains(pb2, 4, 6);
}
Also used : PtrBuffer(org.apache.jena.tdb.base.buffer.PtrBuffer) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 23 with PtrBuffer

use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.

the class TestPtrBuffer method ptrbuffer04.

@Test
public void ptrbuffer04() {
    PtrBuffer pb = make(4, 5);
    contains(pb, 2, 4, 6, 8);
    pb.shiftDown(0);
    contains(pb, 4, 6, 8);
    pb.shiftUp(0);
    pb.set(0, 1);
    contains(pb, 1, 4, 6, 8);
}
Also used : PtrBuffer(org.apache.jena.tdb.base.buffer.PtrBuffer) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 24 with PtrBuffer

use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.

the class TestPtrBuffer method ptrbuffer13.

@Test
public void ptrbuffer13() {
    PtrBuffer pb = make(5, 5);
    contains(pb, 2, 4, 6, 8, 10);
    pb.clear(1, 3);
    contains(pb, 2, -1, -1, -1, 10);
}
Also used : PtrBuffer(org.apache.jena.tdb.base.buffer.PtrBuffer) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 25 with PtrBuffer

use of org.apache.jena.tdb.base.buffer.PtrBuffer in project jena by apache.

the class TestPtrBuffer method ptrbuffer20.

@Test
public void ptrbuffer20() {
    PtrBuffer pb1 = make(5, 5);
    contains(pb1, 2, 4, 6, 8, 10);
    PtrBuffer pb2 = make(0, 5);
    contains(pb2);
    pb1.shiftRight(pb2);
    contains(pb1, 2, 4, 6, 8);
    contains(pb2, 10);
}
Also used : PtrBuffer(org.apache.jena.tdb.base.buffer.PtrBuffer) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Aggregations

PtrBuffer (org.apache.jena.tdb.base.buffer.PtrBuffer)27 BaseTest (org.apache.jena.atlas.junit.BaseTest)23 Test (org.junit.Test)23 RecordBuffer (org.apache.jena.tdb.base.buffer.RecordBuffer)3 ByteBuffer (java.nio.ByteBuffer)2 Record (org.apache.jena.tdb.base.record.Record)1