2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package uk.ac.ebi.picr.model;
23 public class UPEntry implements java.io.Serializable
25 private java.lang.String CRC64;
27 private java.lang.String UPI;
29 private uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences;
31 private uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences;
33 private java.lang.String sequence;
35 private java.util.Calendar timestamp;
41 public UPEntry(java.lang.String CRC64, java.lang.String UPI,
42 uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences,
43 uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences,
44 java.lang.String sequence, java.util.Calendar timestamp)
48 this.identicalCrossReferences = identicalCrossReferences;
49 this.logicalCrossReferences = logicalCrossReferences;
50 this.sequence = sequence;
51 this.timestamp = timestamp;
55 * Gets the CRC64 value for this UPEntry.
59 public java.lang.String getCRC64()
65 * Sets the CRC64 value for this UPEntry.
69 public void setCRC64(java.lang.String CRC64)
75 * Gets the UPI value for this UPEntry.
79 public java.lang.String getUPI()
85 * Sets the UPI value for this UPEntry.
89 public void setUPI(java.lang.String UPI)
95 * Gets the identicalCrossReferences value for this UPEntry.
97 * @return identicalCrossReferences
99 public uk.ac.ebi.picr.model.CrossReference[] getIdenticalCrossReferences()
101 return identicalCrossReferences;
105 * Sets the identicalCrossReferences value for this UPEntry.
107 * @param identicalCrossReferences
109 public void setIdenticalCrossReferences(
110 uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences)
112 this.identicalCrossReferences = identicalCrossReferences;
115 public uk.ac.ebi.picr.model.CrossReference getIdenticalCrossReferences(
118 return this.identicalCrossReferences[i];
121 public void setIdenticalCrossReferences(int i,
122 uk.ac.ebi.picr.model.CrossReference _value)
124 this.identicalCrossReferences[i] = _value;
128 * Gets the logicalCrossReferences value for this UPEntry.
130 * @return logicalCrossReferences
132 public uk.ac.ebi.picr.model.CrossReference[] getLogicalCrossReferences()
134 return logicalCrossReferences;
138 * Sets the logicalCrossReferences value for this UPEntry.
140 * @param logicalCrossReferences
142 public void setLogicalCrossReferences(
143 uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences)
145 this.logicalCrossReferences = logicalCrossReferences;
148 public uk.ac.ebi.picr.model.CrossReference getLogicalCrossReferences(
151 return this.logicalCrossReferences[i];
154 public void setLogicalCrossReferences(int i,
155 uk.ac.ebi.picr.model.CrossReference _value)
157 this.logicalCrossReferences[i] = _value;
161 * Gets the sequence value for this UPEntry.
165 public java.lang.String getSequence()
171 * Sets the sequence value for this UPEntry.
175 public void setSequence(java.lang.String sequence)
177 this.sequence = sequence;
181 * Gets the timestamp value for this UPEntry.
185 public java.util.Calendar getTimestamp()
191 * Sets the timestamp value for this UPEntry.
195 public void setTimestamp(java.util.Calendar timestamp)
197 this.timestamp = timestamp;
200 private java.lang.Object __equalsCalc = null;
203 public synchronized boolean equals(java.lang.Object obj)
209 if (!(obj instanceof UPEntry))
213 UPEntry other = (UPEntry) obj;
218 if (__equalsCalc != null)
220 return (__equalsCalc == obj);
224 _equals = true && ((this.CRC64 == null && other.getCRC64() == null)
225 || (this.CRC64 != null && this.CRC64.equals(other.getCRC64())))
226 && ((this.UPI == null && other.getUPI() == null)
228 && this.UPI.equals(other.getUPI())))
229 && ((this.identicalCrossReferences == null
230 && other.getIdenticalCrossReferences() == null)
231 || (this.identicalCrossReferences != null
232 && java.util.Arrays.equals(
233 this.identicalCrossReferences,
234 other.getIdenticalCrossReferences())))
235 && ((this.logicalCrossReferences == null
236 && other.getLogicalCrossReferences() == null)
237 || (this.logicalCrossReferences != null
238 && java.util.Arrays.equals(
239 this.logicalCrossReferences,
240 other.getLogicalCrossReferences())))
241 && ((this.sequence == null && other.getSequence() == null)
242 || (this.sequence != null
243 && this.sequence.equals(other.getSequence())))
244 && ((this.timestamp == null && other.getTimestamp() == null)
245 || (this.timestamp != null && this.timestamp
246 .equals(other.getTimestamp())));
251 private boolean __hashCodeCalc = false;
254 public synchronized int hashCode()
260 __hashCodeCalc = true;
262 if (getCRC64() != null)
264 _hashCode += getCRC64().hashCode();
266 if (getUPI() != null)
268 _hashCode += getUPI().hashCode();
270 if (getIdenticalCrossReferences() != null)
272 for (int i = 0; i < java.lang.reflect.Array
273 .getLength(getIdenticalCrossReferences()); i++)
275 java.lang.Object obj = java.lang.reflect.Array
276 .get(getIdenticalCrossReferences(), i);
277 if (obj != null && !obj.getClass().isArray())
279 _hashCode += obj.hashCode();
283 if (getLogicalCrossReferences() != null)
285 for (int i = 0; i < java.lang.reflect.Array
286 .getLength(getLogicalCrossReferences()); i++)
288 java.lang.Object obj = java.lang.reflect.Array
289 .get(getLogicalCrossReferences(), i);
290 if (obj != null && !obj.getClass().isArray())
292 _hashCode += obj.hashCode();
296 if (getSequence() != null)
298 _hashCode += getSequence().hashCode();
300 if (getTimestamp() != null)
302 _hashCode += getTimestamp().hashCode();
304 __hashCodeCalc = false;