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
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 of the License, or (at your option) any later version.
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.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package vamsas.objects.simple;
20 public class Alignment extends vamsas.objects.simple.Object implements
23 private java.lang.String gapchar;
25 private java.lang.String[] method;
27 private vamsas.objects.simple.SequenceSet seqs;
33 public Alignment(java.lang.String gapchar, java.lang.String[] method,
34 vamsas.objects.simple.SequenceSet seqs)
36 this.gapchar = gapchar;
42 * Gets the gapchar value for this Alignment.
46 public java.lang.String getGapchar()
52 * Sets the gapchar value for this Alignment.
56 public void setGapchar(java.lang.String gapchar)
58 this.gapchar = gapchar;
62 * Gets the method value for this Alignment.
66 public java.lang.String[] getMethod()
72 * Sets the method value for this Alignment.
76 public void setMethod(java.lang.String[] method)
82 * Gets the seqs value for this Alignment.
86 public vamsas.objects.simple.SequenceSet getSeqs()
92 * Sets the seqs value for this Alignment.
96 public void setSeqs(vamsas.objects.simple.SequenceSet seqs)
101 private java.lang.Object __equalsCalc = null;
103 public synchronized boolean equals(java.lang.Object obj)
105 if (!(obj instanceof Alignment))
107 Alignment other = (Alignment) obj;
112 if (__equalsCalc != null)
114 return (__equalsCalc == obj);
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())));
129 private boolean __hashCodeCalc = false;
131 public synchronized int hashCode()
137 __hashCodeCalc = true;
138 int _hashCode = super.hashCode();
139 if (getGapchar() != null)
141 _hashCode += getGapchar().hashCode();
143 if (getMethod() != null)
145 for (int i = 0; i < java.lang.reflect.Array.getLength(getMethod()); i++)
147 java.lang.Object obj = java.lang.reflect.Array.get(getMethod(), i);
148 if (obj != null && !obj.getClass().isArray())
150 _hashCode += obj.hashCode();
154 if (getSeqs() != null)
156 _hashCode += getSeqs().hashCode();
158 __hashCodeCalc = false;