/** * Save the state of the <tt>HashMap</tt> instance to a stream (i.e., * serialize it). * * @serialData The <i>capacity</i> of the HashMap (the length of the * bucket array) is emitted (int), followed by the * <i>ss</i> of the HashMap (the number of key-value * mappings), followed by the key (Object) and value (Object) * for each key-value mapping represented by the HashMap * The key-value mappings are emitted in the order that they * are returned by <tt>entrySet().iterator()</tt>. */ private void writeObject(final java.io.ObjectOutputStream s) throws IOException { final Iterator<Map.Entry<K, V>> i = entrySet().iterator(); // Write out the threshold, loadfactor, and any hidden stuff s.defaultWriteObject(); // Write out number of buckets s.writeInt(table.length); // Write out ss (number of Mappings) s.writeInt(size); // Write out keys and values (alternating) while (i.hasNext()) { final Map.Entry<K, V> e = i.next(); s.writeObject(e.getKey()); s.writeObject(e.getValue()); } }
/** * Save the state of the <tt>HashMap</tt> instance to a stream (i.e., * serialize it). * * @serialData The <i>capacity</i> of the HashMap (the length of the * bucket array) is emitted (int), followed by the * <i>ss</i> of the HashMap (the number of key-value * mappings), followed by the key (Object) and value (Object) * for each key-value mapping represented by the HashMap * The key-value mappings are emitted in the order that they * are returned by <tt>entrySet().iterator()</tt>. */ private void writeObject(final java.io.ObjectOutputStream s) throws IOException { final Iterator<Map.Entry<K, V>> i = entrySet().iterator(); // Write out the threshold, loadfactor, and any hidden stuff s.defaultWriteObject(); // Write out number of buckets s.writeInt(table.length); // Write out ss (number of Mappings) s.writeInt(size); // Write out keys and values (alternating) while (i.hasNext()) { final Map.Entry<K, V> e = i.next(); s.writeObject(e.getKey()); s.writeObject(e.getValue()); } }
/** * Save the state of the <tt>HashMap</tt> instance to a stream (i.e., * serialize it). * * @serialData The <i>capacity</i> of the HashMap (the length of the * bucket array) is emitted (int), followed by the * <i>ss</i> of the HashMap (the number of key-value * mappings), followed by the key (Object) and value (Object) * for each key-value mapping represented by the HashMap * The key-value mappings are emitted in the order that they * are returned by <tt>entrySet().iterator()</tt>. */ private void writeObject(final java.io.ObjectOutputStream s) throws IOException { final Iterator<Map.Entry<K, V>> i = entrySet().iterator(); // Write out the threshold, loadfactor, and any hidden stuff s.defaultWriteObject(); // Write out number of buckets s.writeInt(table.length); // Write out ss (number of Mappings) s.writeInt(size); // Write out keys and values (alternating) while (i.hasNext()) { final Map.Entry<K, V> e = i.next(); s.writeObject(e.getKey()); s.writeObject(e.getValue()); } }
/** * Save the state of the <tt>HashMap</tt> instance to a stream (i.e., * serialize it). * * @serialData The <i>capacity</i> of the HashMap (the length of the * bucket array) is emitted (int), followed by the * <i>ss</i> of the HashMap (the number of key-value * mappings), followed by the key (Object) and value (Object) * for each key-value mapping represented by the HashMap * The key-value mappings are emitted in the order that they * are returned by <tt>entrySet().iterator()</tt>. */ private void writeObject(final java.io.ObjectOutputStream s) throws IOException { final Iterator<Map.Entry<K, V>> i = entrySet().iterator(); // Write out the threshold, loadfactor, and any hidden stuff s.defaultWriteObject(); // Write out number of buckets s.writeInt(table.length); // Write out ss (number of Mappings) s.writeInt(size); // Write out keys and values (alternating) while (i.hasNext()) { final Map.Entry<K, V> e = i.next(); s.writeObject(e.getKey()); s.writeObject(e.getValue()); } }
/** * Save the state of the <tt>HashMap</tt> instance to a stream (i.e., * serialize it). * * @serialData The <i>capacity</i> of the HashMap (the length of the * bucket array) is emitted (int), followed by the * <i>ss</i> of the HashMap (the number of key-value * mappings), followed by the key (Object) and value (Object) * for each key-value mapping represented by the HashMap * The key-value mappings are emitted in the order that they * are returned by <tt>entrySet().iterator()</tt>. */ private void writeObject(final java.io.ObjectOutputStream s) throws IOException { final Iterator<Map.Entry<K, V>> i = entrySet().iterator(); // Write out the threshold, loadfactor, and any hidden stuff s.defaultWriteObject(); // Write out number of buckets s.writeInt(table.length); // Write out ss (number of Mappings) s.writeInt(size); // Write out keys and values (alternating) while (i.hasNext()) { final Map.Entry<K, V> e = i.next(); s.writeObject(e.getKey()); s.writeObject(e.getValue()); } }
/** * Save the state of the <tt>HashMap</tt> instance to a stream (i.e., * serialize it). * * @serialData The <i>capacity</i> of the HashMap (the length of the * bucket array) is emitted (int), followed by the * <i>ss</i> of the HashMap (the number of key-value * mappings), followed by the key (Object) and value (Object) * for each key-value mapping represented by the HashMap * The key-value mappings are emitted in the order that they * are returned by <tt>entrySet().iterator()</tt>. */ private void writeObject(final java.io.ObjectOutputStream s) throws IOException { final Iterator<Map.Entry<K, V>> i = entrySet().iterator(); // Write out the threshold, loadfactor, and any hidden stuff s.defaultWriteObject(); // Write out number of buckets s.writeInt(table.length); // Write out ss (number of Mappings) s.writeInt(size); // Write out keys and values (alternating) while (i.hasNext()) { final Map.Entry<K, V> e = i.next(); s.writeObject(e.getKey()); s.writeObject(e.getValue()); } }
/** * Save the state of the <tt>HashMap</tt> instance to a stream (i.e., * serialize it). * * @serialData The <i>capacity</i> of the HashMap (the length of the * bucket array) is emitted (int), followed by the * <i>ss</i> of the HashMap (the number of key-value * mappings), followed by the key (Object) and value (Object) * for each key-value mapping represented by the HashMap * The key-value mappings are emitted in the order that they * are returned by <tt>entrySet().iterator()</tt>. */ private void writeObject(final java.io.ObjectOutputStream s) throws IOException { final Iterator<Map.Entry<K, V>> i = entrySet().iterator(); // Write out the threshold, loadfactor, and any hidden stuff s.defaultWriteObject(); // Write out number of buckets s.writeInt(table.length); // Write out ss (number of Mappings) s.writeInt(size); // Write out keys and values (alternating) while (i.hasNext()) { final Map.Entry<K, V> e = i.next(); s.writeObject(e.getKey()); s.writeObject(e.getValue()); } }