JAL-3026 srcjar files for VARNA and log4j
[jalview.git] / srcjar / fr / orsay / lri / varna / applications / templateEditor / Couple.java
diff --git a/srcjar/fr/orsay/lri/varna/applications/templateEditor/Couple.java b/srcjar/fr/orsay/lri/varna/applications/templateEditor/Couple.java
new file mode 100644 (file)
index 0000000..2f60b01
--- /dev/null
@@ -0,0 +1,35 @@
+package fr.orsay.lri.varna.applications.templateEditor;
+
+
+public class Couple<T,U> {
+       public T first;
+       public U second;
+       private static final int HASH_PRIME = 1000003;
+    
+       
+       public Couple(T a, U b)
+       {
+               first = a;
+               second = b;
+       }
+
+       public boolean equals( Object c)
+       {
+               if (!(c instanceof Couple))
+               {
+                       return false;
+               }
+               Couple<T,U> cc = (Couple<T,U>) c; 
+               return (cc.first.equals(first) && (cc.second.equals(second)));
+       }
+
+       public int hashCode()
+       {
+               return HASH_PRIME*first.hashCode()+second.hashCode();
+       }
+       
+       public String toString()
+       {
+               return "("+first+","+second+")";
+       }
+}