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;
60 * List of external trees
62 private java.util.Vector<jalview.ext.treeviewer.TreeFrameI> _extTreeList;
68 public JalviewModelSequence()
71 this._JSeqList = new java.util.Vector();
72 this._JGroupList = new java.util.Vector();
73 this._viewportList = new java.util.Vector();
74 this._userColoursList = new java.util.Vector();
75 this._treeList = new java.util.Vector();
76 this._extTreeList = new java.util.Vector<>();
87 * @throws java.lang.IndexOutOfBoundsException
88 * if the index given is outside the bounds of the collection
90 public void addJGroup(final jalview.schemabinding.version2.JGroup vJGroup)
91 throws java.lang.IndexOutOfBoundsException
93 this._JGroupList.addElement(vJGroup);
101 * @throws java.lang.IndexOutOfBoundsException
102 * if the index given is outside the bounds of the collection
104 public void addJGroup(final int index,
105 final jalview.schemabinding.version2.JGroup vJGroup)
106 throws java.lang.IndexOutOfBoundsException
108 this._JGroupList.add(index, vJGroup);
115 * @throws java.lang.IndexOutOfBoundsException
116 * if the index given is outside the bounds of the collection
118 public void addJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
119 throws java.lang.IndexOutOfBoundsException
121 this._JSeqList.addElement(vJSeq);
129 * @throws java.lang.IndexOutOfBoundsException
130 * if the index given is outside the bounds of the collection
132 public void addJSeq(final int index,
133 final jalview.schemabinding.version2.JSeq vJSeq)
134 throws java.lang.IndexOutOfBoundsException
136 this._JSeqList.add(index, vJSeq);
143 * @throws java.lang.IndexOutOfBoundsException
144 * if the index given is outside the bounds of the collection
146 public void addTree(final jalview.schemabinding.version2.Tree vTree)
147 throws java.lang.IndexOutOfBoundsException
149 this._treeList.addElement(vTree);
157 * @throws java.lang.IndexOutOfBoundsException
158 * if the index given is outside the bounds of the collection
160 public void addTree(final int index,
161 final jalview.schemabinding.version2.Tree vTree)
162 throws java.lang.IndexOutOfBoundsException
164 this._treeList.add(index, vTree);
167 public void addExtTreeViewer(jalview.ext.treeviewer.TreeFrameI treeViewer)
169 this._extTreeList.add(treeViewer);
172 public void addExtTreeViewer(final int index,
173 jalview.ext.treeviewer.TreeFrameI treeViewer)
175 this._extTreeList.add(index, treeViewer);
180 * @param vUserColours
181 * @throws java.lang.IndexOutOfBoundsException
182 * if the index given is outside the bounds of the collection
184 public void addUserColours(
185 final jalview.schemabinding.version2.UserColours vUserColours)
186 throws java.lang.IndexOutOfBoundsException
188 this._userColoursList.addElement(vUserColours);
195 * @param vUserColours
196 * @throws java.lang.IndexOutOfBoundsException
197 * if the index given is outside the bounds of the collection
199 public void addUserColours(final int index,
200 final jalview.schemabinding.version2.UserColours vUserColours)
201 throws java.lang.IndexOutOfBoundsException
203 this._userColoursList.add(index, vUserColours);
210 * @throws java.lang.IndexOutOfBoundsException
211 * if the index given is outside the bounds of the collection
213 public void addViewport(
214 final jalview.schemabinding.version2.Viewport vViewport)
215 throws java.lang.IndexOutOfBoundsException
217 this._viewportList.addElement(vViewport);
225 * @throws java.lang.IndexOutOfBoundsException
226 * if the index given is outside the bounds of the collection
228 public void addViewport(final int index,
229 final jalview.schemabinding.version2.Viewport vViewport)
230 throws java.lang.IndexOutOfBoundsException
232 this._viewportList.add(index, vViewport);
236 * Method enumerateJGroup.
238 * @return an Enumeration over all jalview.schemabinding.version2.JGroup
241 public java.util.Enumeration enumerateJGroup()
243 return this._JGroupList.elements();
247 * Method enumerateJSeq.
249 * @return an Enumeration over all jalview.schemabinding.version2.JSeq
252 public java.util.Enumeration enumerateJSeq()
254 return this._JSeqList.elements();
258 * Method enumerateTree.
260 * @return an Enumeration over all jalview.schemabinding.version2.Tree
263 public java.util.Enumeration enumerateTree()
265 return this._treeList.elements();
269 * Method enumerateUserColours.
271 * @return an Enumeration over all jalview.schemabinding.version2.UserColours
274 public java.util.Enumeration enumerateUserColours()
276 return this._userColoursList.elements();
280 * Method enumerateViewport.
282 * @return an Enumeration over all jalview.schemabinding.version2.Viewport
285 public java.util.Enumeration enumerateViewport()
287 return this._viewportList.elements();
291 * Returns the value of field 'featureSettings'.
293 * @return the value of field 'FeatureSettings'.
295 public jalview.schemabinding.version2.FeatureSettings getFeatureSettings()
297 return this._featureSettings;
304 * @throws java.lang.IndexOutOfBoundsException
305 * if the index given is outside the bounds of the collection
306 * @return the value of the jalview.schemabinding.version2.JGroup at the given
309 public jalview.schemabinding.version2.JGroup getJGroup(final int index)
310 throws java.lang.IndexOutOfBoundsException
312 // check bounds for index
313 if (index < 0 || index >= this._JGroupList.size())
315 throw new IndexOutOfBoundsException("getJGroup: Index value '"
316 + index + "' not in range [0.."
317 + (this._JGroupList.size() - 1) + "]");
320 return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index);
324 * Method getJGroup.Returns the contents of the collection in an Array.
326 * Note: Just in case the collection contents are changing in another thread,
327 * we pass a 0-length Array of the correct type into the API call. This way we
328 * <i>know</i> that the Array returned is of exactly the correct length.
330 * @return this collection as an Array
332 public jalview.schemabinding.version2.JGroup[] getJGroup()
334 jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0];
335 return (jalview.schemabinding.version2.JGroup[]) this._JGroupList
340 * Method getJGroupCount.
342 * @return the size of this collection
344 public int getJGroupCount()
346 return this._JGroupList.size();
353 * @throws java.lang.IndexOutOfBoundsException
354 * if the index given is outside the bounds of the collection
355 * @return the value of the jalview.schemabinding.version2.JSeq at the given
358 public jalview.schemabinding.version2.JSeq getJSeq(final int index)
359 throws java.lang.IndexOutOfBoundsException
361 // check bounds for index
362 if (index < 0 || index >= this._JSeqList.size())
364 throw new IndexOutOfBoundsException("getJSeq: Index value '" + index
365 + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
368 return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index);
372 * Method getJSeq.Returns the contents of the collection in an Array.
374 * Note: Just in case the collection contents are changing in another thread,
375 * we pass a 0-length Array of the correct type into the API call. This way we
376 * <i>know</i> that the Array returned is of exactly the correct length.
378 * @return this collection as an Array
380 public jalview.schemabinding.version2.JSeq[] getJSeq()
382 jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0];
383 return (jalview.schemabinding.version2.JSeq[]) this._JSeqList
388 * Method getJSeqCount.
390 * @return the size of this collection
392 public int getJSeqCount()
394 return this._JSeqList.size();
401 * @throws java.lang.IndexOutOfBoundsException
402 * if the index given is outside the bounds of the collection
403 * @return the value of the jalview.schemabinding.version2.Tree at the given
406 public jalview.schemabinding.version2.Tree getTree(final int index)
407 throws java.lang.IndexOutOfBoundsException
409 // check bounds for index
410 if (index < 0 || index >= this._treeList.size())
412 throw new IndexOutOfBoundsException("getTree: Index value '" + index
413 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
416 return (jalview.schemabinding.version2.Tree) _treeList.get(index);
420 * Method getTree.Returns the contents of the collection in an Array.
422 * Note: Just in case the collection contents are changing in another thread,
423 * we pass a 0-length Array of the correct type into the API call. This way we
424 * <i>know</i> that the Array returned is of exactly the correct length.
426 * @return this collection as an Array
428 public jalview.schemabinding.version2.Tree[] getTree()
430 jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0];
431 return (jalview.schemabinding.version2.Tree[]) this._treeList
436 * Method getTreeCount.
438 * @return the size of this collection
440 public int getTreeCount()
442 return this._treeList.size();
445 public jalview.ext.treeviewer.TreeFrameI getExtTreeViewer(final int index)
446 throws java.lang.IndexOutOfBoundsException
448 // check bounds for index
449 if (index < 0 || index >= this._extTreeList.size())
451 throw new IndexOutOfBoundsException("getExtTreeViewer: Index value '"
452 + index + "' not in range [0.."
453 + (this._extTreeList.size() - 1) + "]");
456 return _extTreeList.get(index);
459 public jalview.ext.treeviewer.TreeFrameI[] getExtTreeViewer()
461 jalview.ext.treeviewer.TreeFrameI[] array = new jalview.ext.treeviewer.TreeFrameI[0];
462 return this._extTreeList.toArray(array);
465 public int getExtTreeViewerCount()
467 return this._extTreeList.size();
471 * Method getUserColours.
474 * @throws java.lang.IndexOutOfBoundsException
475 * if the index given is outside the bounds of the collection
476 * @return the value of the jalview.schemabinding.version2.UserColours at the
479 public jalview.schemabinding.version2.UserColours getUserColours(
480 final int index) throws java.lang.IndexOutOfBoundsException
482 // check bounds for index
483 if (index < 0 || index >= this._userColoursList.size())
485 throw new IndexOutOfBoundsException("getUserColours: Index value '"
486 + index + "' not in range [0.."
487 + (this._userColoursList.size() - 1) + "]");
490 return (jalview.schemabinding.version2.UserColours) _userColoursList
495 * Method getUserColours.Returns the contents of the collection in an Array.
497 * Note: Just in case the collection contents are changing in another thread,
498 * we pass a 0-length Array of the correct type into the API call. This way we
499 * <i>know</i> that the Array returned is of exactly the correct length.
501 * @return this collection as an Array
503 public jalview.schemabinding.version2.UserColours[] getUserColours()
505 jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0];
506 return (jalview.schemabinding.version2.UserColours[]) this._userColoursList
511 * Method getUserColoursCount.
513 * @return the size of this collection
515 public int getUserColoursCount()
517 return this._userColoursList.size();
521 * Method getViewport.
524 * @throws java.lang.IndexOutOfBoundsException
525 * if the index given is outside the bounds of the collection
526 * @return the value of the jalview.schemabinding.version2.Viewport at the
529 public jalview.schemabinding.version2.Viewport getViewport(final int index)
530 throws java.lang.IndexOutOfBoundsException
532 // check bounds for index
533 if (index < 0 || index >= this._viewportList.size())
535 throw new IndexOutOfBoundsException("getViewport: Index value '"
536 + index + "' not in range [0.."
537 + (this._viewportList.size() - 1) + "]");
540 return (jalview.schemabinding.version2.Viewport) _viewportList
545 * Method getViewport.Returns the contents of the collection in an Array.
547 * Note: Just in case the collection contents are changing in another thread,
548 * we pass a 0-length Array of the correct type into the API call. This way we
549 * <i>know</i> that the Array returned is of exactly the correct length.
551 * @return this collection as an Array
553 public jalview.schemabinding.version2.Viewport[] getViewport()
555 jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0];
556 return (jalview.schemabinding.version2.Viewport[]) this._viewportList
561 * Method getViewportCount.
563 * @return the size of this collection
565 public int getViewportCount()
567 return this._viewportList.size();
573 * @return true if this object is valid according to the schema
575 public boolean isValid()
580 } catch (org.exolab.castor.xml.ValidationException vex)
591 * @throws org.exolab.castor.xml.MarshalException
592 * if object is null or if any SAXException is thrown during
594 * @throws org.exolab.castor.xml.ValidationException
595 * if this object is an invalid instance according to the schema
597 public void marshal(final java.io.Writer out)
598 throws org.exolab.castor.xml.MarshalException,
599 org.exolab.castor.xml.ValidationException
601 Marshaller.marshal(this, out);
608 * @throws java.io.IOException
609 * if an IOException occurs during marshaling
610 * @throws org.exolab.castor.xml.ValidationException
611 * if this object is an invalid instance according to the schema
612 * @throws org.exolab.castor.xml.MarshalException
613 * if object is null or if any SAXException is thrown during
616 public void marshal(final org.xml.sax.ContentHandler handler)
617 throws java.io.IOException,
618 org.exolab.castor.xml.MarshalException,
619 org.exolab.castor.xml.ValidationException
621 Marshaller.marshal(this, handler);
626 public void removeAllJGroup()
628 this._JGroupList.clear();
633 public void removeAllJSeq()
635 this._JSeqList.clear();
640 public void removeAllTree()
642 this._treeList.clear();
647 public void removeAllUserColours()
649 this._userColoursList.clear();
654 public void removeAllViewport()
656 this._viewportList.clear();
660 * Method removeJGroup.
663 * @return true if the object was removed from the collection.
665 public boolean removeJGroup(
666 final jalview.schemabinding.version2.JGroup vJGroup)
668 boolean removed = _JGroupList.remove(vJGroup);
673 * Method removeJGroupAt.
676 * @return the element removed from the collection
678 public jalview.schemabinding.version2.JGroup removeJGroupAt(
681 java.lang.Object obj = this._JGroupList.remove(index);
682 return (jalview.schemabinding.version2.JGroup) obj;
689 * @return true if the object was removed from the collection.
691 public boolean removeJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
693 boolean removed = _JSeqList.remove(vJSeq);
698 * Method removeJSeqAt.
701 * @return the element removed from the collection
703 public jalview.schemabinding.version2.JSeq removeJSeqAt(final int index)
705 java.lang.Object obj = this._JSeqList.remove(index);
706 return (jalview.schemabinding.version2.JSeq) obj;
713 * @return true if the object was removed from the collection.
715 public boolean removeTree(final jalview.schemabinding.version2.Tree vTree)
717 boolean removed = _treeList.remove(vTree);
722 * Method removeTreeAt.
725 * @return the element removed from the collection
727 public jalview.schemabinding.version2.Tree removeTreeAt(final int index)
729 java.lang.Object obj = this._treeList.remove(index);
730 return (jalview.schemabinding.version2.Tree) obj;
734 * Method removeUserColours.
736 * @param vUserColours
737 * @return true if the object was removed from the collection.
739 public boolean removeUserColours(
740 final jalview.schemabinding.version2.UserColours vUserColours)
742 boolean removed = _userColoursList.remove(vUserColours);
747 * Method removeUserColoursAt.
750 * @return the element removed from the collection
752 public jalview.schemabinding.version2.UserColours removeUserColoursAt(
755 java.lang.Object obj = this._userColoursList.remove(index);
756 return (jalview.schemabinding.version2.UserColours) obj;
760 * Method removeViewport.
763 * @return true if the object was removed from the collection.
765 public boolean removeViewport(
766 final jalview.schemabinding.version2.Viewport vViewport)
768 boolean removed = _viewportList.remove(vViewport);
773 * Method removeViewportAt.
776 * @return the element removed from the collection
778 public jalview.schemabinding.version2.Viewport removeViewportAt(
781 java.lang.Object obj = this._viewportList.remove(index);
782 return (jalview.schemabinding.version2.Viewport) obj;
786 * Sets the value of field 'featureSettings'.
788 * @param featureSettings
789 * the value of field 'featureSettings'.
791 public void setFeatureSettings(
792 final jalview.schemabinding.version2.FeatureSettings featureSettings)
794 this._featureSettings = featureSettings;
802 * @throws java.lang.IndexOutOfBoundsException
803 * if the index given is outside the bounds of the collection
805 public void setJGroup(final int index,
806 final jalview.schemabinding.version2.JGroup vJGroup)
807 throws java.lang.IndexOutOfBoundsException
809 // check bounds for index
810 if (index < 0 || index >= this._JGroupList.size())
812 throw new IndexOutOfBoundsException("setJGroup: Index value '"
813 + index + "' not in range [0.."
814 + (this._JGroupList.size() - 1) + "]");
817 this._JGroupList.set(index, vJGroup);
823 * @param vJGroupArray
825 public void setJGroup(
826 final jalview.schemabinding.version2.JGroup[] vJGroupArray)
831 for (int i = 0; i < vJGroupArray.length; i++)
833 this._JGroupList.add(vJGroupArray[i]);
842 * @throws java.lang.IndexOutOfBoundsException
843 * if the index given is outside the bounds of the collection
845 public void setJSeq(final int index,
846 final jalview.schemabinding.version2.JSeq vJSeq)
847 throws java.lang.IndexOutOfBoundsException
849 // check bounds for index
850 if (index < 0 || index >= this._JSeqList.size())
852 throw new IndexOutOfBoundsException("setJSeq: Index value '" + index
853 + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
856 this._JSeqList.set(index, vJSeq);
864 public void setJSeq(final jalview.schemabinding.version2.JSeq[] vJSeqArray)
869 for (int i = 0; i < vJSeqArray.length; i++)
871 this._JSeqList.add(vJSeqArray[i]);
880 * @throws java.lang.IndexOutOfBoundsException
881 * if the index given is outside the bounds of the collection
883 public void setTree(final int index,
884 final jalview.schemabinding.version2.Tree vTree)
885 throws java.lang.IndexOutOfBoundsException
887 // check bounds for index
888 if (index < 0 || index >= this._treeList.size())
890 throw new IndexOutOfBoundsException("setTree: Index value '" + index
891 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
894 this._treeList.set(index, vTree);
902 public void setTree(final jalview.schemabinding.version2.Tree[] vTreeArray)
907 for (int i = 0; i < vTreeArray.length; i++)
909 this._treeList.add(vTreeArray[i]);
917 * @param vUserColours
918 * @throws java.lang.IndexOutOfBoundsException
919 * if the index given is outside the bounds of the collection
921 public void setUserColours(final int index,
922 final jalview.schemabinding.version2.UserColours vUserColours)
923 throws java.lang.IndexOutOfBoundsException
925 // check bounds for index
926 if (index < 0 || index >= this._userColoursList.size())
928 throw new IndexOutOfBoundsException("setUserColours: Index value '"
929 + index + "' not in range [0.."
930 + (this._userColoursList.size() - 1) + "]");
933 this._userColoursList.set(index, vUserColours);
939 * @param vUserColoursArray
941 public void setUserColours(
942 final jalview.schemabinding.version2.UserColours[] vUserColoursArray)
945 _userColoursList.clear();
947 for (int i = 0; i < vUserColoursArray.length; i++)
949 this._userColoursList.add(vUserColoursArray[i]);
958 * @throws java.lang.IndexOutOfBoundsException
959 * if the index given is outside the bounds of the collection
961 public void setViewport(final int index,
962 final jalview.schemabinding.version2.Viewport vViewport)
963 throws java.lang.IndexOutOfBoundsException
965 // check bounds for index
966 if (index < 0 || index >= this._viewportList.size())
968 throw new IndexOutOfBoundsException("setViewport: Index value '"
969 + index + "' not in range [0.."
970 + (this._viewportList.size() - 1) + "]");
973 this._viewportList.set(index, vViewport);
979 * @param vViewportArray
981 public void setViewport(
982 final jalview.schemabinding.version2.Viewport[] vViewportArray)
985 _viewportList.clear();
987 for (int i = 0; i < vViewportArray.length; i++)
989 this._viewportList.add(vViewportArray[i]);
997 * @throws org.exolab.castor.xml.MarshalException
998 * if object is null or if any SAXException is thrown during
1000 * @throws org.exolab.castor.xml.ValidationException
1001 * if this object is an invalid instance according to the schema
1002 * @return the unmarshaled jalview.schemabinding.version2.JalviewModelSequence
1004 public static jalview.schemabinding.version2.JalviewModelSequence unmarshal(
1005 final java.io.Reader reader)
1006 throws org.exolab.castor.xml.MarshalException,
1007 org.exolab.castor.xml.ValidationException
1009 return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller
1011 jalview.schemabinding.version2.JalviewModelSequence.class,
1018 * @throws org.exolab.castor.xml.ValidationException
1019 * if this object is an invalid instance according to the schema
1021 public void validate() throws org.exolab.castor.xml.ValidationException
1023 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1024 validator.validate(this);