diff options
| author | Bdale Garbee <bdale@gag.com> | 2018-10-08 17:49:47 -0600 |
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2018-10-08 17:49:47 -0600 |
| commit | 34658a1236e34891b41a0a51a480717db98779e7 (patch) | |
| tree | 1e29cdc000c50e4f01e5c54aa69befd8e6919524 /altosuilib/AltosUSBDevice.java | |
| parent | 3a2a5a05bb6372d9003905cee7afdfcd6d38ae7e (diff) | |
| parent | 88ae4c5ebd64215f05f5efc18f9660560b409ace (diff) | |
Merge branch 'master' into branch-1.8
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; |
