JAL-1432 updated copyright notices
[jalview.git] / src / vamsas / objects / simple / MsaResult.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
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  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 /*
20  * Jalview - A Sequence Alignment Editor and Viewer
21  * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
22  *
23  * This program is free software; you can redistribute it and/or
24  * modify it under the terms of the GNU General Public License
25  * as published by the Free Software Foundation; either version 2
26  * of the License, or (at your option) any later version.
27  *
28  * This program is distributed in the hope that it will be useful,
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31  * GNU General Public License for more details.
32  *
33  * You should have received a copy of the GNU General Public License
34  * along with this program; if not, write to the Free Software
35  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
36  */
37 package vamsas.objects.simple;
38
39 public class MsaResult extends vamsas.objects.simple.Result implements
40         java.io.Serializable
41 {
42   private vamsas.objects.simple.Alignment msa;
43
44   private java.lang.Object __equalsCalc = null;
45
46   private boolean __hashCodeCalc = false;
47
48   public MsaResult()
49   {
50   }
51
52   public MsaResult(vamsas.objects.simple.Alignment msa)
53   {
54     this.msa = msa;
55   }
56
57   /**
58    * Gets the msa value for this MsaResult.
59    * 
60    * @return msa
61    */
62   public vamsas.objects.simple.Alignment getMsa()
63   {
64     return msa;
65   }
66
67   /**
68    * Sets the msa value for this MsaResult.
69    * 
70    * @param msa
71    */
72   public void setMsa(vamsas.objects.simple.Alignment msa)
73   {
74     this.msa = msa;
75   }
76
77   public synchronized boolean equals(java.lang.Object obj)
78   {
79     if (!(obj instanceof MsaResult))
80     {
81       return false;
82     }
83
84     MsaResult other = (MsaResult) obj;
85
86     if (obj == null)
87     {
88       return false;
89     }
90
91     if (this == obj)
92     {
93       return true;
94     }
95
96     if (__equalsCalc != null)
97     {
98       return (__equalsCalc == obj);
99     }
100
101     __equalsCalc = obj;
102
103     boolean _equals;
104     _equals = super.equals(obj)
105             && (((this.msa == null) && (other.getMsa() == null)) || ((this.msa != null) && this.msa
106                     .equals(other.getMsa())));
107     __equalsCalc = null;
108
109     return _equals;
110   }
111
112   public synchronized int hashCode()
113   {
114     if (__hashCodeCalc)
115     {
116       return 0;
117     }
118
119     __hashCodeCalc = true;
120
121     int _hashCode = super.hashCode();
122
123     if (getMsa() != null)
124     {
125       _hashCode += getMsa().hashCode();
126     }
127
128     __hashCodeCalc = false;
129
130     return _hashCode;
131   }
132 }