2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2006 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 import java.util.Hashtable;
29 public class SequenceFeature
35 public String description;
36 public Hashtable otherDetails;
37 public java.util.Vector links;
39 // Feature group can be set from a features file
40 // as a group of features between STARTGROUP and ENDGROUP markers
41 public String featureGroup;
43 public SequenceFeature()
46 public SequenceFeature(String type,
53 this.description = desc;
54 setValue("status", status);
57 this.featureGroup = featureGroup;
60 public SequenceFeature(String type,
67 this.description = desc;
71 this.featureGroup = featureGroup;
74 public boolean equals(SequenceFeature sf)
81 if(!(type+description+featureGroup).equals
82 (sf.type+sf.description+sf.featureGroup))
92 * @return DOCUMENT ME!
99 public void setBegin(int start)
107 * @return DOCUMENT ME!
114 public void setEnd(int end)
122 * @return DOCUMENT ME!
124 public String getType()
129 public void setType(String type)
137 * @return DOCUMENT ME!
139 public String getDescription()
144 public void setDescription(String desc)
149 public String getFeatureGroup()
154 public void setFeatureGroup(String featureGroup)
156 this.featureGroup = featureGroup;
159 public void addLink(String labelLink)
162 links = new java.util.Vector();
164 links.insertElementAt(labelLink,0);
167 public float getScore()
172 public void setScore(float value)
178 * Used for getting values which are not in the
179 * basic set. eg STRAND, FRAME for GFF file
182 public Object getValue(String key)
184 if(otherDetails==null)
187 return otherDetails.get(key);
191 * Used for setting values which are not in the
192 * basic set. eg STRAND, FRAME for GFF file
193 * @param key eg STRAND
196 public void setValue(String key, Object value)
200 if (otherDetails == null)
201 otherDetails = new Hashtable();
203 otherDetails.put(key, value);
209 * The following methods are added to maintain
210 * the castor Uniprot mapping file for the moment.
212 public void setStatus(String status)
214 setValue("status", status);
217 public String getStatus()
219 if (otherDetails != null)
220 return otherDetails.get("status").toString();
225 public void setPosition(int pos)
231 public int getPosition()