/** * copies the key/value mappings in <tt>map</tt> into this map. * * @param map a <code>Map</code> value */ public void putAll(Map<? extends K, ? extends V> map) { ensureCapacity(map.size()); // could optimize this for cases when map instanceof THashMap for (Iterator<? extends Map.Entry<? extends K, ? extends V>> i = map.entrySet().iterator(); i.hasNext(); ) { Map.Entry<? extends K, ? extends V> e = i.next(); put(e.getKey(), e.getValue()); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // VERSION byte version = in.readByte(); // NOTE: super was not written in version 0 if (version != 0) super.readExternal(in); // NUMBER OF ENTRIES int size = in.readInt(); setUp(size); // ENTRIES while (size-- > 0) { //noinspection unchecked K key = (K) in.readObject(); //noinspection unchecked V val = (V) in.readObject(); put(key, val); } } } // THashMap