Examples of IntArrayList


Examples of xbird.util.collections.ints.IntArrayList

    /*
     * Test method for 'xbird.util.IntHash.put(int, V)'
     */
    public void testPut() {
        IntArrayList keys = new IntArrayList(100000);
        IntHash<Long> hash = new IntHash<Long>();
        Random random = new Random(System.currentTimeMillis());
        for(int i = 0; i < 100000; i++) {
            int key = random.nextInt();
            keys.add(key);
            long value = random.nextLong();
            hash.put(key, value);
        }
        IntHash<Long> copyed = ObjectUtils.deepCopy(hash);
        assert (hash.size() == copyed.size());
        for(int i = 0; i < 100000; i++) {
            int key = keys.get(i);
            assertEquals(hash.get(key), copyed.get(key));
        }
    }
View Full Code Here

Examples of xbird.util.collections.ints.IntArrayList

    public Int2IntHashTest(String name) {
        super(name);
    }

    public void testPut() {
        IntArrayList keys = new IntArrayList(100000);
        Int2IntHash hash = new Int2IntHash(100000);
        Random random = new Random(System.currentTimeMillis());
        for(int i = 0; i < 100000; i++) {
            int key = random.nextInt();
            keys.add(key);
            int value = random.nextInt();
            hash.put(key, value);
        }
        Int2IntHash copyed = ObjectUtils.deepCopy(hash);
        assert (hash.size() == copyed.size());
        for(int i = 0; i < 100000; i++) {
            int key = keys.get(i);
            assertEquals(hash.get(key), copyed.get(key));
        }
    }
View Full Code Here

Examples of xbird.util.collections.ints.IntArrayList

    public static int[] decode(final byte[] binary, final int len) {
        if(len == 0) {
            return null;
        }
        IntArrayList res = new IntArrayList((int) (len * 0.75));
        int code;
        for(int offset = 0; (code = decodeCharacter(binary, offset, 0, 0)) != EOF; offset += characterSize(code)) {
            res.add(code);
        }
        return res.toArray();
    }
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.