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