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 public String status;
\r
37 Hashtable otherDetails;
\r
38 public java.util.Vector links;
\r
40 // Feature group can be set from a features file
\r
41 // as a group of features between STARTGROUP and ENDGROUP markers
\r
42 public String featureGroup;
\r
44 public SequenceFeature()
\r
47 public SequenceFeature(String type,
\r
51 String featureGroup)
\r
54 this.description = desc;
\r
55 this.status = status;
\r
58 this.featureGroup = featureGroup;
\r
60 public SequenceFeature(String type,
\r
64 String featureGroup)
\r
67 this.description = desc;
\r
68 this.status = status;
\r
72 this.featureGroup = featureGroup;
\r
75 public boolean equals(SequenceFeature sf)
\r
77 if(begin != sf.begin
\r
82 if(!(type+description+status).equals
\r
83 (sf.type+sf.description+sf.status))
\r
93 * @return DOCUMENT ME!
\r
95 public int getBegin()
\r
100 public void setBegin(int start)
\r
102 this.begin = start;
\r
108 * @return DOCUMENT ME!
\r
110 public int getEnd()
\r
115 public void setEnd(int end)
\r
123 * @return DOCUMENT ME!
\r
125 public String getType()
\r
130 public void setType(String type)
\r
138 * @return DOCUMENT ME!
\r
140 public String getDescription()
\r
142 return description;
\r
145 public void setDescription(String desc)
\r
147 description = desc;
\r
153 * @return DOCUMENT ME!
\r
155 public String getStatus()
\r
160 public void setStatus(String status)
\r
162 this.status = status;
\r
165 public String getFeatureGroup()
\r
167 return featureGroup;
\r
170 public void setFeatureGroup(String featureGroup)
\r
172 this.featureGroup = featureGroup;
\r
175 public void addLink(String labelLink)
\r
178 links = new java.util.Vector();
\r
180 links.insertElementAt(labelLink,0);
\r
183 public float getScore()
\r
188 public void setScore(float value)
\r
194 * Used for getting values which are not in the
\r
195 * basic set. eg STRAND, FRAME for GFF file
\r
196 * @param key String
\r
198 public Object getValue(String key)
\r
200 if(otherDetails==null)
\r
203 return otherDetails.get(key);
\r
207 * Used for setting values which are not in the
\r
208 * basic set. eg STRAND, FRAME for GFF file
\r
209 * @param key eg STRAND
\r
210 * @param value eg +
\r
212 public void setValue(String key, Object value)
\r
214 if(otherDetails == null)
\r
215 otherDetails = new Hashtable();
\r
217 otherDetails.put(key, value);
\r