X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=altoslib%2FAltosPointDouble.java;h=a358ea66db118e4ab7b230585c94f7b28386add0;hb=73ce3f73526edfabccd3b98e6e67de6d82a84b63;hp=4a94067646ff29c0c2fbb1d60bf36b8fe7c504cf;hpb=cb23b992be8ba40c97d8988c134a814a13ccd58c;p=fw%2Faltos diff --git a/altoslib/AltosPointDouble.java b/altoslib/AltosPointDouble.java index 4a940676..a358ea66 100644 --- a/altoslib/AltosPointDouble.java +++ b/altoslib/AltosPointDouble.java @@ -15,12 +15,24 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_7; +package org.altusmetrum.altoslib_9; public class AltosPointDouble { public double x, y; - public boolean equals(AltosPointDouble n) { + public int hashCode() { + return new Double(x).hashCode() ^ new Double(y).hashCode(); + } + + public boolean equals(Object o) { + if (o == null) + return false; + + if (!(o instanceof AltosPointDouble)) + return false; + + AltosPointDouble n = (AltosPointDouble) o; + return n.x == x && n.y == y; }