X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosuilib%2FAltosScanUI.java;fp=altosuilib%2FAltosScanUI.java;h=fccfbaee284703d4b7e6d727c5e55f3c052758c8;hp=031158243e69de010d475e14be13f801244c1847;hb=0cc03210d5d53d12604688f294b6ca39e3a025de;hpb=5568c30f0a4fe346b8ed58934c23653064427d65 diff --git a/altosuilib/AltosScanUI.java b/altosuilib/AltosScanUI.java index 03115824..fccfbaee 100644 --- a/altosuilib/AltosScanUI.java +++ b/altosuilib/AltosScanUI.java @@ -62,9 +62,18 @@ class AltosScanResult { rate = in_rate; } - public boolean equals(AltosScanResult other) { + public int hashCode() { + return serial ^ frequency.hashCode() ^ telemetry ^ rate; + } + + public boolean equals(Object o) { + if (o == null) + return false; + if (!(o instanceof AltosScanResult)) + return false; + AltosScanResult other = (AltosScanResult) o; return (serial == other.serial && - frequency.frequency == other.frequency.frequency && + frequency.equals(other.frequency) && telemetry == other.telemetry && rate == other.rate); }