allows for null Jmol viewer
[jalview.git] / src2 / fr / orsay / lri / varna / applications / templateEditor / Couple.java
1 package fr.orsay.lri.varna.applications.templateEditor;
2
3
4 public class Couple<T,U> {
5         public T first;
6         public U second;
7         private static final int HASH_PRIME = 1000003;
8     
9         
10         public Couple(T a, U b)
11         {
12                 first = a;
13                 second = b;
14         }
15
16         public boolean equals( Object c)
17         {
18                 if (!(c instanceof Couple))
19                 {
20                         return false;
21                 }
22                 Couple<T,U> cc = (Couple<T,U>) c; 
23                 return (cc.first.equals(first) && (cc.second.equals(second)));
24         }
25
26         public int hashCode()
27         {
28                 return HASH_PRIME*first.hashCode()+second.hashCode();
29         }
30         
31         public String toString()
32         {
33                 return "("+first+","+second+")";
34         }
35 }