/** * Copies all of the mappings from the specified map to this one. * These mappings replace any mappings that this map had for any of the * keys currently in the specified Map. * * @param t Mappings to be stored in this map. */ @Override public void putAll(Map t) { for (Object o : t.entrySet()) { Map.Entry e = (Map.Entry) o; put(e.getKey(), e.getValue()); } }
/** * Associates the specified value with the specified key in this map. If the * map previously contained a mapping for this key, the old value is * replaced. * * @param key key with which the specified value is to be associated. * @param value value to be associated with the specified key. * @return previous value associated with specified key, or <code>null</code> if * there was no mapping for key. A <code>null</code> return can also indicate * that the IntHashMap previously associated <code>null</code> with the * specified key. */ @Override public Object put(Object key, Object value) { if (key instanceof Number) { return put(((Number) key).intValue(), value); } throw new UnsupportedOperationException("IntHashMap key must be a Number"); }
/** * Associates the specified value with the specified key in this map. If the * map previously contained a mapping for this key, the old value is * replaced. * * @param key key with which the specified value is to be associated. * @param value value to be associated with the specified key. * @return previous value associated with specified key, or <code>null</code> if * there was no mapping for key. A <code>null</code> return can also indicate * that the IntHashMap previously associated <code>null</code> with the * specified key. */ @Override public Object put(final Object key, final Object value) { if (key instanceof Number) { return put(((Number) key).intValue(), value); } throw new UnsupportedOperationException("IntHashMap key must be a Number"); }
/** * Copies all of the mappings from the specified map to this one. * These mappings replace any mappings that this map had for any of the * keys currently in the specified Map. * * @param t Mappings to be stored in this map. */ @Override public void putAll(final Map t) { for (Object o : t.entrySet()) { Map.Entry e = (Map.Entry) o; put(e.getKey(), e.getValue()); } }
/** * Copies all of the mappings from the specified map to this one. * These mappings replace any mappings that this map had for any of the * keys currently in the specified Map. * * @param t Mappings to be stored in this map. */ @Override public void putAll(Map t) { for (Object o : t.entrySet()) { Map.Entry e = (Map.Entry) o; put(e.getKey(), e.getValue()); } }
/** * Associates the specified value with the specified key in this map. If the * map previously contained a mapping for this key, the old value is * replaced. * * @param key key with which the specified value is to be associated. * @param value value to be associated with the specified key. * @return previous value associated with specified key, or <code>null</code> if * there was no mapping for key. A <code>null</code> return can also indicate * that the IntHashMap previously associated <code>null</code> with the * specified key. */ @Override public Object put(Object key, Object value) { if (key instanceof Number) { return put(((Number) key).intValue(), value); } throw new UnsupportedOperationException("IntHashMap key must be a Number"); }
/** * Copies all of the mappings from the specified map to this one. * These mappings replace any mappings that this map had for any of the * keys currently in the specified Map. * * @param t Mappings to be stored in this map. */ @Override public void putAll(final Map t) { for (Object o : t.entrySet()) { Map.Entry e = (Map.Entry) o; put(e.getKey(), e.getValue()); } }
/** * Associates the specified value with the specified key in this map. If the * map previously contained a mapping for this key, the old value is * replaced. * * @param key key with which the specified value is to be associated. * @param value value to be associated with the specified key. * @return previous value associated with specified key, or <code>null</code> if * there was no mapping for key. A <code>null</code> return can also indicate * that the IntHashMap previously associated <code>null</code> with the * specified key. */ @Override public Object put(final Object key, final Object value) { if (key instanceof Number) { return put(((Number) key).intValue(), value); } throw new UnsupportedOperationException("IntHashMap key must be a Number"); }
private static Hasher32 checkSeed(List<byte[]> values, int seed) { IntHashMap hashCodes = new IntHashMap(); Hasher32 hasher = new Hasher32(seed); for (byte[] object : values) { int hashCode = hasher.hashUnsafeWords(object); byte[] preObject = (byte[]) hashCodes.put(hashCode, object); if (preObject != null) { return null; } } return hasher; } }