2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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.
21 package vamsas.objects.simple;
23 public class Alignment extends vamsas.objects.simple.Object
24 implements java.io.Serializable
26 private java.lang.String gapchar;
28 private java.lang.String[] method;
30 private vamsas.objects.simple.SequenceSet seqs;
36 public Alignment(java.lang.String gapchar, java.lang.String[] method,
37 vamsas.objects.simple.SequenceSet seqs)
39 this.gapchar = gapchar;
45 * Gets the gapchar value for this Alignment.
49 public java.lang.String getGapchar()
55 * Sets the gapchar value for this Alignment.
59 public void setGapchar(java.lang.String gapchar)
61 this.gapchar = gapchar;
65 * Gets the method value for this Alignment.
69 public java.lang.String[] getMethod()
75 * Sets the method value for this Alignment.
79 public void setMethod(java.lang.String[] method)
85 * Gets the seqs value for this Alignment.
89 public vamsas.objects.simple.SequenceSet getSeqs()
95 * Sets the seqs value for this Alignment.
99 public void setSeqs(vamsas.objects.simple.SequenceSet seqs)
104 private java.lang.Object __equalsCalc = null;
107 public synchronized boolean equals(java.lang.Object obj)
113 if (!(obj instanceof Alignment))
117 Alignment other = (Alignment) obj;
122 if (__equalsCalc != null)
124 return (__equalsCalc == obj);
128 _equals = super.equals(obj)
129 && ((this.gapchar == null && other.getGapchar() == null)
130 || (this.gapchar != null
131 && this.gapchar.equals(other.getGapchar())))
132 && ((this.method == null && other.getMethod() == null)
133 || (this.method != null && java.util.Arrays
134 .equals(this.method, other.getMethod())))
135 && ((this.seqs == null && other.getSeqs() == null)
136 || (this.seqs != null
137 && this.seqs.equals(other.getSeqs())));
142 private boolean __hashCodeCalc = false;
145 public synchronized int hashCode()
151 __hashCodeCalc = true;
152 int _hashCode = super.hashCode();
153 if (getGapchar() != null)
155 _hashCode += getGapchar().hashCode();
157 if (getMethod() != null)
159 for (int i = 0; i < java.lang.reflect.Array
160 .getLength(getMethod()); i++)
162 java.lang.Object obj = java.lang.reflect.Array.get(getMethod(), i);
163 if (obj != null && !obj.getClass().isArray())
165 _hashCode += obj.hashCode();
169 if (getSeqs() != null)
171 _hashCode += getSeqs().hashCode();
173 __hashCodeCalc = false;