Search in sources :

Example 16 with PtrBuffer

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

the class TestPtrBuffer method ptrbuffer22.

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

Example 17 with PtrBuffer

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

the class TestPtrBuffer method ptrbuffer28.

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

Example 18 with PtrBuffer

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

the class TestPtrBuffer method ptrbuffer03.

// No BinarySearch test
// Shift at LHS
@Test
public void ptrbuffer03() {
    PtrBuffer pb = make(4, 5);
    contains(pb, 2, 4, 6, 8);
    pb.shiftUp(0);
    pb.set(0, 99);
    contains(pb, 99, 2, 4, 6, 8);
    pb.shiftDown(0);
    contains(pb, 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 19 with PtrBuffer

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

the class TestPtrBuffer method ptrbuffer12.

// Copy, duplicate, clear
@Test
public void ptrbuffer12() {
    PtrBuffer pb = make(5, 5);
    contains(pb, 2, 4, 6, 8, 10);
    PtrBuffer pb2 = pb.duplicate();
    pb2.set(1, 99);
    contains(pb, 2, 4, 6, 8, 10);
    contains(pb2, 2, 99, 6, 8, 10);
}
Also used : PtrBuffer(org.apache.jena.tdb.base.buffer.PtrBuffer) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 20 with PtrBuffer

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

the class TestPtrBuffer method ptrbuffer24.

@Test
public void ptrbuffer24() {
    PtrBuffer pb1 = make(0, 5);
    contains(pb1);
    PtrBuffer pb2 = make(5, 5);
    contains(pb2, 2, 4, 6, 8, 10);
    pb1.shiftLeft(pb2);
    contains(pb1, 2);
    contains(pb2, 4, 6, 8, 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