2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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 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/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package vamsas.objects.simple;
21 public class Alignment extends vamsas.objects.simple.Object implements
24 private java.lang.String gapchar;
26 private java.lang.String[] method;
28 private vamsas.objects.simple.SequenceSet seqs;
34 public Alignment(java.lang.String gapchar, java.lang.String[] method,
35 vamsas.objects.simple.SequenceSet seqs)
37 this.gapchar = gapchar;
43 * Gets the gapchar value for this Alignment.
47 public java.lang.String getGapchar()
53 * Sets the gapchar value for this Alignment.
57 public void setGapchar(java.lang.String gapchar)
59 this.gapchar = gapchar;
63 * Gets the method value for this Alignment.
67 public java.lang.String[] getMethod()
73 * Sets the method value for this Alignment.
77 public void setMethod(java.lang.String[] method)
83 * Gets the seqs value for this Alignment.
87 public vamsas.objects.simple.SequenceSet getSeqs()
93 * Sets the seqs value for this Alignment.
97 public void setSeqs(vamsas.objects.simple.SequenceSet seqs)
102 private java.lang.Object __equalsCalc = null;
104 public synchronized boolean equals(java.lang.Object obj)
106 if (!(obj instanceof Alignment))
108 Alignment other = (Alignment) obj;
113 if (__equalsCalc != null)
115 return (__equalsCalc == obj);
119 _equals = super.equals(obj)
120 && ((this.gapchar == null && other.getGapchar() == null) || (this.gapchar != null && this.gapchar
121 .equals(other.getGapchar())))
122 && ((this.method == null && other.getMethod() == null) || (this.method != null && java.util.Arrays
123 .equals(this.method, other.getMethod())))
124 && ((this.seqs == null && other.getSeqs() == null) || (this.seqs != null && this.seqs
125 .equals(other.getSeqs())));
130 private boolean __hashCodeCalc = false;
132 public synchronized int hashCode()
138 __hashCodeCalc = true;
139 int _hashCode = super.hashCode();
140 if (getGapchar() != null)
142 _hashCode += getGapchar().hashCode();
144 if (getMethod() != null)
146 for (int i = 0; i < java.lang.reflect.Array.getLength(getMethod()); i++)
148 java.lang.Object obj = java.lang.reflect.Array.get(getMethod(), i);
149 if (obj != null && !obj.getClass().isArray())
151 _hashCode += obj.hashCode();
155 if (getSeqs() != null)
157 _hashCode += getSeqs().hashCode();
159 __hashCodeCalc = false;