}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
int size = in.readInt();
MutableDoubleBag deserializedBag = new DoubleHashBag();
for (int i = 0; i < size; i++)
{
deserializedBag.addOccurrences(in.readDouble(), in.readInt());
}
this.bag = deserializedBag;
}