/** * initializes the keys and values of this hash table. * * @param initialCapacity * an <code>int</code> value * @return an <code>int</code> value */ @Override protected int setUp(int initialCapacity) { final int capacity = super.setUp(initialCapacity); _set2 = new Object[capacity]; return capacity; }
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); int size = stream.readInt(); setUp(size); while (size-- > 0) { Object key = stream.readObject(); Object val = stream.readObject(); put(key, val); } }