Remove position, add score and links
[jalview.git] / src / jalview / datamodel / SequenceFeature.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer\r
3  * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4  *\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
9  *\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
14  *\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
18  */\r
19 package jalview.datamodel;\r
20 \r
21 /**\r
22  * DOCUMENT ME!\r
23  *\r
24  * @author $author$\r
25  * @version $Revision$\r
26  */\r
27 public class SequenceFeature\r
28 {\r
29     public int begin;\r
30     public int end;\r
31     public float score;\r
32     public String type;\r
33     public String description;\r
34     public String status;\r
35     public java.util.Vector links;\r
36 \r
37     // Feature group can be set from a features file\r
38     // as a group of features between STARTGROUP and ENDGROUP markers\r
39     public String featureGroup;\r
40 \r
41     public SequenceFeature()\r
42     {}\r
43 \r
44     public SequenceFeature(String type,\r
45                            String desc,\r
46                            String status,\r
47                            int begin, int end,\r
48                            String featureGroup)\r
49     {\r
50       this.type = type;\r
51       this.description = desc;\r
52       this.status = status;\r
53       this.begin = begin;\r
54       this.end = end;\r
55       this.featureGroup = featureGroup;\r
56     }\r
57     public SequenceFeature(String type,\r
58                            String desc,\r
59                            int begin, int end,\r
60                            float score,\r
61                            String featureGroup)\r
62     {\r
63       this.type = type;\r
64       this.description = desc;\r
65       this.status = status;\r
66       this.begin = begin;\r
67       this.end = end;\r
68       this.score = score;\r
69       this.featureGroup = featureGroup;\r
70     }\r
71 \r
72     public boolean equals(SequenceFeature sf)\r
73     {\r
74       if(begin != sf.begin\r
75       || end != sf.end)\r
76      return false;\r
77 \r
78 \r
79       if(!(type+description+status).equals\r
80          (sf.type+sf.description+sf.status))\r
81         return false;\r
82 \r
83       return true;\r
84     }\r
85 \r
86 \r
87     /**\r
88      * DOCUMENT ME!\r
89      *\r
90      * @return DOCUMENT ME!\r
91      */\r
92     public int getBegin()\r
93     {\r
94         return begin;\r
95     }\r
96 \r
97     public void setBegin(int start)\r
98     {\r
99       this.begin = start;\r
100     }\r
101 \r
102     /**\r
103      * DOCUMENT ME!\r
104      *\r
105      * @return DOCUMENT ME!\r
106      */\r
107     public int getEnd()\r
108     {\r
109         return end;\r
110     }\r
111 \r
112     public void setEnd(int end)\r
113     {\r
114       this.end = end;\r
115     }\r
116 \r
117     /**\r
118      * DOCUMENT ME!\r
119      *\r
120      * @return DOCUMENT ME!\r
121      */\r
122     public String getType()\r
123     {\r
124         return type;\r
125     }\r
126 \r
127     public void setType(String type)\r
128     {\r
129       this.type = type;\r
130     }\r
131 \r
132     /**\r
133      * DOCUMENT ME!\r
134      *\r
135      * @return DOCUMENT ME!\r
136      */\r
137     public String getDescription()\r
138     {\r
139         return description;\r
140     }\r
141 \r
142     public void setDescription(String desc)\r
143     {\r
144       description = desc;\r
145     }\r
146 \r
147     /**\r
148      * DOCUMENT ME!\r
149      *\r
150      * @return DOCUMENT ME!\r
151      */\r
152     public String getStatus()\r
153     {\r
154         return status;\r
155     }\r
156 \r
157     public void setStatus(String status)\r
158     {\r
159       this.status = status;\r
160     }\r
161 \r
162     public String getFeatureGroup()\r
163     {\r
164       return featureGroup;\r
165     }\r
166 \r
167     public void setFeatureGroup(String featureGroup)\r
168     {\r
169       this.featureGroup = featureGroup;\r
170     }\r
171 \r
172     public void addLink(String labelLink)\r
173     {\r
174       if(links==null)\r
175         links = new java.util.Vector();\r
176 \r
177       links.insertElementAt(labelLink,0);\r
178     }\r
179 \r
180     public float getScore()\r
181     {\r
182       return score;\r
183     }\r
184 \r
185     public void setScore(float value)\r
186     {\r
187       score = value;\r
188     }\r
189 }\r