private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); // number of entries stream.writeInt(_size); SerializationProcedure writeProcedure = new SerializationProcedure(stream); if (! forEach(writeProcedure)) { throw writeProcedure.exception; } }
/** * Compares this set with another set for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean equals(Object other) { if (! (other instanceof TDoubleHashSet)) { return false; } final TDoubleHashSet that = (TDoubleHashSet)other; if (that.size() != this.size()) { return false; } return forEach(new TDoubleProcedure() { public final boolean execute(double value) { return that.contains(value); } }); }