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 CrossReference implements java.io.Serializable
22 private java.lang.String accession;
24 private java.lang.String accessionVersion;
26 private java.lang.String databaseDescription;
28 private java.lang.String databaseName;
30 private java.util.Calendar dateAdded;
32 private java.util.Calendar dateDeleted;
34 private boolean deleted;
36 private java.lang.String gi;
38 private java.lang.String taxonId;
40 public CrossReference()
44 public CrossReference(java.lang.String accession,
45 java.lang.String accessionVersion,
46 java.lang.String databaseDescription,
47 java.lang.String databaseName, java.util.Calendar dateAdded,
48 java.util.Calendar dateDeleted, boolean deleted,
49 java.lang.String gi, java.lang.String taxonId)
51 this.accession = accession;
52 this.accessionVersion = accessionVersion;
53 this.databaseDescription = databaseDescription;
54 this.databaseName = databaseName;
55 this.dateAdded = dateAdded;
56 this.dateDeleted = dateDeleted;
57 this.deleted = deleted;
59 this.taxonId = taxonId;
63 * Gets the accession value for this CrossReference.
67 public java.lang.String getAccession()
73 * Sets the accession value for this CrossReference.
77 public void setAccession(java.lang.String accession)
79 this.accession = accession;
83 * Gets the accessionVersion value for this CrossReference.
85 * @return accessionVersion
87 public java.lang.String getAccessionVersion()
89 return accessionVersion;
93 * Sets the accessionVersion value for this CrossReference.
95 * @param accessionVersion
97 public void setAccessionVersion(java.lang.String accessionVersion)
99 this.accessionVersion = accessionVersion;
103 * Gets the databaseDescription value for this CrossReference.
105 * @return databaseDescription
107 public java.lang.String getDatabaseDescription()
109 return databaseDescription;
113 * Sets the databaseDescription value for this CrossReference.
115 * @param databaseDescription
117 public void setDatabaseDescription(java.lang.String databaseDescription)
119 this.databaseDescription = databaseDescription;
123 * Gets the databaseName value for this CrossReference.
125 * @return databaseName
127 public java.lang.String getDatabaseName()
133 * Sets the databaseName value for this CrossReference.
135 * @param databaseName
137 public void setDatabaseName(java.lang.String databaseName)
139 this.databaseName = databaseName;
143 * Gets the dateAdded value for this CrossReference.
147 public java.util.Calendar getDateAdded()
153 * Sets the dateAdded value for this CrossReference.
157 public void setDateAdded(java.util.Calendar dateAdded)
159 this.dateAdded = dateAdded;
163 * Gets the dateDeleted value for this CrossReference.
165 * @return dateDeleted
167 public java.util.Calendar getDateDeleted()
173 * Sets the dateDeleted value for this CrossReference.
177 public void setDateDeleted(java.util.Calendar dateDeleted)
179 this.dateDeleted = dateDeleted;
183 * Gets the deleted value for this CrossReference.
187 public boolean isDeleted()
193 * Sets the deleted value for this CrossReference.
197 public void setDeleted(boolean deleted)
199 this.deleted = deleted;
203 * Gets the gi value for this CrossReference.
207 public java.lang.String getGi()
213 * Sets the gi value for this CrossReference.
217 public void setGi(java.lang.String gi)
223 * Gets the taxonId value for this CrossReference.
227 public java.lang.String getTaxonId()
233 * Sets the taxonId value for this CrossReference.
237 public void setTaxonId(java.lang.String taxonId)
239 this.taxonId = taxonId;
242 private java.lang.Object __equalsCalc = null;
244 public synchronized boolean equals(java.lang.Object obj)
246 if (!(obj instanceof CrossReference))
248 CrossReference other = (CrossReference) obj;
253 if (__equalsCalc != null)
255 return (__equalsCalc == obj);
260 && ((this.accession == null && other.getAccession() == null) || (this.accession != null && this.accession
261 .equals(other.getAccession())))
262 && ((this.accessionVersion == null && other
263 .getAccessionVersion() == null) || (this.accessionVersion != null && this.accessionVersion
264 .equals(other.getAccessionVersion())))
265 && ((this.databaseDescription == null && other
266 .getDatabaseDescription() == null) || (this.databaseDescription != null && this.databaseDescription
267 .equals(other.getDatabaseDescription())))
268 && ((this.databaseName == null && other.getDatabaseName() == null) || (this.databaseName != null && this.databaseName
269 .equals(other.getDatabaseName())))
270 && ((this.dateAdded == null && other.getDateAdded() == null) || (this.dateAdded != null && this.dateAdded
271 .equals(other.getDateAdded())))
272 && ((this.dateDeleted == null && other.getDateDeleted() == null) || (this.dateDeleted != null && this.dateDeleted
273 .equals(other.getDateDeleted())))
274 && this.deleted == other.isDeleted()
275 && ((this.gi == null && other.getGi() == null) || (this.gi != null && this.gi
276 .equals(other.getGi())))
277 && ((this.taxonId == null && other.getTaxonId() == null) || (this.taxonId != null && this.taxonId
278 .equals(other.getTaxonId())));
283 private boolean __hashCodeCalc = false;
285 public synchronized int hashCode()
291 __hashCodeCalc = true;
293 if (getAccession() != null)
295 _hashCode += getAccession().hashCode();
297 if (getAccessionVersion() != null)
299 _hashCode += getAccessionVersion().hashCode();
301 if (getDatabaseDescription() != null)
303 _hashCode += getDatabaseDescription().hashCode();
305 if (getDatabaseName() != null)
307 _hashCode += getDatabaseName().hashCode();
309 if (getDateAdded() != null)
311 _hashCode += getDateAdded().hashCode();
313 if (getDateDeleted() != null)
315 _hashCode += getDateDeleted().hashCode();
317 _hashCode += (isDeleted() ? Boolean.TRUE : Boolean.FALSE).hashCode();
320 _hashCode += getGi().hashCode();
322 if (getTaxonId() != null)
324 _hashCode += getTaxonId().hashCode();
326 __hashCodeCalc = false;