2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.datamodel;
\r
21 import java.util.Hashtable;
\r
27 * @version $Revision$
\r
29 public class SequenceFeature
\r
35 public String description;
\r
36 Hashtable otherDetails;
\r
37 public java.util.Vector links;
\r
39 // Feature group can be set from a features file
\r
40 // as a group of features between STARTGROUP and ENDGROUP markers
\r
41 public String featureGroup;
\r
43 public SequenceFeature()
\r
46 public SequenceFeature(String type,
\r
50 String featureGroup)
\r
53 this.description = desc;
\r
54 setValue("status", status);
\r
57 this.featureGroup = featureGroup;
\r
60 public SequenceFeature(String type,
\r
64 String featureGroup)
\r
67 this.description = desc;
\r
71 this.featureGroup = featureGroup;
\r
74 public boolean equals(SequenceFeature sf)
\r
76 if (begin != sf.begin
\r
78 || score != sf.score)
\r
81 if(!(type+description+featureGroup).equals
\r
82 (sf.type+sf.description+sf.featureGroup))
\r
92 * @return DOCUMENT ME!
\r
94 public int getBegin()
\r
99 public void setBegin(int start)
\r
101 this.begin = start;
\r
107 * @return DOCUMENT ME!
\r
109 public int getEnd()
\r
114 public void setEnd(int end)
\r
122 * @return DOCUMENT ME!
\r
124 public String getType()
\r
129 public void setType(String type)
\r
137 * @return DOCUMENT ME!
\r
139 public String getDescription()
\r
141 return description;
\r
144 public void setDescription(String desc)
\r
146 description = desc;
\r
149 public String getFeatureGroup()
\r
151 return featureGroup;
\r
154 public void setFeatureGroup(String featureGroup)
\r
156 this.featureGroup = featureGroup;
\r
159 public void addLink(String labelLink)
\r
162 links = new java.util.Vector();
\r
164 links.insertElementAt(labelLink,0);
\r
167 public float getScore()
\r
172 public void setScore(float value)
\r
178 * Used for getting values which are not in the
\r
179 * basic set. eg STRAND, FRAME for GFF file
\r
180 * @param key String
\r
182 public Object getValue(String key)
\r
184 if(otherDetails==null)
\r
187 return otherDetails.get(key);
\r
191 * Used for setting values which are not in the
\r
192 * basic set. eg STRAND, FRAME for GFF file
\r
193 * @param key eg STRAND
\r
194 * @param value eg +
\r
196 public void setValue(String key, Object value)
\r
200 if (otherDetails == null)
\r
201 otherDetails = new Hashtable();
\r
203 otherDetails.put(key, value);
\r
209 * The following methods are added to maintain
\r
210 * the castor Uniprot mapping file for the moment.
\r
212 public void setStatus(String status)
\r
214 setValue("status", status);
\r
217 public String getStatus()
\r
219 if (otherDetails != null)
\r
220 return otherDetails.get("status").toString();
\r
225 public void setPosition(int pos)
\r
231 public int getPosition()
\r