mapping implemented by MapList added to DBRefEntry.
[jalview.git] / src / jalview / datamodel / DBRefEntry.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer
3  * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4  *
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.
9  *
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.
14  *
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
18  */
19 package jalview.datamodel;
20
21 public class DBRefEntry
22 {
23   String source="", version="", accessionId="";
24   /**
25    * maps from associated sequence to the database sequence's coordinate system
26    */
27   Mapping map=null;
28   public DBRefEntry() {
29       
30   }
31   public DBRefEntry(String source, String version, String accessionId)
32   {
33     this.source = source;
34     this.version = version;
35     this.accessionId = accessionId;
36   }
37   public boolean equals(DBRefEntry entry) {
38       if (entry==this)
39           return true;
40       if (entry==null)
41           return false;
42       if ((source!=null && entry.source!=null && source.equals(entry.source))
43           &&
44           (accessionId!=null && entry.accessionId!=null && accessionId.equals(entry.accessionId))
45           &&
46           (version!=null && entry.version!=null && version.equals(entry.version))
47           &&
48           ((map==null && entry.map==null) || (map!=null && entry.map!=null && map.equals(entry.map)))) {
49               return true;
50           }
51       return false;
52   }
53   public String getSource()
54   {
55     return source;
56   }
57
58   public String getVersion()
59   {
60     return version;
61   }
62
63   public String getAccessionId()
64   {
65     return accessionId;
66   }
67 /**
68  * @param accessionId the accessionId to set
69  */
70 public void setAccessionId(String accessionId) {
71     this.accessionId = accessionId;
72 }
73 /**
74  * @param source the source to set
75  */
76 public void setSource(String source) {
77     this.source = source;
78 }
79 /**
80  * @param version the version to set
81  */
82 public void setVersion(String version) {
83     this.version = version;
84 }
85 /**
86  * @return the map
87  */
88 public Mapping getMap() {
89     return map;
90 }
91 /**
92  * @param map the map to set
93  */
94 public void setMap(Mapping map) {
95     this.map = map;
96 }
97 }