Package it.unimi.dsi.fastutil.ints

Examples of it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap


    @Test
    public void fastutilOpenHashMap()
    {
        final char [] CHARS = DATA;
        final Int2IntOpenHashMap map = new Int2IntOpenHashMap();
        map.defaultReturnValue(0);
   
        for (int i = 0; i < CHARS.length - 1; i++)
        {
            final int bigram = CHARS[i] << 16 | CHARS[i+1];
            map.addTo(bigram, 1);
        }
   
        guard = map.size();
    }
View Full Code Here


public class FastUtilMap extends MapImplementation<Int2IntOpenHashMap>
{
    public FastUtilMap()
    {
        super(new Int2IntOpenHashMap(
            IntIntOpenHashMap.DEFAULT_CAPACITY,
            IntIntOpenHashMap.DEFAULT_LOAD_FACTOR));
    }
View Full Code Here

    public int get(int k) { return instance.get(k); }
   
    @Override
    public int containKeys(int [] keys)
    {
        final Int2IntOpenHashMap instance = this.instance;
        int count = 0;
        for (int i = 0; i < keys.length; i++)
            count += instance.containsKey(keys[i]) ? 1 : 0;
        return count;
    }
View Full Code Here

    }
   
    @Override
    public int putAll(int [] keys, int [] values)
    {
        final Int2IntOpenHashMap instance = this.instance;
        int count = 0;
        for (int i = 0; i < keys.length; i++)
        {
            count += instance.put(keys[i], values[i]);
        }
        return count;
    }
View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap

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.