Examples of IntArrayCache


Examples of edu.brown.hstore.util.ArrayCache.IntArrayCache

   
    /**
     * testIntArrayCache
     */
    public void testIntArrayCache() throws Exception {
        IntArrayCache cache = new IntArrayCache(INITIAL_SIZE);
        for (int i = 1; i < MAX_SIZE; i++) {
            int arr[] = cache.getArray(i);
            assertNotNull(arr);
            assertEquals(i, arr.length);
            Arrays.fill(arr, i);
        } // FOR
       
        // Make sure that we are reusing the arrays
        for (int i = 1; i < MAX_SIZE; i++) {
            int arr[] = cache.getArray(i);
            assertNotNull(arr);
            assertEquals(i, arr.length);
            for (int ii = 0; ii < arr.length; ii++)
                assertEquals(i, arr[ii]);
        } // FOR
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.