/** * Copies all of the mappings from the specified map to this map These mappings will replace any * mappings that this map had for any of the keys currently in the specified map. * * @param map mappings to be stored in this map. * @throws NullPointerException if the specified map is null. */ public void putAll(TObjectIntHashMap<K> map) { for (TObjectIntIterator<K> it = map.iterator(); it.hasNext(); ) { put(it.key(), it.value()); } }
public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); }
public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); }
public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); }
public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); }
public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); }
public int hashCode() { HashProcedure p = new HashProcedure(); forEach(p); return p.getHashCode(); }
/** * initializes the hashtable to a prime capacity which is at least <tt>initialCapacity + * 1</tt>. * * @param initialCapacity an <code>int</code> value * @return the actual capacity chosen */ protected int setUp(int initialCapacity) { int capacity; capacity = PrimeFinder.nextPrime(initialCapacity); computeMaxSize(capacity); computeNextAutoCompactionAmount(initialCapacity); return capacity; }
public final boolean execute(short key, long value) { h += (_hashingStrategy.computeHashCode(key) ^ HashFunctions.hash(value)); return true; } }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, or {@code null} if none was found. */ public V put(K key, V value) { int index = insertionIndex(key); return doPut(key, value, index); }
/** * Executes <tt>procedure</tt> for each key in the map. * * @param procedure a <code>TObjectProcedure</code> value * @return false if the loop over the keys terminated because the procedure returned false for * some key. */ public boolean forEachKey(TObjectProcedure<K> procedure) { return forEach(procedure); }
/** * Empties the collection. */ public void clear() { _size = 0; _free = capacity(); }