Examples of indexesForArrayKey()


Examples of org.apache.harmony.unpack200.SegmentConstantPoolArrayCache.indexesForArrayKey()

public class SegmentConstantPoolArrayCacheTest extends TestCase {
   
    public void testSingleSimpleArray() {
        SegmentConstantPoolArrayCache arrayCache = new SegmentConstantPoolArrayCache();
        String array[] = {"Zero", "One", "Two", "Three", "Four"};
        List list = arrayCache.indexesForArrayKey(array, "Three");
        assertEquals(1, list.size());
        assertEquals(3, ((Integer)list.get(0)).intValue());
    }
   
    public void testSingleMultipleHitArray() {
View Full Code Here

Examples of org.apache.harmony.unpack200.SegmentConstantPoolArrayCache.indexesForArrayKey()

    }
   
    public void testSingleMultipleHitArray() {
        SegmentConstantPoolArrayCache arrayCache = new SegmentConstantPoolArrayCache();
        String array[] = {"Zero", "OneThreeFour", "Two", "OneThreeFour", "OneThreeFour"};
        List list = arrayCache.indexesForArrayKey(array, "OneThreeFour");
        assertEquals(3, list.size());
        assertEquals(1, ((Integer)list.get(0)).intValue());
        assertEquals(3, ((Integer)list.get(1)).intValue());
        assertEquals(4, ((Integer)list.get(2)).intValue());
    }
View Full Code Here

Examples of org.apache.harmony.unpack200.SegmentConstantPoolArrayCache.indexesForArrayKey()

    public void testMultipleArrayMultipleHit() {
        SegmentConstantPoolArrayCache arrayCache = new SegmentConstantPoolArrayCache();
        String arrayOne[] = {"Zero", "Shared", "Two", "Shared", "Shared"};
        String arrayTwo[] = {"Shared", "One", "Shared", "Shared", "Shared"};

        List listOne = arrayCache.indexesForArrayKey(arrayOne, "Shared");
        List listTwo = arrayCache.indexesForArrayKey(arrayTwo, "Shared");
        // Make sure we're using the cached values. First trip
        // through builds the cache.
        listOne = arrayCache.indexesForArrayKey(arrayOne, "Two");
        listTwo = arrayCache.indexesForArrayKey(arrayTwo, "Shared");
View Full Code Here

Examples of org.apache.harmony.unpack200.SegmentConstantPoolArrayCache.indexesForArrayKey()

        SegmentConstantPoolArrayCache arrayCache = new SegmentConstantPoolArrayCache();
        String arrayOne[] = {"Zero", "Shared", "Two", "Shared", "Shared"};
        String arrayTwo[] = {"Shared", "One", "Shared", "Shared", "Shared"};

        List listOne = arrayCache.indexesForArrayKey(arrayOne, "Shared");
        List listTwo = arrayCache.indexesForArrayKey(arrayTwo, "Shared");
        // Make sure we're using the cached values. First trip
        // through builds the cache.
        listOne = arrayCache.indexesForArrayKey(arrayOne, "Two");
        listTwo = arrayCache.indexesForArrayKey(arrayTwo, "Shared");
       
View Full Code Here

Examples of org.apache.harmony.unpack200.SegmentConstantPoolArrayCache.indexesForArrayKey()

        List listOne = arrayCache.indexesForArrayKey(arrayOne, "Shared");
        List listTwo = arrayCache.indexesForArrayKey(arrayTwo, "Shared");
        // Make sure we're using the cached values. First trip
        // through builds the cache.
        listOne = arrayCache.indexesForArrayKey(arrayOne, "Two");
        listTwo = arrayCache.indexesForArrayKey(arrayTwo, "Shared");
       
        assertEquals(1, listOne.size());
        assertEquals(2, ((Integer)listOne.get(0)).intValue());
View Full Code Here

Examples of org.apache.harmony.unpack200.SegmentConstantPoolArrayCache.indexesForArrayKey()

        List listOne = arrayCache.indexesForArrayKey(arrayOne, "Shared");
        List listTwo = arrayCache.indexesForArrayKey(arrayTwo, "Shared");
        // Make sure we're using the cached values. First trip
        // through builds the cache.
        listOne = arrayCache.indexesForArrayKey(arrayOne, "Two");
        listTwo = arrayCache.indexesForArrayKey(arrayTwo, "Shared");
       
        assertEquals(1, listOne.size());
        assertEquals(2, ((Integer)listOne.get(0)).intValue());

        // Now look for a different element in list one
View Full Code Here

Examples of org.apache.harmony.unpack200.SegmentConstantPoolArrayCache.indexesForArrayKey()

       
        assertEquals(1, listOne.size());
        assertEquals(2, ((Integer)listOne.get(0)).intValue());

        // Now look for a different element in list one
        listOne = arrayCache.indexesForArrayKey(arrayOne, "Shared");
        assertEquals(3, listOne.size());
        assertEquals(1, ((Integer)listOne.get(0)).intValue());
        assertEquals(3, ((Integer)listOne.get(1)).intValue());
        assertEquals(4, ((Integer)listOne.get(2)).intValue());
       
View Full Code Here

Examples of org.apache.harmony.unpack200.SegmentConstantPoolArrayCache.indexesForArrayKey()

        assertEquals(0, ((Integer)listTwo.get(0)).intValue());
        assertEquals(2, ((Integer)listTwo.get(1)).intValue());
        assertEquals(3, ((Integer)listTwo.get(2)).intValue());
        assertEquals(4, ((Integer)listTwo.get(3)).intValue());
       
        List listThree = arrayCache.indexesForArrayKey(arrayOne, "Not found");
        assertEquals(0, listThree.size());
    }
   
}
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.