added aligned codon frames, and dataset reference ids for sequenceSet and sequences...
[jalview.git] / src / jalview / schemabinding / version2 / Sequence.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package jalview.schemabinding.version2;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import org.exolab.castor.xml.Marshaller;\r
15 import org.exolab.castor.xml.Unmarshaller;\r
16 \r
17 /**\r
18  * Class Sequence.\r
19  * \r
20  * @version $Revision$ $Date$\r
21  */\r
22 public class Sequence extends jalview.schemabinding.version2.SequenceType \r
23 implements java.io.Serializable\r
24 {\r
25 \r
26 \r
27       //--------------------------/\r
28      //- Class/Member Variables -/\r
29     //--------------------------/\r
30 \r
31     /**\r
32      * dataset sequence id for this sequence. Will be created as\r
33      * union of sequences.\r
34      *  \r
35      */\r
36     private java.lang.String _dsseqid;\r
37 \r
38     /**\r
39      * Field _DBRefList.\r
40      */\r
41     private java.util.Vector _DBRefList;\r
42 \r
43 \r
44       //----------------/\r
45      //- Constructors -/\r
46     //----------------/\r
47 \r
48     public Sequence() {\r
49         super();\r
50         this._DBRefList = new java.util.Vector();\r
51     }\r
52 \r
53 \r
54       //-----------/\r
55      //- Methods -/\r
56     //-----------/\r
57 \r
58     /**\r
59      * \r
60      * \r
61      * @param vDBRef\r
62      * @throws java.lang.IndexOutOfBoundsException if the index\r
63      * given is outside the bounds of the collection\r
64      */\r
65     public void addDBRef(\r
66             final jalview.schemabinding.version2.DBRef vDBRef)\r
67     throws java.lang.IndexOutOfBoundsException {\r
68         this._DBRefList.addElement(vDBRef);\r
69     }\r
70 \r
71     /**\r
72      * \r
73      * \r
74      * @param index\r
75      * @param vDBRef\r
76      * @throws java.lang.IndexOutOfBoundsException if the index\r
77      * given is outside the bounds of the collection\r
78      */\r
79     public void addDBRef(\r
80             final int index,\r
81             final jalview.schemabinding.version2.DBRef vDBRef)\r
82     throws java.lang.IndexOutOfBoundsException {\r
83         this._DBRefList.add(index, vDBRef);\r
84     }\r
85 \r
86     /**\r
87      * Method enumerateDBRef.\r
88      * \r
89      * @return an Enumeration over all\r
90      * jalview.schemabinding.version2.DBRef elements\r
91      */\r
92     public java.util.Enumeration enumerateDBRef(\r
93     ) {\r
94         return this._DBRefList.elements();\r
95     }\r
96 \r
97     /**\r
98      * Method getDBRef.\r
99      * \r
100      * @param index\r
101      * @throws java.lang.IndexOutOfBoundsException if the index\r
102      * given is outside the bounds of the collection\r
103      * @return the value of the\r
104      * jalview.schemabinding.version2.DBRef at the given index\r
105      */\r
106     public jalview.schemabinding.version2.DBRef getDBRef(\r
107             final int index)\r
108     throws java.lang.IndexOutOfBoundsException {\r
109         // check bounds for index\r
110         if (index < 0 || index >= this._DBRefList.size()) {\r
111             throw new IndexOutOfBoundsException("getDBRef: Index value '" + index + "' not in range [0.." + (this._DBRefList.size() - 1) + "]");\r
112         }\r
113         \r
114         return (jalview.schemabinding.version2.DBRef) _DBRefList.get(index);\r
115     }\r
116 \r
117     /**\r
118      * Method getDBRef.Returns the contents of the collection in an\r
119      * Array.  <p>Note:  Just in case the collection contents are\r
120      * changing in another thread, we pass a 0-length Array of the\r
121      * correct type into the API call.  This way we <i>know</i>\r
122      * that the Array returned is of exactly the correct length.\r
123      * \r
124      * @return this collection as an Array\r
125      */\r
126     public jalview.schemabinding.version2.DBRef[] getDBRef(\r
127     ) {\r
128         jalview.schemabinding.version2.DBRef[] array = new jalview.schemabinding.version2.DBRef[0];\r
129         return (jalview.schemabinding.version2.DBRef[]) this._DBRefList.toArray(array);\r
130     }\r
131 \r
132     /**\r
133      * Method getDBRefCount.\r
134      * \r
135      * @return the size of this collection\r
136      */\r
137     public int getDBRefCount(\r
138     ) {\r
139         return this._DBRefList.size();\r
140     }\r
141 \r
142     /**\r
143      * Returns the value of field 'dsseqid'. The field 'dsseqid'\r
144      * has the following description: dataset sequence id for this\r
145      * sequence. Will be created as union of sequences.\r
146      *  \r
147      * \r
148      * @return the value of field 'Dsseqid'.\r
149      */\r
150     public java.lang.String getDsseqid(\r
151     ) {\r
152         return this._dsseqid;\r
153     }\r
154 \r
155     /**\r
156      * Method isValid.\r
157      * \r
158      * @return true if this object is valid according to the schema\r
159      */\r
160     public boolean isValid(\r
161     ) {\r
162         try {\r
163             validate();\r
164         } catch (org.exolab.castor.xml.ValidationException vex) {\r
165             return false;\r
166         }\r
167         return true;\r
168     }\r
169 \r
170     /**\r
171      * \r
172      * \r
173      * @param out\r
174      * @throws org.exolab.castor.xml.MarshalException if object is\r
175      * null or if any SAXException is thrown during marshaling\r
176      * @throws org.exolab.castor.xml.ValidationException if this\r
177      * object is an invalid instance according to the schema\r
178      */\r
179     public void marshal(\r
180             final java.io.Writer out)\r
181     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
182         Marshaller.marshal(this, out);\r
183     }\r
184 \r
185     /**\r
186      * \r
187      * \r
188      * @param handler\r
189      * @throws java.io.IOException if an IOException occurs during\r
190      * marshaling\r
191      * @throws org.exolab.castor.xml.ValidationException if this\r
192      * object is an invalid instance according to the schema\r
193      * @throws org.exolab.castor.xml.MarshalException if object is\r
194      * null or if any SAXException is thrown during marshaling\r
195      */\r
196     public void marshal(\r
197             final org.xml.sax.ContentHandler handler)\r
198     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
199         Marshaller.marshal(this, handler);\r
200     }\r
201 \r
202     /**\r
203      */\r
204     public void removeAllDBRef(\r
205     ) {\r
206         this._DBRefList.clear();\r
207     }\r
208 \r
209     /**\r
210      * Method removeDBRef.\r
211      * \r
212      * @param vDBRef\r
213      * @return true if the object was removed from the collection.\r
214      */\r
215     public boolean removeDBRef(\r
216             final jalview.schemabinding.version2.DBRef vDBRef) {\r
217         boolean removed = _DBRefList.remove(vDBRef);\r
218         return removed;\r
219     }\r
220 \r
221     /**\r
222      * Method removeDBRefAt.\r
223      * \r
224      * @param index\r
225      * @return the element removed from the collection\r
226      */\r
227     public jalview.schemabinding.version2.DBRef removeDBRefAt(\r
228             final int index) {\r
229         java.lang.Object obj = this._DBRefList.remove(index);\r
230         return (jalview.schemabinding.version2.DBRef) obj;\r
231     }\r
232 \r
233     /**\r
234      * \r
235      * \r
236      * @param index\r
237      * @param vDBRef\r
238      * @throws java.lang.IndexOutOfBoundsException if the index\r
239      * given is outside the bounds of the collection\r
240      */\r
241     public void setDBRef(\r
242             final int index,\r
243             final jalview.schemabinding.version2.DBRef vDBRef)\r
244     throws java.lang.IndexOutOfBoundsException {\r
245         // check bounds for index\r
246         if (index < 0 || index >= this._DBRefList.size()) {\r
247             throw new IndexOutOfBoundsException("setDBRef: Index value '" + index + "' not in range [0.." + (this._DBRefList.size() - 1) + "]");\r
248         }\r
249         \r
250         this._DBRefList.set(index, vDBRef);\r
251     }\r
252 \r
253     /**\r
254      * \r
255      * \r
256      * @param vDBRefArray\r
257      */\r
258     public void setDBRef(\r
259             final jalview.schemabinding.version2.DBRef[] vDBRefArray) {\r
260         //-- copy array\r
261         _DBRefList.clear();\r
262         \r
263         for (int i = 0; i < vDBRefArray.length; i++) {\r
264                 this._DBRefList.add(vDBRefArray[i]);\r
265         }\r
266     }\r
267 \r
268     /**\r
269      * Sets the value of field 'dsseqid'. The field 'dsseqid' has\r
270      * the following description: dataset sequence id for this\r
271      * sequence. Will be created as union of sequences.\r
272      *  \r
273      * \r
274      * @param dsseqid the value of field 'dsseqid'.\r
275      */\r
276     public void setDsseqid(\r
277             final java.lang.String dsseqid) {\r
278         this._dsseqid = dsseqid;\r
279     }\r
280 \r
281     /**\r
282      * Method unmarshal.\r
283      * \r
284      * @param reader\r
285      * @throws org.exolab.castor.xml.MarshalException if object is\r
286      * null or if any SAXException is thrown during marshaling\r
287      * @throws org.exolab.castor.xml.ValidationException if this\r
288      * object is an invalid instance according to the schema\r
289      * @return the unmarshaled\r
290      * jalview.schemabinding.version2.SequenceType\r
291      */\r
292     public static jalview.schemabinding.version2.SequenceType unmarshal(\r
293             final java.io.Reader reader)\r
294     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
295         return (jalview.schemabinding.version2.SequenceType) Unmarshaller.unmarshal(jalview.schemabinding.version2.Sequence.class, reader);\r
296     }\r
297 \r
298     /**\r
299      * \r
300      * \r
301      * @throws org.exolab.castor.xml.ValidationException if this\r
302      * object is an invalid instance according to the schema\r
303      */\r
304     public void validate(\r
305     )\r
306     throws org.exolab.castor.xml.ValidationException {\r
307         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
308         validator.validate(this);\r
309     }\r
310 \r
311 }\r