2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 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 implements
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;
106 public synchronized boolean equals(java.lang.Object obj)
108 if (!(obj instanceof Alignment))
110 Alignment other = (Alignment) obj;
115 if (__equalsCalc != null)
117 return (__equalsCalc == obj);
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())));
132 private boolean __hashCodeCalc = false;
134 public synchronized int hashCode()
140 __hashCodeCalc = true;
141 int _hashCode = super.hashCode();
142 if (getGapchar() != null)
144 _hashCode += getGapchar().hashCode();
146 if (getMethod() != null)
148 for (int i = 0; i < java.lang.reflect.Array.getLength(getMethod()); i++)
150 java.lang.Object obj = java.lang.reflect.Array.get(getMethod(), i);
151 if (obj != null && !obj.getClass().isArray())
153 _hashCode += obj.hashCode();
157 if (getSeqs() != null)
159 _hashCode += getSeqs().hashCode();
161 __hashCodeCalc = false;