78910111213141516
public class MahoutMap extends MapImplementation<OpenIntIntHashMap> { public MahoutMap() { super(new OpenIntIntHashMap( IntIntOpenHashMap.DEFAULT_CAPACITY, AbstractIntIntMap.DEFAULT_MIN_LOAD_FACTOR, IntIntOpenHashMap.DEFAULT_LOAD_FACTOR)); }
2021222324252627282930
public int get(int k) { return instance.get(k); } @Override public int containKeys(int [] keys) { final OpenIntIntHashMap prepared = this.instance; int count = 0; for (int i = 0; i < keys.length; i++) count += prepared.containsKey(keys[i]) ? 1 : 0; return count; }
30313233343536373839404142
} @Override public int putAll(int [] keys, int [] values) { final OpenIntIntHashMap instance = this.instance; int count = 0; for (int i = 0; i < keys.length; i++) { count += instance.put(keys[i], values[i]) ? 1 : 0; } return count; }
3334353637383940
} private void initCaches() { this.caches = new OpenIntIntHashMap[getProbes()]; for (int probe = 0; probe < getProbes(); probe++) { caches[probe] = new OpenIntIntHashMap(); } }
3233343536373839
} private void initCaches() { caches = new OpenIntIntHashMap[getProbes()]; for (int probe = 0; probe < getProbes(); probe++) { caches[probe] = new OpenIntIntHashMap(); } }