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
55 setValue("status", status);
\r
59 this.featureGroup = featureGroup;
\r
62 public SequenceFeature(String type,
\r
66 String featureGroup)
\r
69 this.description = desc;
\r
73 this.featureGroup = featureGroup;
\r
76 public boolean equals(SequenceFeature sf)
\r
78 if(begin != sf.begin
\r
83 if(!(type+description).equals
\r
84 (sf.type+sf.description))
\r
94 * @return DOCUMENT ME!
\r
96 public int getBegin()
\r
101 public void setBegin(int start)
\r
103 this.begin = start;
\r
109 * @return DOCUMENT ME!
\r
111 public int getEnd()
\r
116 public void setEnd(int end)
\r
124 * @return DOCUMENT ME!
\r
126 public String getType()
\r
131 public void setType(String type)
\r
139 * @return DOCUMENT ME!
\r
141 public String getDescription()
\r
143 return description;
\r
146 public void setDescription(String desc)
\r
148 description = desc;
\r
151 public String getFeatureGroup()
\r
153 return featureGroup;
\r
156 public void setFeatureGroup(String featureGroup)
\r
158 this.featureGroup = featureGroup;
\r
161 public void addLink(String labelLink)
\r
164 links = new java.util.Vector();
\r
166 links.insertElementAt(labelLink,0);
\r
169 public float getScore()
\r
174 public void setScore(float value)
\r
180 * Used for getting values which are not in the
\r
181 * basic set. eg STRAND, FRAME for GFF file
\r
182 * @param key String
\r
184 public Object getValue(String key)
\r
186 if(otherDetails==null)
\r
189 return otherDetails.get(key);
\r
193 * Used for setting values which are not in the
\r
194 * basic set. eg STRAND, FRAME for GFF file
\r
195 * @param key eg STRAND
\r
196 * @param value eg +
\r
198 public void setValue(String key, Object value)
\r
200 if(otherDetails == null)
\r
201 otherDetails = new Hashtable();
\r
203 otherDetails.put(key, value);
\r