X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosuilib%2FAltosUSBDevice.java;h=f43d6befda46e57ec9ee26f0d105452308afe9b9;hb=ff5faf1cc710b7e9299dcaec719bc2421f4ca5b4;hp=49f966f330b56e9f7c3f7fc53bc3dd9c0a161c2c;hpb=c8dbcaf69cd538a31ab6e2b568237ae7c8656a9a;p=fw%2Faltos 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 list(int product) { if (!AltosUILib.load_library()) return null;