c902117f87ac85af1fcf461e092fa4da09edfb33
[jalview.git] / src / vamsas / objects / simple / SeqSearchResult.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)\r
3  * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4  * \r
5  * This program is free software; you can redistribute it and/or\r
6  * modify it under the terms of the GNU General Public License\r
7  * as published by the Free Software Foundation; either version 2\r
8  * of the License, or (at your option) any later version.\r
9  * \r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU General Public License for more details.\r
14  * \r
15  * You should have received a copy of the GNU General Public License\r
16  * along with this program; if not, write to the Free Software\r
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
18  */\r
19 package vamsas.objects.simple;\r
20 \r
21 public class SeqSearchResult extends vamsas.objects.simple.Result implements\r
22         java.io.Serializable\r
23 {\r
24   private vamsas.objects.simple.Alignment alignment;\r
25 \r
26   private java.lang.String annotation;\r
27 \r
28   private java.lang.String features;\r
29 \r
30   private java.lang.String newickTree;\r
31 \r
32   public SeqSearchResult()\r
33   {\r
34   }\r
35 \r
36   public SeqSearchResult(vamsas.objects.simple.Alignment alignment,\r
37           java.lang.String annotation, java.lang.String features,\r
38           java.lang.String newickTree)\r
39   {\r
40     this.alignment = alignment;\r
41     this.annotation = annotation;\r
42     this.features = features;\r
43     this.newickTree = newickTree;\r
44   }\r
45 \r
46   /**\r
47    * Gets the alignment value for this SeqSearchResult.\r
48    * \r
49    * @return alignment\r
50    */\r
51   public vamsas.objects.simple.Alignment getAlignment()\r
52   {\r
53     return alignment;\r
54   }\r
55 \r
56   /**\r
57    * Sets the alignment value for this SeqSearchResult.\r
58    * \r
59    * @param alignment\r
60    */\r
61   public void setAlignment(vamsas.objects.simple.Alignment alignment)\r
62   {\r
63     this.alignment = alignment;\r
64   }\r
65 \r
66   /**\r
67    * Gets the annotation value for this SeqSearchResult.\r
68    * \r
69    * @return annotation\r
70    */\r
71   public java.lang.String getAnnotation()\r
72   {\r
73     return annotation;\r
74   }\r
75 \r
76   /**\r
77    * Sets the annotation value for this SeqSearchResult.\r
78    * \r
79    * @param annotation\r
80    */\r
81   public void setAnnotation(java.lang.String annotation)\r
82   {\r
83     this.annotation = annotation;\r
84   }\r
85 \r
86   /**\r
87    * Gets the features value for this SeqSearchResult.\r
88    * \r
89    * @return features\r
90    */\r
91   public java.lang.String getFeatures()\r
92   {\r
93     return features;\r
94   }\r
95 \r
96   /**\r
97    * Sets the features value for this SeqSearchResult.\r
98    * \r
99    * @param features\r
100    */\r
101   public void setFeatures(java.lang.String features)\r
102   {\r
103     this.features = features;\r
104   }\r
105 \r
106   /**\r
107    * Gets the newickTree value for this SeqSearchResult.\r
108    * \r
109    * @return newickTree\r
110    */\r
111   public java.lang.String getNewickTree()\r
112   {\r
113     return newickTree;\r
114   }\r
115 \r
116   /**\r
117    * Sets the newickTree value for this SeqSearchResult.\r
118    * \r
119    * @param newickTree\r
120    */\r
121   public void setNewickTree(java.lang.String newickTree)\r
122   {\r
123     this.newickTree = newickTree;\r
124   }\r
125 \r
126   private java.lang.Object __equalsCalc = null;\r
127 \r
128   public synchronized boolean equals(java.lang.Object obj)\r
129   {\r
130     if (!(obj instanceof SeqSearchResult))\r
131       return false;\r
132     SeqSearchResult other = (SeqSearchResult) obj;\r
133     if (obj == null)\r
134       return false;\r
135     if (this == obj)\r
136       return true;\r
137     if (__equalsCalc != null)\r
138     {\r
139       return (__equalsCalc == obj);\r
140     }\r
141     __equalsCalc = obj;\r
142     boolean _equals;\r
143     _equals = super.equals(obj)\r
144             && ((this.alignment == null && other.getAlignment() == null) || (this.alignment != null && this.alignment\r
145                     .equals(other.getAlignment())))\r
146             && ((this.annotation == null && other.getAnnotation() == null) || (this.annotation != null && this.annotation\r
147                     .equals(other.getAnnotation())))\r
148             && ((this.features == null && other.getFeatures() == null) || (this.features != null && this.features\r
149                     .equals(other.getFeatures())))\r
150             && ((this.newickTree == null && other.getNewickTree() == null) || (this.newickTree != null && this.newickTree\r
151                     .equals(other.getNewickTree())));\r
152     __equalsCalc = null;\r
153     return _equals;\r
154   }\r
155 \r
156   private boolean __hashCodeCalc = false;\r
157 \r
158   public synchronized int hashCode()\r
159   {\r
160     if (__hashCodeCalc)\r
161     {\r
162       return 0;\r
163     }\r
164     __hashCodeCalc = true;\r
165     int _hashCode = super.hashCode();\r
166     if (getAlignment() != null)\r
167     {\r
168       _hashCode += getAlignment().hashCode();\r
169     }\r
170     if (getAnnotation() != null)\r
171     {\r
172       _hashCode += getAnnotation().hashCode();\r
173     }\r
174     if (getFeatures() != null)\r
175     {\r
176       _hashCode += getFeatures().hashCode();\r
177     }\r
178     if (getNewickTree() != null)\r
179     {\r
180       _hashCode += getNewickTree().hashCode();\r
181     }\r
182     __hashCodeCalc = false;\r
183     return _hashCode;\r
184   }\r
185 \r
186 }\r