Examples of IntIntHashMap


Examples of com.gs.collections.impl.map.mutable.primitive.IntIntHashMap

                : new IntIntHashMap().toImmutable();
    }

    public ImmutableIntIntMap reject(IntIntPredicate predicate)
    {
        return predicate.accept(this.key1, this.value1) ? new IntIntHashMap().toImmutable()
                : IntIntHashMap.newWithKeysValues(this.key1, this.value1).toImmutable();
    }
View Full Code Here

Examples of org.h2.util.IntIntHashMap

    public static void main(String... a) throws Exception {
        TestBase.createCaller().init().test();
    }

    public void test() {
        IntIntHashMap map = new IntIntHashMap();
        map.put(1, 1);
        map.put(1, 2);
        assertEquals(1, map.size());
        map.put(0, 1);
        map.put(0, 2);
        assertEquals(2, map.size());
        rand.setSeed(10);
        test(true);
        test(false);
    }
View Full Code Here

Examples of org.h2.util.IntIntHashMap

        int[] x = new int[len];
        for (int i = 0; i < len; i++) {
            int key = random ? rand.nextInt() : i;
            x[i] = key;
        }
        IntIntHashMap map = new IntIntHashMap();
        for (int i = 0; i < len; i++) {
            map.put(x[i], i);
        }
        for (int i = 0; i < len; i++) {
            if (map.get(x[i]) != i) {
                throw new AssertionError("get " + x[i] + " = " + map.get(i) + " should be " + i);
            }
        }
        for (int i = 1; i < len; i += 2) {
            map.remove(x[i]);
        }
        for (int i = 1; i < len; i += 2) {
            if (map.get(x[i]) != -1) {
                throw new AssertionError("get " + x[i] + " = " + map.get(i) + " should be <=0");
            }
        }
        for (int i = 1; i < len; i += 2) {
            map.put(x[i], i);
        }
        for (int i = 0; i < len; i++) {
            if (map.get(x[i]) != i) {
                throw new AssertionError("get " + x[i] + " = " + map.get(i) + " should be " + i);
            }
        }
    }
View Full Code Here

Examples of org.h2.util.IntIntHashMap

        if (isDefrag) {
            writeBack();
            cache.clear();
            ArrayList<Table> tables = database.getAllTablesAndViews(false);
            recordedPagesList = New.arrayList();
            recordedPagesIndex = new IntIntHashMap();
            recordPageReads = true;
            Session s = database.getSystemSession();
            for (Table table : tables) {
                if (!table.isTemporary() && Table.TABLE.equals(table.getTableType())) {
                    Index scanIndex = table.getScanIndex(s);
View Full Code Here

Examples of org.h2.util.IntIntHashMap

            log.checkpoint();
            writeBack();
            cache.clear();
            ArrayList<Table> tables = database.getAllTablesAndViews(false);
            recordedPagesList = New.arrayList();
            recordedPagesIndex = new IntIntHashMap();
            recordPageReads = true;
            Session s = database.getSystemSession();
            for (Table table : tables) {
                if (!table.isTemporary() && Table.TABLE.equals(table.getTableType())) {
                    Index scanIndex = table.getScanIndex(s);
View Full Code Here

Examples of org.h2.util.IntIntHashMap

     */
    void add(Database database, boolean distinct, Value v) {
        if (aggregateType == Aggregate.SELECTIVITY) {
            count++;
            if (distinctHashes == null) {
                distinctHashes = new IntIntHashMap();
            }
            int size = distinctHashes.size();
            if (size > Constants.SELECTIVITY_DISTINCT_COUNT) {
                distinctHashes = new IntIntHashMap();
                m2 += size;
            }
            int hash = v.hashCode();
            // the value -1 is not supported
            distinctHashes.put(hash, 1);
View Full Code Here

Examples of org.h2.util.IntIntHashMap

            log.checkpoint();
            writeBack();
            cache.clear();
            ArrayList<Table> tables = database.getAllTablesAndViews(false);
            recordedPagesList = New.arrayList();
            recordedPagesIndex = new IntIntHashMap();
            recordPageReads = true;
            Session s = database.getSystemSession();
            for (Table table : tables) {
                if (!table.isTemporary() && Table.TABLE.equals(table.getTableType())) {
                    Index scanIndex = table.getScanIndex(s);
View Full Code Here

Examples of org.h2.util.IntIntHashMap

     */
    void add(Database database, boolean distinct, Value v) {
        if (aggregateType == Aggregate.SELECTIVITY) {
            count++;
            if (distinctHashes == null) {
                distinctHashes = new IntIntHashMap();
            }
            int size = distinctHashes.size();
            if (size > Constants.SELECTIVITY_DISTINCT_COUNT) {
                distinctHashes = new IntIntHashMap();
                sum += size;
            }
            int hash = v.hashCode();
            // the value -1 is not supported
            distinctHashes.put(hash, 1);
View Full Code Here

Examples of org.lealone.util.IntIntHashMap

     */
    void add(Database database, boolean distinct, Value v) {
        if (aggregateType == Aggregate.SELECTIVITY) {
            count++;
            if (distinctHashes == null) {
                distinctHashes = new IntIntHashMap();
            }
            int size = distinctHashes.size();
            if (size > Constants.SELECTIVITY_DISTINCT_COUNT) {
                distinctHashes = new IntIntHashMap();
                m2 += size;
            }
            int hash = v.hashCode();
            // the value -1 is not supported
            distinctHashes.put(hash, 1);
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.