Package krati.store

Examples of krati.store.ArrayStoreIterator


        assertTrue(iter1.hasNext());
        assertEquals(randomIndex, iter1.index());
        assertEquals(randomIndex, iter1.next().intValue());
       
        // Test ArrayStoreIndexIterator
        ArrayStoreIterator iter2 = new ArrayStoreIterator(_store);
        assertEquals(_store.getIndexStart(), iter2.index());
        assertTrue(iter2.hasNext());
       
        int cnt2 = 0;
        while(iter2.hasNext()) {
            iter2.next();
            cnt2++;
        }
        assertEquals(_store.capacity(), cnt2);
       
        for(int i = 0; i < 100; i++) {
            iter2.reset(getRandomIndex());
        }
       
        try {
            iter2.reset(_store.getIndexStart() - 1);
            assertTrue(false);
        } catch(ArrayIndexOutOfBoundsException e) {}
       
        try {
            iter2.reset(_store.getIndexStart() + _store.capacity());
            assertTrue(false);
        } catch(ArrayIndexOutOfBoundsException e) {}
       
        iter2.reset(randomIndex);
        assertTrue(iter2.hasNext());
        assertEquals(randomIndex, iter2.index());
        assertTrue(Arrays.equals(randomBytes, iter2.next().getValue()));
    }
View Full Code Here

TOP

Related Classes of krati.store.ArrayStoreIterator

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.