/** * Reconstitute the <tt>HashMap</tt> instance from a stream (i.e., deserialize it). * * @param s * @throws IOException * @throws ClassNotFoundException */ @SuppressWarnings("unchecked") private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { // Read in the threshold, loadfactor, and any hidden stuff s.defaultReadObject(); // Read in number of buckets and allocate the bucket array; int numBuckets = s.readInt(); table = new Entry[numBuckets]; init(); // Give subclass a chance to do its thing. // Read in size (number of Mappings) int size = s.readInt(); // Read the keys and values, and put the mappings in the HashMap for (int i = 0; i < size; i++) { int key = s.readInt(); V value = (V)s.readObject(); putForCreate(key, value); } }
void putAllForCreate(IntHashMap m) { for (Iterator i = m.entrySet().iterator(); i.hasNext();) { Entry e = (Entry)i.next(); putForCreate(e.getKey(), e.getValue()); } }
/** * Reconstitute the <tt>HashMap</tt> instance from a stream (i.e., deserialize it). * * @param s * @throws IOException * @throws ClassNotFoundException */ private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { // Read in the threshold, loadfactor, and any hidden stuff s.defaultReadObject(); // Read in number of buckets and allocate the bucket array; int numBuckets = s.readInt(); table = new Entry[numBuckets]; init(); // Give subclass a chance to do its thing. // Read in size (number of Mappings) int size = s.readInt(); // Read the keys and values, and put the mappings in the HashMap for (int i = 0; i < size; i++) { int key = s.readInt(); Object value = s.readObject(); putForCreate(key, value); } }
void putAllForCreate(IntHashMap<V> m) { for (Iterator<Entry<V>> i = m.entrySet().iterator(); i.hasNext();) { Entry<V> e = i.next(); putForCreate(e.getKey(), e.getValue()); } }
/** * Reconstitute the <tt>HashMap</tt> instance from a stream (i.e., deserialize it). * * @param s * @throws IOException * @throws ClassNotFoundException */ @SuppressWarnings("unchecked") private void readObject(final java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { modCount = new AtomicInteger(0); // Read in the threshold, loadfactor, and any hidden stuff s.defaultReadObject(); // Read in number of buckets and allocate the bucket array; int numBuckets = s.readInt(); table = new Entry[numBuckets]; init(); // Give subclass a chance to do its thing. // Read in size (number of Mappings) int size = s.readInt(); // Read the keys and values, and put the mappings in the HashMap for (int i = 0; i < size; i++) { int key = s.readInt(); V value = (V)s.readObject(); putForCreate(key, value); } }
void putAllForCreate(final IntHashMap<V> m) { for (Entry<V> entry : m.entrySet()) { putForCreate(entry.getKey(), entry.getValue()); } }