JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / src / vamsas / objects / simple / MsaResult.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
3  * Copyright (C) 2015 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
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package vamsas.objects.simple;
22
23 public class MsaResult extends vamsas.objects.simple.Result implements
24         java.io.Serializable
25 {
26   private vamsas.objects.simple.Alignment msa;
27
28   private java.lang.Object __equalsCalc = null;
29
30   private boolean __hashCodeCalc = false;
31
32   public MsaResult()
33   {
34   }
35
36   public MsaResult(vamsas.objects.simple.Alignment msa)
37   {
38     this.msa = msa;
39   }
40
41   /**
42    * Gets the msa value for this MsaResult.
43    * 
44    * @return msa
45    */
46   public vamsas.objects.simple.Alignment getMsa()
47   {
48     return msa;
49   }
50
51   /**
52    * Sets the msa value for this MsaResult.
53    * 
54    * @param msa
55    */
56   public void setMsa(vamsas.objects.simple.Alignment msa)
57   {
58     this.msa = msa;
59   }
60
61   @Override
62   public synchronized boolean equals(java.lang.Object obj)
63   {
64     if (obj == null)
65     {
66       return false;
67     }
68     if (!(obj instanceof MsaResult))
69     {
70       return false;
71     }
72
73     MsaResult other = (MsaResult) obj;
74
75     if (this == obj)
76     {
77       return true;
78     }
79
80     if (__equalsCalc != null)
81     {
82       return (__equalsCalc == obj);
83     }
84
85     __equalsCalc = obj;
86
87     boolean _equals;
88     _equals = super.equals(obj)
89             && (((this.msa == null) && (other.getMsa() == null)) || ((this.msa != null) && this.msa
90                     .equals(other.getMsa())));
91     __equalsCalc = null;
92
93     return _equals;
94   }
95
96   @Override
97   public synchronized int hashCode()
98   {
99     if (__hashCodeCalc)
100     {
101       return 0;
102     }
103
104     __hashCodeCalc = true;
105
106     int _hashCode = super.hashCode();
107
108     if (getMsa() != null)
109     {
110       _hashCode += getMsa().hashCode();
111     }
112
113     __hashCodeCalc = false;
114
115     return _hashCode;
116   }
117 }