/** {@inheritDoc} */ @Override public void clear() { super.clear(); _set.clear(); _values.clear(); _states.clear(); }
/** {@inheritDoc} */ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // VERSION in.readByte(); // SUPER super.readExternal(in); // NUMBER OF ENTRIES int size = in.readInt(); setUp(size); // ENTRIES while (size-- > 0) { char key = in.readChar(); char val = in.readChar(); put(key, val); } }
/** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { // VERSION out.writeByte(0); // SUPER super.writeExternal(out); // NUMBER OF ENTRIES out.writeInt(_size); // ENTRIES for (int i = capacity(); i-- > 0; ) { if (_states.get(i) == FULL) { out.writeChar(_set.get(i)); out.writeChar(_values.get(i)); } } }
/** {@inheritDoc} */ @Override protected void removeAt(int index) { _values.put(index, no_entry_value); super.removeAt(index); // clear key, state; adjust size }