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