public double frequency;
public String description;
+ public int hashCode() {
+ return new Double(frequency).hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (o == null)
+ return false;
+ if (!(o instanceof AltosFrequency))
+ return false;
+ AltosFrequency other = (AltosFrequency) o;
+ return other.frequency == frequency;
+ }
+
public String toString() {
return String.format("%7.3f MHz %-20s",
frequency, description);
public double lat;
public double lon;
- public boolean equals(AltosLatLon other) {
- if (other == null)
+ public int hashCode() {
+ return new Double(lat).hashCode() ^ new Double(lon).hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (o == null)
return false;
+ if (!(o instanceof AltosLatLon))
+ return false;
+
+ AltosLatLon other = (AltosLatLon) o;
return lat == other.lat && lon == other.lon;
}
public AltosLatLon lat_lon;
public int state;
- public boolean equals(AltosMapPathPoint other) {
- if (other == null)
+ public int hashCode() {
+ return lat_lon.hashCode() ^ state;
+ }
+
+ public boolean equals(Object o) {
+ if (o == null)
return false;
+ if (!(o instanceof AltosMapPathPoint))
+ return false;
+
+ AltosMapPathPoint other = (AltosMapPathPoint) o;
+
return lat_lon.equals(other.lat_lon) && state == other.state;
}
}
}
- public boolean equals(AltosMapStore other) {
+ public int hashCode() {
+ return url.hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (o == null)
+ return false;
+
+ if (!(o instanceof AltosMapStore))
+ return false;
+
+ AltosMapStore other = (AltosMapStore) o;
return url.equals(other.url);
}
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;
}
public class AltosPointInt {
public int x, y;
- public boolean equals(AltosPointInt n) {
+ public int hashCode() {
+ return x ^ y;
+ }
+
+ public boolean equals(Object o) {
+ if (o == null)
+ return false;
+
+ if (!(o instanceof AltosPointInt))
+ return false;
+
+ AltosPointInt n = (AltosPointInt) o;
+
return n.x == x && n.y == y;
}
return false;
}
+ public int hashCode() {
+ return getName().hashCode() ^ getAddr().hashCode();
+ }
+
public boolean equals(Object o) {
+ if (o == null)
+ return false;
+
if (!(o instanceof AltosBTDevice))
return false;
AltosBTDevice other = (AltosBTDevice) o;
return getName().equals(other.getName()) && getAddr().equals(other.getAddr());
}
- public int hashCode() {
- return getName().hashCode() ^ getAddr().hashCode();
- }
-
public AltosBTDevice(String name, String addr) {
AltosUILib.load_library();
libaltos.altos_bt_fill_in(name, addr,this);
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);
}