コード例 #1
0
 /** {@inheritDoc} */
 @Override
 public void clear() {
   super.clear();
   _set.clear();
   _values.clear();
   _states.clear();
 }
コード例 #2
0
  /** {@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);
    }
  }
コード例 #3
0
  /** {@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));
      }
    }
  }
コード例 #4
0
 /** {@inheritDoc} */
 @Override
 protected void removeAt(int index) {
   _values.put(index, no_entry_value);
   super.removeAt(index); // clear key, state; adjust size
 }