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;
18 * Class JalviewModelSequence.
20 * @version $Revision$ $Date$
22 public class JalviewModelSequence implements java.io.Serializable {
25 //--------------------------/
26 //- Class/Member Variables -/
27 //--------------------------/
32 private java.util.Vector _JSeqList;
37 private java.util.Vector _JGroupList;
40 * Field _viewportList.
42 private java.util.Vector _viewportList;
45 * Field _userColoursList.
47 private java.util.Vector _userColoursList;
52 private java.util.Vector _treeList;
55 * Field _featureSettings.
57 private jalview.schemabinding.version2.FeatureSettings _featureSettings;
64 public JalviewModelSequence() {
66 this._JSeqList = new java.util.Vector();
67 this._JGroupList = new java.util.Vector();
68 this._viewportList = new java.util.Vector();
69 this._userColoursList = new java.util.Vector();
70 this._treeList = new java.util.Vector();
82 * @throws java.lang.IndexOutOfBoundsException if the index
83 * given is outside the bounds of the collection
85 public void addJGroup(
86 final jalview.schemabinding.version2.JGroup vJGroup)
87 throws java.lang.IndexOutOfBoundsException {
88 this._JGroupList.addElement(vJGroup);
96 * @throws java.lang.IndexOutOfBoundsException if the index
97 * given is outside the bounds of the collection
99 public void addJGroup(
101 final jalview.schemabinding.version2.JGroup vJGroup)
102 throws java.lang.IndexOutOfBoundsException {
103 this._JGroupList.add(index, vJGroup);
110 * @throws java.lang.IndexOutOfBoundsException if the index
111 * given is outside the bounds of the collection
114 final jalview.schemabinding.version2.JSeq vJSeq)
115 throws java.lang.IndexOutOfBoundsException {
116 this._JSeqList.addElement(vJSeq);
124 * @throws java.lang.IndexOutOfBoundsException if the index
125 * given is outside the bounds of the collection
129 final jalview.schemabinding.version2.JSeq vJSeq)
130 throws java.lang.IndexOutOfBoundsException {
131 this._JSeqList.add(index, vJSeq);
138 * @throws java.lang.IndexOutOfBoundsException if the index
139 * given is outside the bounds of the collection
142 final jalview.schemabinding.version2.Tree vTree)
143 throws java.lang.IndexOutOfBoundsException {
144 this._treeList.addElement(vTree);
152 * @throws java.lang.IndexOutOfBoundsException if the index
153 * given is outside the bounds of the collection
157 final jalview.schemabinding.version2.Tree vTree)
158 throws java.lang.IndexOutOfBoundsException {
159 this._treeList.add(index, vTree);
165 * @param vUserColours
166 * @throws java.lang.IndexOutOfBoundsException if the index
167 * given is outside the bounds of the collection
169 public void addUserColours(
170 final jalview.schemabinding.version2.UserColours vUserColours)
171 throws java.lang.IndexOutOfBoundsException {
172 this._userColoursList.addElement(vUserColours);
179 * @param vUserColours
180 * @throws java.lang.IndexOutOfBoundsException if the index
181 * given is outside the bounds of the collection
183 public void addUserColours(
185 final jalview.schemabinding.version2.UserColours vUserColours)
186 throws java.lang.IndexOutOfBoundsException {
187 this._userColoursList.add(index, vUserColours);
194 * @throws java.lang.IndexOutOfBoundsException if the index
195 * given is outside the bounds of the collection
197 public void addViewport(
198 final jalview.schemabinding.version2.Viewport vViewport)
199 throws java.lang.IndexOutOfBoundsException {
200 this._viewportList.addElement(vViewport);
208 * @throws java.lang.IndexOutOfBoundsException if the index
209 * given is outside the bounds of the collection
211 public void addViewport(
213 final jalview.schemabinding.version2.Viewport vViewport)
214 throws java.lang.IndexOutOfBoundsException {
215 this._viewportList.add(index, vViewport);
219 * Method enumerateJGroup.
221 * @return an Enumeration over all
222 * jalview.schemabinding.version2.JGroup elements
224 public java.util.Enumeration enumerateJGroup(
226 return this._JGroupList.elements();
230 * Method enumerateJSeq.
232 * @return an Enumeration over all
233 * jalview.schemabinding.version2.JSeq elements
235 public java.util.Enumeration enumerateJSeq(
237 return this._JSeqList.elements();
241 * Method enumerateTree.
243 * @return an Enumeration over all
244 * jalview.schemabinding.version2.Tree elements
246 public java.util.Enumeration enumerateTree(
248 return this._treeList.elements();
252 * Method enumerateUserColours.
254 * @return an Enumeration over all
255 * jalview.schemabinding.version2.UserColours elements
257 public java.util.Enumeration enumerateUserColours(
259 return this._userColoursList.elements();
263 * Method enumerateViewport.
265 * @return an Enumeration over all
266 * jalview.schemabinding.version2.Viewport elements
268 public java.util.Enumeration enumerateViewport(
270 return this._viewportList.elements();
274 * Returns the value of field 'featureSettings'.
276 * @return the value of field 'FeatureSettings'.
278 public jalview.schemabinding.version2.FeatureSettings getFeatureSettings(
280 return this._featureSettings;
287 * @throws java.lang.IndexOutOfBoundsException if the index
288 * given is outside the bounds of the collection
289 * @return the value of the
290 * jalview.schemabinding.version2.JGroup at the given index
292 public jalview.schemabinding.version2.JGroup getJGroup(
294 throws java.lang.IndexOutOfBoundsException {
295 // check bounds for index
296 if (index < 0 || index >= this._JGroupList.size()) {
297 throw new IndexOutOfBoundsException("getJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]");
300 return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index);
304 * Method getJGroup.Returns the contents of the collection in
305 * an Array. <p>Note: Just in case the collection contents
306 * are changing in another thread, we pass a 0-length Array of
307 * the correct type into the API call. This way we <i>know</i>
308 * that the Array returned is of exactly the correct length.
310 * @return this collection as an Array
312 public jalview.schemabinding.version2.JGroup[] getJGroup(
314 jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0];
315 return (jalview.schemabinding.version2.JGroup[]) this._JGroupList.toArray(array);
319 * Method getJGroupCount.
321 * @return the size of this collection
323 public int getJGroupCount(
325 return this._JGroupList.size();
332 * @throws java.lang.IndexOutOfBoundsException if the index
333 * given is outside the bounds of the collection
334 * @return the value of the jalview.schemabinding.version2.JSeq
337 public jalview.schemabinding.version2.JSeq getJSeq(
339 throws java.lang.IndexOutOfBoundsException {
340 // check bounds for index
341 if (index < 0 || index >= this._JSeqList.size()) {
342 throw new IndexOutOfBoundsException("getJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
345 return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index);
349 * Method getJSeq.Returns the contents of the collection in an
350 * Array. <p>Note: Just in case the collection contents are
351 * changing in another thread, we pass a 0-length Array of the
352 * correct type into the API call. This way we <i>know</i>
353 * that the Array returned is of exactly the correct length.
355 * @return this collection as an Array
357 public jalview.schemabinding.version2.JSeq[] getJSeq(
359 jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0];
360 return (jalview.schemabinding.version2.JSeq[]) this._JSeqList.toArray(array);
364 * Method getJSeqCount.
366 * @return the size of this collection
368 public int getJSeqCount(
370 return this._JSeqList.size();
377 * @throws java.lang.IndexOutOfBoundsException if the index
378 * given is outside the bounds of the collection
379 * @return the value of the jalview.schemabinding.version2.Tree
382 public jalview.schemabinding.version2.Tree getTree(
384 throws java.lang.IndexOutOfBoundsException {
385 // check bounds for index
386 if (index < 0 || index >= this._treeList.size()) {
387 throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
390 return (jalview.schemabinding.version2.Tree) _treeList.get(index);
394 * Method getTree.Returns the contents of the collection in an
395 * Array. <p>Note: Just in case the collection contents are
396 * changing in another thread, we pass a 0-length Array of the
397 * correct type into the API call. This way we <i>know</i>
398 * that the Array returned is of exactly the correct length.
400 * @return this collection as an Array
402 public jalview.schemabinding.version2.Tree[] getTree(
404 jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0];
405 return (jalview.schemabinding.version2.Tree[]) this._treeList.toArray(array);
409 * Method getTreeCount.
411 * @return the size of this collection
413 public int getTreeCount(
415 return this._treeList.size();
419 * Method getUserColours.
422 * @throws java.lang.IndexOutOfBoundsException if the index
423 * given is outside the bounds of the collection
424 * @return the value of the
425 * jalview.schemabinding.version2.UserColours at the given index
427 public jalview.schemabinding.version2.UserColours getUserColours(
429 throws java.lang.IndexOutOfBoundsException {
430 // check bounds for index
431 if (index < 0 || index >= this._userColoursList.size()) {
432 throw new IndexOutOfBoundsException("getUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]");
435 return (jalview.schemabinding.version2.UserColours) _userColoursList.get(index);
439 * Method getUserColours.Returns the contents of the collection
440 * in an Array. <p>Note: Just in case the collection contents
441 * are changing in another thread, we pass a 0-length Array of
442 * the correct type into the API call. This way we <i>know</i>
443 * that the Array returned is of exactly the correct length.
445 * @return this collection as an Array
447 public jalview.schemabinding.version2.UserColours[] getUserColours(
449 jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0];
450 return (jalview.schemabinding.version2.UserColours[]) this._userColoursList.toArray(array);
454 * Method getUserColoursCount.
456 * @return the size of this collection
458 public int getUserColoursCount(
460 return this._userColoursList.size();
464 * Method getViewport.
467 * @throws java.lang.IndexOutOfBoundsException if the index
468 * given is outside the bounds of the collection
469 * @return the value of the
470 * jalview.schemabinding.version2.Viewport at the given index
472 public jalview.schemabinding.version2.Viewport getViewport(
474 throws java.lang.IndexOutOfBoundsException {
475 // check bounds for index
476 if (index < 0 || index >= this._viewportList.size()) {
477 throw new IndexOutOfBoundsException("getViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]");
480 return (jalview.schemabinding.version2.Viewport) _viewportList.get(index);
484 * Method getViewport.Returns the contents of the collection in
485 * an Array. <p>Note: Just in case the collection contents
486 * are changing in another thread, we pass a 0-length Array of
487 * the correct type into the API call. This way we <i>know</i>
488 * that the Array returned is of exactly the correct length.
490 * @return this collection as an Array
492 public jalview.schemabinding.version2.Viewport[] getViewport(
494 jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0];
495 return (jalview.schemabinding.version2.Viewport[]) this._viewportList.toArray(array);
499 * Method getViewportCount.
501 * @return the size of this collection
503 public int getViewportCount(
505 return this._viewportList.size();
511 * @return true if this object is valid according to the schema
513 public boolean isValid(
517 } catch (org.exolab.castor.xml.ValidationException vex) {
527 * @throws org.exolab.castor.xml.MarshalException if object is
528 * null or if any SAXException is thrown during marshaling
529 * @throws org.exolab.castor.xml.ValidationException if this
530 * object is an invalid instance according to the schema
533 final java.io.Writer out)
534 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
535 Marshaller.marshal(this, out);
542 * @throws java.io.IOException if an IOException occurs during
544 * @throws org.exolab.castor.xml.ValidationException if this
545 * object is an invalid instance according to the schema
546 * @throws org.exolab.castor.xml.MarshalException if object is
547 * null or if any SAXException is thrown during marshaling
550 final org.xml.sax.ContentHandler handler)
551 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
552 Marshaller.marshal(this, handler);
557 public void removeAllJGroup(
559 this._JGroupList.clear();
564 public void removeAllJSeq(
566 this._JSeqList.clear();
571 public void removeAllTree(
573 this._treeList.clear();
578 public void removeAllUserColours(
580 this._userColoursList.clear();
585 public void removeAllViewport(
587 this._viewportList.clear();
591 * Method removeJGroup.
594 * @return true if the object was removed from the collection.
596 public boolean removeJGroup(
597 final jalview.schemabinding.version2.JGroup vJGroup) {
598 boolean removed = _JGroupList.remove(vJGroup);
603 * Method removeJGroupAt.
606 * @return the element removed from the collection
608 public jalview.schemabinding.version2.JGroup removeJGroupAt(
610 java.lang.Object obj = this._JGroupList.remove(index);
611 return (jalview.schemabinding.version2.JGroup) obj;
618 * @return true if the object was removed from the collection.
620 public boolean removeJSeq(
621 final jalview.schemabinding.version2.JSeq vJSeq) {
622 boolean removed = _JSeqList.remove(vJSeq);
627 * Method removeJSeqAt.
630 * @return the element removed from the collection
632 public jalview.schemabinding.version2.JSeq removeJSeqAt(
634 java.lang.Object obj = this._JSeqList.remove(index);
635 return (jalview.schemabinding.version2.JSeq) obj;
642 * @return true if the object was removed from the collection.
644 public boolean removeTree(
645 final jalview.schemabinding.version2.Tree vTree) {
646 boolean removed = _treeList.remove(vTree);
651 * Method removeTreeAt.
654 * @return the element removed from the collection
656 public jalview.schemabinding.version2.Tree removeTreeAt(
658 java.lang.Object obj = this._treeList.remove(index);
659 return (jalview.schemabinding.version2.Tree) obj;
663 * Method removeUserColours.
665 * @param vUserColours
666 * @return true if the object was removed from the collection.
668 public boolean removeUserColours(
669 final jalview.schemabinding.version2.UserColours vUserColours) {
670 boolean removed = _userColoursList.remove(vUserColours);
675 * Method removeUserColoursAt.
678 * @return the element removed from the collection
680 public jalview.schemabinding.version2.UserColours removeUserColoursAt(
682 java.lang.Object obj = this._userColoursList.remove(index);
683 return (jalview.schemabinding.version2.UserColours) obj;
687 * Method removeViewport.
690 * @return true if the object was removed from the collection.
692 public boolean removeViewport(
693 final jalview.schemabinding.version2.Viewport vViewport) {
694 boolean removed = _viewportList.remove(vViewport);
699 * Method removeViewportAt.
702 * @return the element removed from the collection
704 public jalview.schemabinding.version2.Viewport removeViewportAt(
706 java.lang.Object obj = this._viewportList.remove(index);
707 return (jalview.schemabinding.version2.Viewport) obj;
711 * Sets the value of field 'featureSettings'.
713 * @param featureSettings the value of field 'featureSettings'.
715 public void setFeatureSettings(
716 final jalview.schemabinding.version2.FeatureSettings featureSettings) {
717 this._featureSettings = featureSettings;
725 * @throws java.lang.IndexOutOfBoundsException if the index
726 * given is outside the bounds of the collection
728 public void setJGroup(
730 final jalview.schemabinding.version2.JGroup vJGroup)
731 throws java.lang.IndexOutOfBoundsException {
732 // check bounds for index
733 if (index < 0 || index >= this._JGroupList.size()) {
734 throw new IndexOutOfBoundsException("setJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]");
737 this._JGroupList.set(index, vJGroup);
743 * @param vJGroupArray
745 public void setJGroup(
746 final jalview.schemabinding.version2.JGroup[] vJGroupArray) {
750 for (int i = 0; i < vJGroupArray.length; i++) {
751 this._JGroupList.add(vJGroupArray[i]);
760 * @throws java.lang.IndexOutOfBoundsException if the index
761 * given is outside the bounds of the collection
765 final jalview.schemabinding.version2.JSeq vJSeq)
766 throws java.lang.IndexOutOfBoundsException {
767 // check bounds for index
768 if (index < 0 || index >= this._JSeqList.size()) {
769 throw new IndexOutOfBoundsException("setJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
772 this._JSeqList.set(index, vJSeq);
781 final jalview.schemabinding.version2.JSeq[] vJSeqArray) {
785 for (int i = 0; i < vJSeqArray.length; i++) {
786 this._JSeqList.add(vJSeqArray[i]);
795 * @throws java.lang.IndexOutOfBoundsException if the index
796 * given is outside the bounds of the collection
800 final jalview.schemabinding.version2.Tree vTree)
801 throws java.lang.IndexOutOfBoundsException {
802 // check bounds for index
803 if (index < 0 || index >= this._treeList.size()) {
804 throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
807 this._treeList.set(index, vTree);
816 final jalview.schemabinding.version2.Tree[] vTreeArray) {
820 for (int i = 0; i < vTreeArray.length; i++) {
821 this._treeList.add(vTreeArray[i]);
829 * @param vUserColours
830 * @throws java.lang.IndexOutOfBoundsException if the index
831 * given is outside the bounds of the collection
833 public void setUserColours(
835 final jalview.schemabinding.version2.UserColours vUserColours)
836 throws java.lang.IndexOutOfBoundsException {
837 // check bounds for index
838 if (index < 0 || index >= this._userColoursList.size()) {
839 throw new IndexOutOfBoundsException("setUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]");
842 this._userColoursList.set(index, vUserColours);
848 * @param vUserColoursArray
850 public void setUserColours(
851 final jalview.schemabinding.version2.UserColours[] vUserColoursArray) {
853 _userColoursList.clear();
855 for (int i = 0; i < vUserColoursArray.length; i++) {
856 this._userColoursList.add(vUserColoursArray[i]);
865 * @throws java.lang.IndexOutOfBoundsException if the index
866 * given is outside the bounds of the collection
868 public void setViewport(
870 final jalview.schemabinding.version2.Viewport vViewport)
871 throws java.lang.IndexOutOfBoundsException {
872 // check bounds for index
873 if (index < 0 || index >= this._viewportList.size()) {
874 throw new IndexOutOfBoundsException("setViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]");
877 this._viewportList.set(index, vViewport);
883 * @param vViewportArray
885 public void setViewport(
886 final jalview.schemabinding.version2.Viewport[] vViewportArray) {
888 _viewportList.clear();
890 for (int i = 0; i < vViewportArray.length; i++) {
891 this._viewportList.add(vViewportArray[i]);
899 * @throws org.exolab.castor.xml.MarshalException if object is
900 * null or if any SAXException is thrown during marshaling
901 * @throws org.exolab.castor.xml.ValidationException if this
902 * object is an invalid instance according to the schema
903 * @return the unmarshaled
904 * jalview.schemabinding.version2.JalviewModelSequence
906 public static jalview.schemabinding.version2.JalviewModelSequence unmarshal(
907 final java.io.Reader reader)
908 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
909 return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller.unmarshal(jalview.schemabinding.version2.JalviewModelSequence.class, reader);
915 * @throws org.exolab.castor.xml.ValidationException if this
916 * object is an invalid instance according to the schema
918 public void validate(
920 throws org.exolab.castor.xml.ValidationException {
921 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
922 validator.validate(this);