Formatted source
[jalview.git] / src / vamsas / objects / simple / Alignment.java
1 /**
2  * Alignment.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.2RC2 Nov 16, 2004 (12:19:44 EST) WSDL2Java emitter.
6  */\r
7 \r
8 /*
9 * Jalview - A Sequence Alignment Editor and Viewer
10 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
25 */\r
26 package vamsas.objects.simple;\r
27 \r
28 public class Alignment extends vamsas.objects.simple.Object\r
29     implements java.io.Serializable {\r
30     private java.lang.String gapchar;\r
31     private java.lang.String[] method;\r
32     private vamsas.objects.simple.SequenceSet seqs;\r
33     private java.lang.Object __equalsCalc = null;\r
34     private boolean __hashCodeCalc = false;\r
35 \r
36     public Alignment() {\r
37     }\r
38 \r
39     public Alignment(java.lang.String gapchar, java.lang.String[] method,\r
40         vamsas.objects.simple.SequenceSet seqs) {\r
41         this.gapchar = gapchar;\r
42         this.method = method;\r
43         this.seqs = seqs;\r
44     }\r
45 \r
46     /**
47  * Gets the gapchar value for this Alignment.
48  *
49  * @return gapchar
50  */\r
51     public java.lang.String getGapchar() {\r
52         return gapchar;\r
53     }\r
54 \r
55     /**
56  * Sets the gapchar value for this Alignment.
57  *
58  * @param gapchar
59  */\r
60     public void setGapchar(java.lang.String gapchar) {\r
61         this.gapchar = gapchar;\r
62     }\r
63 \r
64     /**
65  * Gets the method value for this Alignment.
66  *
67  * @return method
68  */\r
69     public java.lang.String[] getMethod() {\r
70         return method;\r
71     }\r
72 \r
73     /**
74  * Sets the method value for this Alignment.
75  *
76  * @param method
77  */\r
78     public void setMethod(java.lang.String[] method) {\r
79         this.method = method;\r
80     }\r
81 \r
82     /**
83  * Gets the seqs value for this Alignment.
84  *
85  * @return seqs
86  */\r
87     public vamsas.objects.simple.SequenceSet getSeqs() {\r
88         return seqs;\r
89     }\r
90 \r
91     /**
92  * Sets the seqs value for this Alignment.
93  *
94  * @param seqs
95  */\r
96     public void setSeqs(vamsas.objects.simple.SequenceSet seqs) {\r
97         this.seqs = seqs;\r
98     }\r
99 \r
100     public synchronized boolean equals(java.lang.Object obj) {\r
101         if (!(obj instanceof Alignment)) {\r
102             return false;\r
103         }\r
104 \r
105         Alignment other = (Alignment) obj;\r
106 \r
107         if (obj == null) {\r
108             return false;\r
109         }\r
110 \r
111         if (this == obj) {\r
112             return true;\r
113         }\r
114 \r
115         if (__equalsCalc != null) {\r
116             return (__equalsCalc == obj);\r
117         }\r
118 \r
119         __equalsCalc = obj;\r
120 \r
121         boolean _equals;\r
122         _equals = super.equals(obj) &&\r
123             (((this.gapchar == null) && (other.getGapchar() == null)) ||\r
124             ((this.gapchar != null) && this.gapchar.equals(other.getGapchar()))) &&\r
125             (((this.method == null) && (other.getMethod() == null)) ||\r
126             ((this.method != null) &&\r
127             java.util.Arrays.equals(this.method, other.getMethod()))) &&\r
128             (((this.seqs == null) && (other.getSeqs() == null)) ||\r
129             ((this.seqs != null) && this.seqs.equals(other.getSeqs())));\r
130         __equalsCalc = null;\r
131 \r
132         return _equals;\r
133     }\r
134 \r
135     public synchronized int hashCode() {\r
136         if (__hashCodeCalc) {\r
137             return 0;\r
138         }\r
139 \r
140         __hashCodeCalc = true;\r
141 \r
142         int _hashCode = super.hashCode();\r
143 \r
144         if (getGapchar() != null) {\r
145             _hashCode += getGapchar().hashCode();\r
146         }\r
147 \r
148         if (getMethod() != null) {\r
149             for (int i = 0; i < java.lang.reflect.Array.getLength(getMethod());\r
150                     i++) {\r
151                 java.lang.Object obj = java.lang.reflect.Array.get(getMethod(),\r
152                         i);\r
153 \r
154                 if ((obj != null) && !obj.getClass().isArray()) {\r
155                     _hashCode += obj.hashCode();\r
156                 }\r
157             }\r
158         }\r
159 \r
160         if (getSeqs() != null) {\r
161             _hashCode += getSeqs().hashCode();\r
162         }\r
163 \r
164         __hashCodeCalc = false;\r
165 \r
166         return _hashCode;\r
167     }\r
168 }\r