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
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/>.
18 package uk.ac.ebi.picr.model;
20 public class UPEntry implements java.io.Serializable
22 private java.lang.String CRC64;
24 private java.lang.String UPI;
26 private uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences;
28 private uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences;
30 private java.lang.String sequence;
32 private java.util.Calendar timestamp;
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)
45 this.identicalCrossReferences = identicalCrossReferences;
46 this.logicalCrossReferences = logicalCrossReferences;
47 this.sequence = sequence;
48 this.timestamp = timestamp;
52 * Gets the CRC64 value for this UPEntry.
56 public java.lang.String getCRC64()
62 * Sets the CRC64 value for this UPEntry.
66 public void setCRC64(java.lang.String CRC64)
72 * Gets the UPI value for this UPEntry.
76 public java.lang.String getUPI()
82 * Sets the UPI value for this UPEntry.
86 public void setUPI(java.lang.String UPI)
92 * Gets the identicalCrossReferences value for this UPEntry.
94 * @return identicalCrossReferences
96 public uk.ac.ebi.picr.model.CrossReference[] getIdenticalCrossReferences()
98 return identicalCrossReferences;
102 * Sets the identicalCrossReferences value for this UPEntry.
104 * @param identicalCrossReferences
106 public void setIdenticalCrossReferences(
107 uk.ac.ebi.picr.model.CrossReference[] identicalCrossReferences)
109 this.identicalCrossReferences = identicalCrossReferences;
112 public uk.ac.ebi.picr.model.CrossReference getIdenticalCrossReferences(
115 return this.identicalCrossReferences[i];
118 public void setIdenticalCrossReferences(int i,
119 uk.ac.ebi.picr.model.CrossReference _value)
121 this.identicalCrossReferences[i] = _value;
125 * Gets the logicalCrossReferences value for this UPEntry.
127 * @return logicalCrossReferences
129 public uk.ac.ebi.picr.model.CrossReference[] getLogicalCrossReferences()
131 return logicalCrossReferences;
135 * Sets the logicalCrossReferences value for this UPEntry.
137 * @param logicalCrossReferences
139 public void setLogicalCrossReferences(
140 uk.ac.ebi.picr.model.CrossReference[] logicalCrossReferences)
142 this.logicalCrossReferences = logicalCrossReferences;
145 public uk.ac.ebi.picr.model.CrossReference getLogicalCrossReferences(int i)
147 return this.logicalCrossReferences[i];
150 public void setLogicalCrossReferences(int i,
151 uk.ac.ebi.picr.model.CrossReference _value)
153 this.logicalCrossReferences[i] = _value;
157 * Gets the sequence value for this UPEntry.
161 public java.lang.String getSequence()
167 * Sets the sequence value for this UPEntry.
171 public void setSequence(java.lang.String sequence)
173 this.sequence = sequence;
177 * Gets the timestamp value for this UPEntry.
181 public java.util.Calendar getTimestamp()
187 * Sets the timestamp value for this UPEntry.
191 public void setTimestamp(java.util.Calendar timestamp)
193 this.timestamp = timestamp;
196 private java.lang.Object __equalsCalc = null;
198 public synchronized boolean equals(java.lang.Object obj)
200 if (!(obj instanceof UPEntry))
202 UPEntry other = (UPEntry) obj;
207 if (__equalsCalc != null)
209 return (__equalsCalc == obj);
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())));
234 private boolean __hashCodeCalc = false;
236 public synchronized int hashCode()
242 __hashCodeCalc = true;
244 if (getCRC64() != null)
246 _hashCode += getCRC64().hashCode();
248 if (getUPI() != null)
250 _hashCode += getUPI().hashCode();
252 if (getIdenticalCrossReferences() != null)
254 for (int i = 0; i < java.lang.reflect.Array
255 .getLength(getIdenticalCrossReferences()); i++)
257 java.lang.Object obj = java.lang.reflect.Array.get(
258 getIdenticalCrossReferences(), i);
259 if (obj != null && !obj.getClass().isArray())
261 _hashCode += obj.hashCode();
265 if (getLogicalCrossReferences() != null)
267 for (int i = 0; i < java.lang.reflect.Array
268 .getLength(getLogicalCrossReferences()); i++)
270 java.lang.Object obj = java.lang.reflect.Array.get(
271 getLogicalCrossReferences(), i);
272 if (obj != null && !obj.getClass().isArray())
274 _hashCode += obj.hashCode();
278 if (getSequence() != null)
280 _hashCode += getSequence().hashCode();
282 if (getTimestamp() != null)
284 _hashCode += getTimestamp().hashCode();
286 __hashCodeCalc = false;