Package com.mobixess.jodb.core.query

Examples of com.mobixess.jodb.core.query.LArrayChunkedBuffer


    public static void main(String[] args) {
        testLongChunkBuffer();
    }
   
    public static void testLongChunkBuffer(){
        LArrayChunkedBuffer arrayChunkedBuffer = new LArrayChunkedBuffer();
        if(arrayChunkedBuffer.hasNext()){
            throw new RuntimeException();
        }
        int max = 2000;
        for (int i = 0; i < max; i++) {
            arrayChunkedBuffer.add(i);
        }
       
        for (int i = 0; i < max; i++) {
            if(!arrayChunkedBuffer.hasNext()){
                throw new RuntimeException();
            }
            if(arrayChunkedBuffer.next()!=i){
                throw new RuntimeException();
            }
        }
       
        arrayChunkedBuffer.setIteratorDirection(false);
       
        for (int i = max-1; i >= 0 ; i--) {
            if(!arrayChunkedBuffer.hasNext()){
                throw new RuntimeException();
            }
            if(arrayChunkedBuffer.next()!=i){
                throw new RuntimeException();
            }
        }
       
        long[] bufferAsArray = arrayChunkedBuffer.toArray();
       
        for (int i = 0; i < bufferAsArray.length; i++) {
            if(bufferAsArray[i]!=max-i-1){
                throw new RuntimeException();
            }
        }
       
        arrayChunkedBuffer.setIteratorDirection(true);
       

        bufferAsArray = arrayChunkedBuffer.toArray();

        for (int i = 0; i < bufferAsArray.length; i++) {
            if (bufferAsArray[i] != i) {
                throw new RuntimeException();
            }
View Full Code Here

TOP

Related Classes of com.mobixess.jodb.core.query.LArrayChunkedBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.