Example #1
0
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    in.readByte();

    super.readExternal(in);

    int size = in.readInt();
    setUp(size);
    while (size-- > 0) {
      char key = in.readChar();
      short val = in.readShort();
      put(key, val);
    }
  }
Example #2
0
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeByte(0);

    super.writeExternal(out);

    out.writeInt(this._size);
    for (int i = this._states.length; i-- > 0; ) {
      if (this._states[i] == 1) {
        out.writeChar(this._set[i]);
        out.writeShort(this._values[i]);
      }
    }
  }
Example #3
0
 protected void removeAt(int index) {
   this._values[index] = this.no_entry_value;
   super.removeAt(index);
 }
Example #4
0
 public void clear() {
   super.clear();
   Arrays.fill(this._set, 0, this._set.length, this.no_entry_key);
   Arrays.fill(this._values, 0, this._values.length, this.no_entry_value);
   Arrays.fill(this._states, 0, this._states.length, (byte) 0);
 }