diff options
author | Bdale Garbee <bdale@gag.com> | 2018-10-08 17:52:22 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2018-10-08 17:52:22 -0600 |
commit | 2450e69d3afd3345a6e5f7ca133d929fbdcfdf53 (patch) | |
tree | c04aa34bdecbf909dbeea8854390364bf140e7ca /altosuilib/AltosUSBDevice.java | |
parent | 449ed72371f80f03dcc5dcf66af5c9465e7ed57e (diff) | |
parent | 5a86ff43a2b4a90dbddc1bba48019626e1b83e10 (diff) |
Merge branch 'branch-1.8' into debian
Diffstat (limited to 'altosuilib/AltosUSBDevice.java')
-rw-r--r-- | altosuilib/AltosUSBDevice.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/altosuilib/AltosUSBDevice.java b/altosuilib/AltosUSBDevice.java index 49f966f3..f43d6bef 100644 --- a/altosuilib/AltosUSBDevice.java +++ b/altosuilib/AltosUSBDevice.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_12; +package org.altusmetrum.altosuilib_13; import java.util.*; import libaltosJNI.*; @@ -94,6 +94,24 @@ public class AltosUSBDevice extends altos_device implements AltosDevice { return false; } + public int hashCode() { + return getVendor() ^ getProduct() ^ getSerial() ^ getPath().hashCode(); + } + + public boolean equals(Object o) { + if (o == null) + return false; + + if (!(o instanceof AltosUSBDevice)) + return false; + AltosUSBDevice other = (AltosUSBDevice) o; + + return getVendor() == other.getVendor() && + getProduct() == other.getProduct() && + getSerial() == other.getSerial() && + getPath().equals(other.getPath()); + } + static public java.util.List<AltosDevice> list(int product) { if (!AltosUILib.load_library()) return null; |