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