FeaturesGroup added to constructor
[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 position;\r
30     public int begin;\r
31     public int end;\r
32     public String type;\r
33     public String description;\r
34     public String status;\r
35 \r
36     // Feature group can be set from a features file\r
37     // as a group of features between STARTGROUP and ENDGROUP markers\r
38     public String featureGroup;\r
39 \r
40     public SequenceFeature()\r
41     {}\r
42 \r
43     public SequenceFeature(String type,\r
44                            String desc,\r
45                            String status,\r
46                            int begin, int end,\r
47                            String featureGroup)\r
48     {\r
49       this.type = type;\r
50       this.description = desc;\r
51       this.status = status;\r
52       this.position = begin;\r
53       this.begin = begin;\r
54       this.end = end;\r
55       this.featureGroup = featureGroup;\r
56     }\r
57 \r
58     public boolean equals(SequenceFeature sf)\r
59     {\r
60       if(begin != sf.begin\r
61       || end != sf.end)\r
62      return false;\r
63 \r
64 \r
65       if(!(type+description+status).equals\r
66          (sf.type+sf.description+sf.status))\r
67         return false;\r
68 \r
69       return true;\r
70     }\r
71 \r
72 \r
73     public int getPosition()\r
74     {\r
75       return position;\r
76     }\r
77 \r
78     public void setPosition(int pos)\r
79     {\r
80       position = pos;\r
81       begin = pos;\r
82       end = pos;\r
83     }\r
84 \r
85 \r
86     /**\r
87      * DOCUMENT ME!\r
88      *\r
89      * @return DOCUMENT ME!\r
90      */\r
91     public int getBegin()\r
92     {\r
93         return begin;\r
94     }\r
95 \r
96     public void setBegin(int start)\r
97     {\r
98       this.begin = start;\r
99     }\r
100 \r
101     /**\r
102      * DOCUMENT ME!\r
103      *\r
104      * @return DOCUMENT ME!\r
105      */\r
106     public int getEnd()\r
107     {\r
108         return end;\r
109     }\r
110 \r
111     public void setEnd(int end)\r
112     {\r
113       this.end = end;\r
114     }\r
115 \r
116     /**\r
117      * DOCUMENT ME!\r
118      *\r
119      * @return DOCUMENT ME!\r
120      */\r
121     public String getType()\r
122     {\r
123         return type;\r
124     }\r
125 \r
126     public void setType(String type)\r
127     {\r
128       this.type = type;\r
129     }\r
130 \r
131     /**\r
132      * DOCUMENT ME!\r
133      *\r
134      * @return DOCUMENT ME!\r
135      */\r
136     public String getDescription()\r
137     {\r
138         return description;\r
139     }\r
140 \r
141     public void setDescription(String desc)\r
142     {\r
143       description = desc;\r
144     }\r
145 \r
146     /**\r
147      * DOCUMENT ME!\r
148      *\r
149      * @return DOCUMENT ME!\r
150      */\r
151     public String getStatus()\r
152     {\r
153         return status;\r
154     }\r
155 \r
156     public void setStatus(String status)\r
157     {\r
158       this.status = status;\r
159     }\r
160 \r
161     public String getFeatureGroup()\r
162     {\r
163       return featureGroup;\r
164     }\r
165 \r
166     public void setFeatureGroup(String featureGroup)\r
167     {\r
168       this.featureGroup = featureGroup;\r
169     }\r
170 \r
171 \r
172 }\r