JAL-1620 version bump and release notes
[jalview.git] / src / vamsas / objects / simple / Alignment.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
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
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 Alignment extends vamsas.objects.simple.Object implements
24         java.io.Serializable
25 {
26   private java.lang.String gapchar;
27
28   private java.lang.String[] method;
29
30   private vamsas.objects.simple.SequenceSet seqs;
31
32   public Alignment()
33   {
34   }
35
36   public Alignment(java.lang.String gapchar, java.lang.String[] method,
37           vamsas.objects.simple.SequenceSet seqs)
38   {
39     this.gapchar = gapchar;
40     this.method = method;
41     this.seqs = seqs;
42   }
43
44   /**
45    * Gets the gapchar value for this Alignment.
46    * 
47    * @return gapchar
48    */
49   public java.lang.String getGapchar()
50   {
51     return gapchar;
52   }
53
54   /**
55    * Sets the gapchar value for this Alignment.
56    * 
57    * @param gapchar
58    */
59   public void setGapchar(java.lang.String gapchar)
60   {
61     this.gapchar = gapchar;
62   }
63
64   /**
65    * Gets the method value for this Alignment.
66    * 
67    * @return method
68    */
69   public java.lang.String[] getMethod()
70   {
71     return method;
72   }
73
74   /**
75    * Sets the method value for this Alignment.
76    * 
77    * @param method
78    */
79   public void setMethod(java.lang.String[] method)
80   {
81     this.method = method;
82   }
83
84   /**
85    * Gets the seqs value for this Alignment.
86    * 
87    * @return seqs
88    */
89   public vamsas.objects.simple.SequenceSet getSeqs()
90   {
91     return seqs;
92   }
93
94   /**
95    * Sets the seqs value for this Alignment.
96    * 
97    * @param seqs
98    */
99   public void setSeqs(vamsas.objects.simple.SequenceSet seqs)
100   {
101     this.seqs = seqs;
102   }
103
104   private java.lang.Object __equalsCalc = null;
105
106   public synchronized boolean equals(java.lang.Object obj)
107   {
108     if (!(obj instanceof Alignment))
109       return false;
110     Alignment other = (Alignment) obj;
111     if (obj == null)
112       return false;
113     if (this == obj)
114       return true;
115     if (__equalsCalc != null)
116     {
117       return (__equalsCalc == obj);
118     }
119     __equalsCalc = obj;
120     boolean _equals;
121     _equals = super.equals(obj)
122             && ((this.gapchar == null && other.getGapchar() == null) || (this.gapchar != null && this.gapchar
123                     .equals(other.getGapchar())))
124             && ((this.method == null && other.getMethod() == null) || (this.method != null && java.util.Arrays
125                     .equals(this.method, other.getMethod())))
126             && ((this.seqs == null && other.getSeqs() == null) || (this.seqs != null && this.seqs
127                     .equals(other.getSeqs())));
128     __equalsCalc = null;
129     return _equals;
130   }
131
132   private boolean __hashCodeCalc = false;
133
134   public synchronized int hashCode()
135   {
136     if (__hashCodeCalc)
137     {
138       return 0;
139     }
140     __hashCodeCalc = true;
141     int _hashCode = super.hashCode();
142     if (getGapchar() != null)
143     {
144       _hashCode += getGapchar().hashCode();
145     }
146     if (getMethod() != null)
147     {
148       for (int i = 0; i < java.lang.reflect.Array.getLength(getMethod()); i++)
149       {
150         java.lang.Object obj = java.lang.reflect.Array.get(getMethod(), i);
151         if (obj != null && !obj.getClass().isArray())
152         {
153           _hashCode += obj.hashCode();
154         }
155       }
156     }
157     if (getSeqs() != null)
158     {
159       _hashCode += getSeqs().hashCode();
160     }
161     __hashCodeCalc = false;
162     return _hashCode;
163   }
164
165 }