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