2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 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 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/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package uk.ac.ebi.picr.model;
21 public class CrossReference implements java.io.Serializable
23 private java.lang.String accession;
25 private java.lang.String accessionVersion;
27 private java.lang.String databaseDescription;
29 private java.lang.String databaseName;
31 private java.util.Calendar dateAdded;
33 private java.util.Calendar dateDeleted;
35 private boolean deleted;
37 private java.lang.String gi;
39 private java.lang.String taxonId;
41 public CrossReference()
45 public CrossReference(java.lang.String accession,
46 java.lang.String accessionVersion,
47 java.lang.String databaseDescription,
48 java.lang.String databaseName, java.util.Calendar dateAdded,
49 java.util.Calendar dateDeleted, boolean deleted,
50 java.lang.String gi, java.lang.String taxonId)
52 this.accession = accession;
53 this.accessionVersion = accessionVersion;
54 this.databaseDescription = databaseDescription;
55 this.databaseName = databaseName;
56 this.dateAdded = dateAdded;
57 this.dateDeleted = dateDeleted;
58 this.deleted = deleted;
60 this.taxonId = taxonId;
64 * Gets the accession value for this CrossReference.
68 public java.lang.String getAccession()
74 * Sets the accession value for this CrossReference.
78 public void setAccession(java.lang.String accession)
80 this.accession = accession;
84 * Gets the accessionVersion value for this CrossReference.
86 * @return accessionVersion
88 public java.lang.String getAccessionVersion()
90 return accessionVersion;
94 * Sets the accessionVersion value for this CrossReference.
96 * @param accessionVersion
98 public void setAccessionVersion(java.lang.String accessionVersion)
100 this.accessionVersion = accessionVersion;
104 * Gets the databaseDescription value for this CrossReference.
106 * @return databaseDescription
108 public java.lang.String getDatabaseDescription()
110 return databaseDescription;
114 * Sets the databaseDescription value for this CrossReference.
116 * @param databaseDescription
118 public void setDatabaseDescription(java.lang.String databaseDescription)
120 this.databaseDescription = databaseDescription;
124 * Gets the databaseName value for this CrossReference.
126 * @return databaseName
128 public java.lang.String getDatabaseName()
134 * Sets the databaseName value for this CrossReference.
136 * @param databaseName
138 public void setDatabaseName(java.lang.String databaseName)
140 this.databaseName = databaseName;
144 * Gets the dateAdded value for this CrossReference.
148 public java.util.Calendar getDateAdded()
154 * Sets the dateAdded value for this CrossReference.
158 public void setDateAdded(java.util.Calendar dateAdded)
160 this.dateAdded = dateAdded;
164 * Gets the dateDeleted value for this CrossReference.
166 * @return dateDeleted
168 public java.util.Calendar getDateDeleted()
174 * Sets the dateDeleted value for this CrossReference.
178 public void setDateDeleted(java.util.Calendar dateDeleted)
180 this.dateDeleted = dateDeleted;
184 * Gets the deleted value for this CrossReference.
188 public boolean isDeleted()
194 * Sets the deleted value for this CrossReference.
198 public void setDeleted(boolean deleted)
200 this.deleted = deleted;
204 * Gets the gi value for this CrossReference.
208 public java.lang.String getGi()
214 * Sets the gi value for this CrossReference.
218 public void setGi(java.lang.String gi)
224 * Gets the taxonId value for this CrossReference.
228 public java.lang.String getTaxonId()
234 * Sets the taxonId value for this CrossReference.
238 public void setTaxonId(java.lang.String taxonId)
240 this.taxonId = taxonId;
243 private java.lang.Object __equalsCalc = null;
245 public synchronized boolean equals(java.lang.Object obj)
247 if (!(obj instanceof CrossReference))
249 CrossReference other = (CrossReference) obj;
254 if (__equalsCalc != null)
256 return (__equalsCalc == obj);
261 && ((this.accession == null && other.getAccession() == null) || (this.accession != null && this.accession
262 .equals(other.getAccession())))
263 && ((this.accessionVersion == null && other
264 .getAccessionVersion() == null) || (this.accessionVersion != null && this.accessionVersion
265 .equals(other.getAccessionVersion())))
266 && ((this.databaseDescription == null && other
267 .getDatabaseDescription() == null) || (this.databaseDescription != null && this.databaseDescription
268 .equals(other.getDatabaseDescription())))
269 && ((this.databaseName == null && other.getDatabaseName() == null) || (this.databaseName != null && this.databaseName
270 .equals(other.getDatabaseName())))
271 && ((this.dateAdded == null && other.getDateAdded() == null) || (this.dateAdded != null && this.dateAdded
272 .equals(other.getDateAdded())))
273 && ((this.dateDeleted == null && other.getDateDeleted() == null) || (this.dateDeleted != null && this.dateDeleted
274 .equals(other.getDateDeleted())))
275 && this.deleted == other.isDeleted()
276 && ((this.gi == null && other.getGi() == null) || (this.gi != null && this.gi
277 .equals(other.getGi())))
278 && ((this.taxonId == null && other.getTaxonId() == null) || (this.taxonId != null && this.taxonId
279 .equals(other.getTaxonId())));
284 private boolean __hashCodeCalc = false;
286 public synchronized int hashCode()
292 __hashCodeCalc = true;
294 if (getAccession() != null)
296 _hashCode += getAccession().hashCode();
298 if (getAccessionVersion() != null)
300 _hashCode += getAccessionVersion().hashCode();
302 if (getDatabaseDescription() != null)
304 _hashCode += getDatabaseDescription().hashCode();
306 if (getDatabaseName() != null)
308 _hashCode += getDatabaseName().hashCode();
310 if (getDateAdded() != null)
312 _hashCode += getDateAdded().hashCode();
314 if (getDateDeleted() != null)
316 _hashCode += getDateDeleted().hashCode();
318 _hashCode += (isDeleted() ? Boolean.TRUE : Boolean.FALSE).hashCode();
321 _hashCode += getGi().hashCode();
323 if (getTaxonId() != null)
325 _hashCode += getTaxonId().hashCode();
327 __hashCodeCalc = false;