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 CrossReference implements java.io.Serializable
25 private java.lang.String accession;
27 private java.lang.String accessionVersion;
29 private java.lang.String databaseDescription;
31 private java.lang.String databaseName;
33 private java.util.Calendar dateAdded;
35 private java.util.Calendar dateDeleted;
37 private boolean deleted;
39 private java.lang.String gi;
41 private java.lang.String taxonId;
43 public CrossReference()
47 public CrossReference(java.lang.String accession,
48 java.lang.String accessionVersion,
49 java.lang.String databaseDescription,
50 java.lang.String databaseName, java.util.Calendar dateAdded,
51 java.util.Calendar dateDeleted, boolean deleted,
52 java.lang.String gi, java.lang.String taxonId)
54 this.accession = accession;
55 this.accessionVersion = accessionVersion;
56 this.databaseDescription = databaseDescription;
57 this.databaseName = databaseName;
58 this.dateAdded = dateAdded;
59 this.dateDeleted = dateDeleted;
60 this.deleted = deleted;
62 this.taxonId = taxonId;
66 * Gets the accession value for this CrossReference.
70 public java.lang.String getAccession()
76 * Sets the accession value for this CrossReference.
80 public void setAccession(java.lang.String accession)
82 this.accession = accession;
86 * Gets the accessionVersion value for this CrossReference.
88 * @return accessionVersion
90 public java.lang.String getAccessionVersion()
92 return accessionVersion;
96 * Sets the accessionVersion value for this CrossReference.
98 * @param accessionVersion
100 public void setAccessionVersion(java.lang.String accessionVersion)
102 this.accessionVersion = accessionVersion;
106 * Gets the databaseDescription value for this CrossReference.
108 * @return databaseDescription
110 public java.lang.String getDatabaseDescription()
112 return databaseDescription;
116 * Sets the databaseDescription value for this CrossReference.
118 * @param databaseDescription
120 public void setDatabaseDescription(java.lang.String databaseDescription)
122 this.databaseDescription = databaseDescription;
126 * Gets the databaseName value for this CrossReference.
128 * @return databaseName
130 public java.lang.String getDatabaseName()
136 * Sets the databaseName value for this CrossReference.
138 * @param databaseName
140 public void setDatabaseName(java.lang.String databaseName)
142 this.databaseName = databaseName;
146 * Gets the dateAdded value for this CrossReference.
150 public java.util.Calendar getDateAdded()
156 * Sets the dateAdded value for this CrossReference.
160 public void setDateAdded(java.util.Calendar dateAdded)
162 this.dateAdded = dateAdded;
166 * Gets the dateDeleted value for this CrossReference.
168 * @return dateDeleted
170 public java.util.Calendar getDateDeleted()
176 * Sets the dateDeleted value for this CrossReference.
180 public void setDateDeleted(java.util.Calendar dateDeleted)
182 this.dateDeleted = dateDeleted;
186 * Gets the deleted value for this CrossReference.
190 public boolean isDeleted()
196 * Sets the deleted value for this CrossReference.
200 public void setDeleted(boolean deleted)
202 this.deleted = deleted;
206 * Gets the gi value for this CrossReference.
210 public java.lang.String getGi()
216 * Sets the gi value for this CrossReference.
220 public void setGi(java.lang.String gi)
226 * Gets the taxonId value for this CrossReference.
230 public java.lang.String getTaxonId()
236 * Sets the taxonId value for this CrossReference.
240 public void setTaxonId(java.lang.String taxonId)
242 this.taxonId = taxonId;
245 private java.lang.Object __equalsCalc = null;
248 public synchronized boolean equals(java.lang.Object obj)
254 if (!(obj instanceof CrossReference))
258 CrossReference other = (CrossReference) obj;
263 if (__equalsCalc != null)
265 return (__equalsCalc == obj);
270 && ((this.accession == null && other.getAccession() == null)
271 || (this.accession != null
272 && this.accession.equals(other.getAccession())))
273 && ((this.accessionVersion == null
274 && other.getAccessionVersion() == null)
275 || (this.accessionVersion != null
276 && this.accessionVersion
277 .equals(other.getAccessionVersion())))
278 && ((this.databaseDescription == null
279 && other.getDatabaseDescription() == null)
280 || (this.databaseDescription != null
281 && this.databaseDescription.equals(
282 other.getDatabaseDescription())))
283 && ((this.databaseName == null
284 && other.getDatabaseName() == null)
285 || (this.databaseName != null && this.databaseName
286 .equals(other.getDatabaseName())))
287 && ((this.dateAdded == null && other.getDateAdded() == null)
288 || (this.dateAdded != null
289 && this.dateAdded.equals(other.getDateAdded())))
290 && ((this.dateDeleted == null && other.getDateDeleted() == null)
291 || (this.dateDeleted != null && this.dateDeleted
292 .equals(other.getDateDeleted())))
293 && this.deleted == other.isDeleted()
294 && ((this.gi == null && other.getGi() == null)
295 || (this.gi != null && this.gi.equals(other.getGi())))
296 && ((this.taxonId == null && other.getTaxonId() == null)
297 || (this.taxonId != null
298 && this.taxonId.equals(other.getTaxonId())));
303 private boolean __hashCodeCalc = false;
306 * hashCode designed to ensure that if two instances satisfy o1.equals(o2)
307 * then they have the same hashcode.
310 public synchronized int hashCode()
316 __hashCodeCalc = true;
318 if (getAccession() != null)
320 _hashCode += getAccession().hashCode();
322 if (getAccessionVersion() != null)
324 _hashCode += getAccessionVersion().hashCode();
326 if (getDatabaseDescription() != null)
328 _hashCode += getDatabaseDescription().hashCode();
330 if (getDatabaseName() != null)
332 _hashCode += getDatabaseName().hashCode();
334 if (getDateAdded() != null)
336 _hashCode += getDateAdded().hashCode();
338 if (getDateDeleted() != null)
340 _hashCode += getDateDeleted().hashCode();
342 _hashCode += (isDeleted() ? Boolean.TRUE : Boolean.FALSE).hashCode();
345 _hashCode += getGi().hashCode();
347 if (getTaxonId() != null)
349 _hashCode += getTaxonId().hashCode();
351 __hashCodeCalc = false;