9539ebbeab7d980267a0230e79fe3dcf99c634fe
[jalview.git] / src / uk / ac / ebi / picr / model / UPEntry.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3  * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
4  * 
5  * This file is part of Jalview.
6  * 
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.
10  *  
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.
15  * 
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  */
18 package uk.ac.ebi.picr.model;
19
20 public class UPEntry implements java.io.Serializable
21 {
22   private java.lang.String CRC64;
23
24   private java.lang.String UPI;
25
26   private uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences;
27
28   private uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences;
29
30   private java.lang.String sequence;
31
32   private java.util.Calendar timestamp;
33
34   public UPEntry()
35   {
36   }
37
38   public UPEntry(java.lang.String CRC64, java.lang.String UPI,
39           uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences,
40           uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences,
41           java.lang.String sequence, java.util.Calendar timestamp)
42   {
43     this.CRC64 = CRC64;
44     this.UPI = UPI;
45     this.identicalCrossReferences = identicalCrossReferences;
46     this.logicalCrossReferences = logicalCrossReferences;
47     this.sequence = sequence;
48     this.timestamp = timestamp;
49   }
50
51   /**
52    * Gets the CRC64 value for this UPEntry.
53    * 
54    * @return CRC64
55    */
56   public java.lang.String getCRC64()
57   {
58     return CRC64;
59   }
60
61   /**
62    * Sets the CRC64 value for this UPEntry.
63    * 
64    * @param CRC64
65    */
66   public void setCRC64(java.lang.String CRC64)
67   {
68     this.CRC64 = CRC64;
69   }
70
71   /**
72    * Gets the UPI value for this UPEntry.
73    * 
74    * @return UPI
75    */
76   public java.lang.String getUPI()
77   {
78     return UPI;
79   }
80
81   /**
82    * Sets the UPI value for this UPEntry.
83    * 
84    * @param UPI
85    */
86   public void setUPI(java.lang.String UPI)
87   {
88     this.UPI = UPI;
89   }
90
91   /**
92    * Gets the identicalCrossReferences value for this UPEntry.
93    * 
94    * @return identicalCrossReferences
95    */
96   public uk.ac.ebi.picr.model.CrossReference[] getIdenticalCrossReferences()
97   {
98     return identicalCrossReferences;
99   }
100
101   /**
102    * Sets the identicalCrossReferences value for this UPEntry.
103    * 
104    * @param identicalCrossReferences
105    */
106   public void setIdenticalCrossReferences(
107           uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences)
108   {
109     this.identicalCrossReferences = identicalCrossReferences;
110   }
111
112   public uk.ac.ebi.picr.model.CrossReference getIdenticalCrossReferences(
113           int i)
114   {
115     return this.identicalCrossReferences[i];
116   }
117
118   public void setIdenticalCrossReferences(int i,
119           uk.ac.ebi.picr.model.CrossReference _value)
120   {
121     this.identicalCrossReferences[i] = _value;
122   }
123
124   /**
125    * Gets the logicalCrossReferences value for this UPEntry.
126    * 
127    * @return logicalCrossReferences
128    */
129   public uk.ac.ebi.picr.model.CrossReference[] getLogicalCrossReferences()
130   {
131     return logicalCrossReferences;
132   }
133
134   /**
135    * Sets the logicalCrossReferences value for this UPEntry.
136    * 
137    * @param logicalCrossReferences
138    */
139   public void setLogicalCrossReferences(
140           uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences)
141   {
142     this.logicalCrossReferences = logicalCrossReferences;
143   }
144
145   public uk.ac.ebi.picr.model.CrossReference getLogicalCrossReferences(int i)
146   {
147     return this.logicalCrossReferences[i];
148   }
149
150   public void setLogicalCrossReferences(int i,
151           uk.ac.ebi.picr.model.CrossReference _value)
152   {
153     this.logicalCrossReferences[i] = _value;
154   }
155
156   /**
157    * Gets the sequence value for this UPEntry.
158    * 
159    * @return sequence
160    */
161   public java.lang.String getSequence()
162   {
163     return sequence;
164   }
165
166   /**
167    * Sets the sequence value for this UPEntry.
168    * 
169    * @param sequence
170    */
171   public void setSequence(java.lang.String sequence)
172   {
173     this.sequence = sequence;
174   }
175
176   /**
177    * Gets the timestamp value for this UPEntry.
178    * 
179    * @return timestamp
180    */
181   public java.util.Calendar getTimestamp()
182   {
183     return timestamp;
184   }
185
186   /**
187    * Sets the timestamp value for this UPEntry.
188    * 
189    * @param timestamp
190    */
191   public void setTimestamp(java.util.Calendar timestamp)
192   {
193     this.timestamp = timestamp;
194   }
195
196   private java.lang.Object __equalsCalc = null;
197
198   public synchronized boolean equals(java.lang.Object obj)
199   {
200     if (!(obj instanceof UPEntry))
201       return false;
202     UPEntry other = (UPEntry) obj;
203     if (obj == null)
204       return false;
205     if (this == obj)
206       return true;
207     if (__equalsCalc != null)
208     {
209       return (__equalsCalc == obj);
210     }
211     __equalsCalc = obj;
212     boolean _equals;
213     _equals = true
214             && ((this.CRC64 == null && other.getCRC64() == null) || (this.CRC64 != null && this.CRC64
215                     .equals(other.getCRC64())))
216             && ((this.UPI == null && other.getUPI() == null) || (this.UPI != null && this.UPI
217                     .equals(other.getUPI())))
218             && ((this.identicalCrossReferences == null && other
219                     .getIdenticalCrossReferences() == null) || (this.identicalCrossReferences != null && java.util.Arrays
220                     .equals(this.identicalCrossReferences,
221                             other.getIdenticalCrossReferences())))
222             && ((this.logicalCrossReferences == null && other
223                     .getLogicalCrossReferences() == null) || (this.logicalCrossReferences != null && java.util.Arrays
224                     .equals(this.logicalCrossReferences,
225                             other.getLogicalCrossReferences())))
226             && ((this.sequence == null && other.getSequence() == null) || (this.sequence != null && this.sequence
227                     .equals(other.getSequence())))
228             && ((this.timestamp == null && other.getTimestamp() == null) || (this.timestamp != null && this.timestamp
229                     .equals(other.getTimestamp())));
230     __equalsCalc = null;
231     return _equals;
232   }
233
234   private boolean __hashCodeCalc = false;
235
236   public synchronized int hashCode()
237   {
238     if (__hashCodeCalc)
239     {
240       return 0;
241     }
242     __hashCodeCalc = true;
243     int _hashCode = 1;
244     if (getCRC64() != null)
245     {
246       _hashCode += getCRC64().hashCode();
247     }
248     if (getUPI() != null)
249     {
250       _hashCode += getUPI().hashCode();
251     }
252     if (getIdenticalCrossReferences() != null)
253     {
254       for (int i = 0; i < java.lang.reflect.Array
255               .getLength(getIdenticalCrossReferences()); i++)
256       {
257         java.lang.Object obj = java.lang.reflect.Array.get(
258                 getIdenticalCrossReferences(), i);
259         if (obj != null && !obj.getClass().isArray())
260         {
261           _hashCode += obj.hashCode();
262         }
263       }
264     }
265     if (getLogicalCrossReferences() != null)
266     {
267       for (int i = 0; i < java.lang.reflect.Array
268               .getLength(getLogicalCrossReferences()); i++)
269       {
270         java.lang.Object obj = java.lang.reflect.Array.get(
271                 getLogicalCrossReferences(), i);
272         if (obj != null && !obj.getClass().isArray())
273         {
274           _hashCode += obj.hashCode();
275         }
276       }
277     }
278     if (getSequence() != null)
279     {
280       _hashCode += getSequence().hashCode();
281     }
282     if (getTimestamp() != null)
283     {
284       _hashCode += getTimestamp().hashCode();
285     }
286     __hashCodeCalc = false;
287     return _hashCode;
288   }
289
290 }