2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class VAMSAS implements java.io.Serializable {
25 //--------------------------/
26 //- Class/Member Variables -/
27 //--------------------------/
32 private java.util.Vector _treeList;
35 * Field _sequenceSetList.
37 private java.util.Vector _sequenceSetList;
46 this._treeList = new java.util.Vector();
47 this._sequenceSetList = new java.util.Vector();
59 * @throws java.lang.IndexOutOfBoundsException if the index
60 * given is outside the bounds of the collection
62 public void addSequenceSet(
63 final jalview.schemabinding.version2.SequenceSet vSequenceSet)
64 throws java.lang.IndexOutOfBoundsException {
65 this._sequenceSetList.addElement(vSequenceSet);
73 * @throws java.lang.IndexOutOfBoundsException if the index
74 * given is outside the bounds of the collection
76 public void addSequenceSet(
78 final jalview.schemabinding.version2.SequenceSet vSequenceSet)
79 throws java.lang.IndexOutOfBoundsException {
80 this._sequenceSetList.add(index, vSequenceSet);
87 * @throws java.lang.IndexOutOfBoundsException if the index
88 * given is outside the bounds of the collection
91 final java.lang.String vTree)
92 throws java.lang.IndexOutOfBoundsException {
93 this._treeList.addElement(vTree);
101 * @throws java.lang.IndexOutOfBoundsException if the index
102 * given is outside the bounds of the collection
106 final java.lang.String vTree)
107 throws java.lang.IndexOutOfBoundsException {
108 this._treeList.add(index, vTree);
112 * Method enumerateSequenceSet.
114 * @return an Enumeration over all
115 * jalview.schemabinding.version2.SequenceSet elements
117 public java.util.Enumeration enumerateSequenceSet(
119 return this._sequenceSetList.elements();
123 * Method enumerateTree.
125 * @return an Enumeration over all java.lang.String elements
127 public java.util.Enumeration enumerateTree(
129 return this._treeList.elements();
133 * Method getSequenceSet.
136 * @throws java.lang.IndexOutOfBoundsException if the index
137 * given is outside the bounds of the collection
138 * @return the value of the
139 * jalview.schemabinding.version2.SequenceSet at the given index
141 public jalview.schemabinding.version2.SequenceSet getSequenceSet(
143 throws java.lang.IndexOutOfBoundsException {
144 // check bounds for index
145 if (index < 0 || index >= this._sequenceSetList.size()) {
146 throw new IndexOutOfBoundsException("getSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
149 return (jalview.schemabinding.version2.SequenceSet) _sequenceSetList.get(index);
153 * Method getSequenceSet.Returns the contents of the collection
154 * in an Array. <p>Note: Just in case the collection contents
155 * are changing in another thread, we pass a 0-length Array of
156 * the correct type into the API call. This way we <i>know</i>
157 * that the Array returned is of exactly the correct length.
159 * @return this collection as an Array
161 public jalview.schemabinding.version2.SequenceSet[] getSequenceSet(
163 jalview.schemabinding.version2.SequenceSet[] array = new jalview.schemabinding.version2.SequenceSet[0];
164 return (jalview.schemabinding.version2.SequenceSet[]) this._sequenceSetList.toArray(array);
168 * Method getSequenceSetCount.
170 * @return the size of this collection
172 public int getSequenceSetCount(
174 return this._sequenceSetList.size();
181 * @throws java.lang.IndexOutOfBoundsException if the index
182 * given is outside the bounds of the collection
183 * @return the value of the java.lang.String at the given index
185 public java.lang.String getTree(
187 throws java.lang.IndexOutOfBoundsException {
188 // check bounds for index
189 if (index < 0 || index >= this._treeList.size()) {
190 throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
193 return (java.lang.String) _treeList.get(index);
197 * Method getTree.Returns the contents of the collection in an
198 * Array. <p>Note: Just in case the collection contents are
199 * changing in another thread, we pass a 0-length Array of the
200 * correct type into the API call. This way we <i>know</i>
201 * that the Array returned is of exactly the correct length.
203 * @return this collection as an Array
205 public java.lang.String[] getTree(
207 java.lang.String[] array = new java.lang.String[0];
208 return (java.lang.String[]) this._treeList.toArray(array);
212 * Method getTreeCount.
214 * @return the size of this collection
216 public int getTreeCount(
218 return this._treeList.size();
224 * @return true if this object is valid according to the schema
226 public boolean isValid(
230 } catch (org.exolab.castor.xml.ValidationException vex) {
240 * @throws org.exolab.castor.xml.MarshalException if object is
241 * null or if any SAXException is thrown during marshaling
242 * @throws org.exolab.castor.xml.ValidationException if this
243 * object is an invalid instance according to the schema
246 final java.io.Writer out)
247 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
248 Marshaller.marshal(this, out);
255 * @throws java.io.IOException if an IOException occurs during
257 * @throws org.exolab.castor.xml.ValidationException if this
258 * object is an invalid instance according to the schema
259 * @throws org.exolab.castor.xml.MarshalException if object is
260 * null or if any SAXException is thrown during marshaling
263 final org.xml.sax.ContentHandler handler)
264 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
265 Marshaller.marshal(this, handler);
270 public void removeAllSequenceSet(
272 this._sequenceSetList.clear();
277 public void removeAllTree(
279 this._treeList.clear();
283 * Method removeSequenceSet.
285 * @param vSequenceSet
286 * @return true if the object was removed from the collection.
288 public boolean removeSequenceSet(
289 final jalview.schemabinding.version2.SequenceSet vSequenceSet) {
290 boolean removed = _sequenceSetList.remove(vSequenceSet);
295 * Method removeSequenceSetAt.
298 * @return the element removed from the collection
300 public jalview.schemabinding.version2.SequenceSet removeSequenceSetAt(
302 java.lang.Object obj = this._sequenceSetList.remove(index);
303 return (jalview.schemabinding.version2.SequenceSet) obj;
310 * @return true if the object was removed from the collection.
312 public boolean removeTree(
313 final java.lang.String vTree) {
314 boolean removed = _treeList.remove(vTree);
319 * Method removeTreeAt.
322 * @return the element removed from the collection
324 public java.lang.String removeTreeAt(
326 java.lang.Object obj = this._treeList.remove(index);
327 return (java.lang.String) obj;
334 * @param vSequenceSet
335 * @throws java.lang.IndexOutOfBoundsException if the index
336 * given is outside the bounds of the collection
338 public void setSequenceSet(
340 final jalview.schemabinding.version2.SequenceSet vSequenceSet)
341 throws java.lang.IndexOutOfBoundsException {
342 // check bounds for index
343 if (index < 0 || index >= this._sequenceSetList.size()) {
344 throw new IndexOutOfBoundsException("setSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
347 this._sequenceSetList.set(index, vSequenceSet);
353 * @param vSequenceSetArray
355 public void setSequenceSet(
356 final jalview.schemabinding.version2.SequenceSet[] vSequenceSetArray) {
358 _sequenceSetList.clear();
360 for (int i = 0; i < vSequenceSetArray.length; i++) {
361 this._sequenceSetList.add(vSequenceSetArray[i]);
370 * @throws java.lang.IndexOutOfBoundsException if the index
371 * given is outside the bounds of the collection
375 final java.lang.String vTree)
376 throws java.lang.IndexOutOfBoundsException {
377 // check bounds for index
378 if (index < 0 || index >= this._treeList.size()) {
379 throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
382 this._treeList.set(index, vTree);
391 final java.lang.String[] vTreeArray) {
395 for (int i = 0; i < vTreeArray.length; i++) {
396 this._treeList.add(vTreeArray[i]);
404 * @throws org.exolab.castor.xml.MarshalException if object is
405 * null or if any SAXException is thrown during marshaling
406 * @throws org.exolab.castor.xml.ValidationException if this
407 * object is an invalid instance according to the schema
408 * @return the unmarshaled jalview.schemabinding.version2.VAMSAS
410 public static jalview.schemabinding.version2.VAMSAS unmarshal(
411 final java.io.Reader reader)
412 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
413 return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal(jalview.schemabinding.version2.VAMSAS.class, reader);
419 * @throws org.exolab.castor.xml.ValidationException if this
420 * object is an invalid instance according to the schema
422 public void validate(
424 throws org.exolab.castor.xml.ValidationException {
425 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
426 validator.validate(this);