2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 package jalview.datamodel;
21 public class DBRefEntry
23 String source="", version="", accessionId="";
25 * maps from associated sequence to the database sequence's coordinate system
31 public DBRefEntry(String source, String version, String accessionId)
33 this(source, version, accessionId, null);
35 public DBRefEntry(String source, String version, String accessionId, Mapping map) {
37 this.version = version;
38 this.accessionId = accessionId;
41 public DBRefEntry(DBRefEntry entry)
43 this(new String(entry.source), new String(entry.version), new String(entry.accessionId), new Mapping(entry.map));
45 public boolean equals(DBRefEntry entry) {
52 ((map==null && entry.map==null) || (map!=null && entry.map!=null && map.equals(entry.map)))) {
58 * test for similar DBRef attributes, except for the map object.
60 * @return true if source, accession and version are equal with those of entry
62 public boolean equalRef(DBRefEntry entry)
70 if ((source!=null && entry.source!=null && source.equals(entry.source))
72 (accessionId!=null && entry.accessionId!=null && accessionId.equals(entry.accessionId))
74 (version!=null && entry.version!=null && version.equals(entry.version))
81 public String getSource()
86 public String getVersion()
91 public String getAccessionId()
96 * @param accessionId the accessionId to set
98 public void setAccessionId(String accessionId) {
99 this.accessionId = accessionId;
102 * @param source the source to set
104 public void setSource(String source) {
105 this.source = source;
108 * @param version the version to set
110 public void setVersion(String version) {
111 this.version = version;
116 public Mapping getMap() {
120 * @param map the map to set
122 public void setMap(Mapping map) {
125 public boolean hasMap()
127 // TODO Auto-generated method stub
132 * @return source+":"+accessionId
134 public String getSrcAccString()
136 return ((source!=null) ? source : "")
137 + ":" + ((accessionId!=null) ? accessionId : "");