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;
63 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();
81 * @throws java.lang.IndexOutOfBoundsException
82 * if the index given is outside the bounds of the collection
84 public void addJGroup(final jalview.schemabinding.version2.JGroup vJGroup)
85 throws java.lang.IndexOutOfBoundsException
87 this._JGroupList.addElement(vJGroup);
95 * @throws java.lang.IndexOutOfBoundsException
96 * if the index given is outside the bounds of the collection
98 public void addJGroup(final int index,
99 final jalview.schemabinding.version2.JGroup vJGroup)
100 throws java.lang.IndexOutOfBoundsException
102 this._JGroupList.add(index, vJGroup);
109 * @throws java.lang.IndexOutOfBoundsException
110 * if the index given is outside the bounds of the collection
112 public void addJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
113 throws java.lang.IndexOutOfBoundsException
115 this._JSeqList.addElement(vJSeq);
123 * @throws java.lang.IndexOutOfBoundsException
124 * if the index given is outside the bounds of the collection
126 public void addJSeq(final int index,
127 final jalview.schemabinding.version2.JSeq vJSeq)
128 throws java.lang.IndexOutOfBoundsException
130 this._JSeqList.add(index, vJSeq);
137 * @throws java.lang.IndexOutOfBoundsException
138 * if the index given is outside the bounds of the collection
140 public void addTree(final jalview.schemabinding.version2.Tree vTree)
141 throws java.lang.IndexOutOfBoundsException
143 this._treeList.addElement(vTree);
151 * @throws java.lang.IndexOutOfBoundsException
152 * if the index given is outside the bounds of the collection
154 public void addTree(final int index,
155 final jalview.schemabinding.version2.Tree vTree)
156 throws java.lang.IndexOutOfBoundsException
158 this._treeList.add(index, vTree);
164 * @param vUserColours
165 * @throws java.lang.IndexOutOfBoundsException
166 * if the index given is outside the bounds of the collection
168 public void addUserColours(
169 final jalview.schemabinding.version2.UserColours vUserColours)
170 throws java.lang.IndexOutOfBoundsException
172 this._userColoursList.addElement(vUserColours);
179 * @param vUserColours
180 * @throws java.lang.IndexOutOfBoundsException
181 * if the index given is outside the bounds of the collection
183 public void addUserColours(final int index,
184 final jalview.schemabinding.version2.UserColours vUserColours)
185 throws java.lang.IndexOutOfBoundsException
187 this._userColoursList.add(index, vUserColours);
194 * @throws java.lang.IndexOutOfBoundsException
195 * if the index given is outside the bounds of the collection
197 public void addViewport(
198 final jalview.schemabinding.version2.Viewport vViewport)
199 throws java.lang.IndexOutOfBoundsException
201 this._viewportList.addElement(vViewport);
209 * @throws java.lang.IndexOutOfBoundsException
210 * if the index given is outside the bounds of the collection
212 public void addViewport(final int index,
213 final jalview.schemabinding.version2.Viewport vViewport)
214 throws java.lang.IndexOutOfBoundsException
216 this._viewportList.add(index, vViewport);
220 * Method enumerateJGroup.
222 * @return an Enumeration over all jalview.schemabinding.version2.JGroup
225 public java.util.Enumeration enumerateJGroup()
227 return this._JGroupList.elements();
231 * Method enumerateJSeq.
233 * @return an Enumeration over all jalview.schemabinding.version2.JSeq
236 public java.util.Enumeration enumerateJSeq()
238 return this._JSeqList.elements();
242 * Method enumerateTree.
244 * @return an Enumeration over all jalview.schemabinding.version2.Tree
247 public java.util.Enumeration enumerateTree()
249 return this._treeList.elements();
253 * Method enumerateUserColours.
255 * @return an Enumeration over all jalview.schemabinding.version2.UserColours
258 public java.util.Enumeration enumerateUserColours()
260 return this._userColoursList.elements();
264 * Method enumerateViewport.
266 * @return an Enumeration over all jalview.schemabinding.version2.Viewport
269 public java.util.Enumeration enumerateViewport()
271 return this._viewportList.elements();
275 * Returns the value of field 'featureSettings'.
277 * @return the value of field 'FeatureSettings'.
279 public jalview.schemabinding.version2.FeatureSettings getFeatureSettings()
281 return this._featureSettings;
288 * @throws java.lang.IndexOutOfBoundsException
289 * if the index given is outside the bounds of the collection
290 * @return the value of the jalview.schemabinding.version2.JGroup at the given
293 public jalview.schemabinding.version2.JGroup getJGroup(final int index)
294 throws java.lang.IndexOutOfBoundsException
296 // check bounds for index
297 if (index < 0 || index >= this._JGroupList.size())
299 throw new IndexOutOfBoundsException("getJGroup: Index value '"
300 + index + "' not in range [0.."
301 + (this._JGroupList.size() - 1) + "]");
304 return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index);
308 * Method getJGroup.Returns the contents of the collection in an Array.
310 * Note: Just in case the collection contents are changing in another thread,
311 * we pass a 0-length Array of the correct type into the API call. This way we
312 * <i>know</i> that the Array returned is of exactly the correct length.
314 * @return this collection as an Array
316 public jalview.schemabinding.version2.JGroup[] getJGroup()
318 jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0];
319 return (jalview.schemabinding.version2.JGroup[]) this._JGroupList
324 * Method getJGroupCount.
326 * @return the size of this collection
328 public int getJGroupCount()
330 return this._JGroupList.size();
337 * @throws java.lang.IndexOutOfBoundsException
338 * if the index given is outside the bounds of the collection
339 * @return the value of the jalview.schemabinding.version2.JSeq at the given
342 public jalview.schemabinding.version2.JSeq getJSeq(final int index)
343 throws java.lang.IndexOutOfBoundsException
345 // check bounds for index
346 if (index < 0 || index >= this._JSeqList.size())
348 throw new IndexOutOfBoundsException("getJSeq: Index value '" + index
349 + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
352 return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index);
356 * Method getJSeq.Returns the contents of the collection in an Array.
358 * Note: Just in case the collection contents are changing in another thread,
359 * we pass a 0-length Array of the correct type into the API call. This way we
360 * <i>know</i> that the Array returned is of exactly the correct length.
362 * @return this collection as an Array
364 public jalview.schemabinding.version2.JSeq[] getJSeq()
366 jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0];
367 return (jalview.schemabinding.version2.JSeq[]) this._JSeqList
372 * Method getJSeqCount.
374 * @return the size of this collection
376 public int getJSeqCount()
378 return this._JSeqList.size();
385 * @throws java.lang.IndexOutOfBoundsException
386 * if the index given is outside the bounds of the collection
387 * @return the value of the jalview.schemabinding.version2.Tree at the given
390 public jalview.schemabinding.version2.Tree getTree(final int index)
391 throws java.lang.IndexOutOfBoundsException
393 // check bounds for index
394 if (index < 0 || index >= this._treeList.size())
396 throw new IndexOutOfBoundsException("getTree: Index value '" + index
397 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
400 return (jalview.schemabinding.version2.Tree) _treeList.get(index);
404 * Method getTree.Returns the contents of the collection in an Array.
406 * Note: Just in case the collection contents are changing in another thread,
407 * we pass a 0-length Array of the correct type into the API call. This way we
408 * <i>know</i> that the Array returned is of exactly the correct length.
410 * @return this collection as an Array
412 public jalview.schemabinding.version2.Tree[] getTree()
414 jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0];
415 return (jalview.schemabinding.version2.Tree[]) this._treeList
420 * Method getTreeCount.
422 * @return the size of this collection
424 public int getTreeCount()
426 return this._treeList.size();
430 * Method getUserColours.
433 * @throws java.lang.IndexOutOfBoundsException
434 * if the index given is outside the bounds of the collection
435 * @return the value of the jalview.schemabinding.version2.UserColours at the
438 public jalview.schemabinding.version2.UserColours getUserColours(
439 final int index) throws java.lang.IndexOutOfBoundsException
441 // check bounds for index
442 if (index < 0 || index >= this._userColoursList.size())
444 throw new IndexOutOfBoundsException("getUserColours: Index value '"
445 + index + "' not in range [0.."
446 + (this._userColoursList.size() - 1) + "]");
449 return (jalview.schemabinding.version2.UserColours) _userColoursList
454 * Method getUserColours.Returns the contents of the collection in an Array.
456 * Note: Just in case the collection contents are changing in another thread,
457 * we pass a 0-length Array of the correct type into the API call. This way we
458 * <i>know</i> that the Array returned is of exactly the correct length.
460 * @return this collection as an Array
462 public jalview.schemabinding.version2.UserColours[] getUserColours()
464 jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0];
465 return (jalview.schemabinding.version2.UserColours[]) this._userColoursList
470 * Method getUserColoursCount.
472 * @return the size of this collection
474 public int getUserColoursCount()
476 return this._userColoursList.size();
480 * Method getViewport.
483 * @throws java.lang.IndexOutOfBoundsException
484 * if the index given is outside the bounds of the collection
485 * @return the value of the jalview.schemabinding.version2.Viewport at the
488 public jalview.schemabinding.version2.Viewport getViewport(final int index)
489 throws java.lang.IndexOutOfBoundsException
491 // check bounds for index
492 if (index < 0 || index >= this._viewportList.size())
494 throw new IndexOutOfBoundsException("getViewport: Index value '"
495 + index + "' not in range [0.."
496 + (this._viewportList.size() - 1) + "]");
499 return (jalview.schemabinding.version2.Viewport) _viewportList
504 * Method getViewport.Returns the contents of the collection in an Array.
506 * Note: Just in case the collection contents are changing in another thread,
507 * we pass a 0-length Array of the correct type into the API call. This way we
508 * <i>know</i> that the Array returned is of exactly the correct length.
510 * @return this collection as an Array
512 public jalview.schemabinding.version2.Viewport[] getViewport()
514 jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0];
515 return (jalview.schemabinding.version2.Viewport[]) this._viewportList
520 * Method getViewportCount.
522 * @return the size of this collection
524 public int getViewportCount()
526 return this._viewportList.size();
532 * @return true if this object is valid according to the schema
534 public boolean isValid()
539 } catch (org.exolab.castor.xml.ValidationException vex)
550 * @throws org.exolab.castor.xml.MarshalException
551 * if object is null or if any SAXException is thrown during
553 * @throws org.exolab.castor.xml.ValidationException
554 * if this object is an invalid instance according to the schema
556 public void marshal(final java.io.Writer out)
557 throws org.exolab.castor.xml.MarshalException,
558 org.exolab.castor.xml.ValidationException
560 Marshaller.marshal(this, out);
567 * @throws java.io.IOException
568 * if an IOException occurs during marshaling
569 * @throws org.exolab.castor.xml.ValidationException
570 * if this object is an invalid instance according to the schema
571 * @throws org.exolab.castor.xml.MarshalException
572 * if object is null or if any SAXException is thrown during
575 public void marshal(final org.xml.sax.ContentHandler handler)
576 throws java.io.IOException,
577 org.exolab.castor.xml.MarshalException,
578 org.exolab.castor.xml.ValidationException
580 Marshaller.marshal(this, handler);
585 public void removeAllJGroup()
587 this._JGroupList.clear();
592 public void removeAllJSeq()
594 this._JSeqList.clear();
599 public void removeAllTree()
601 this._treeList.clear();
606 public void removeAllUserColours()
608 this._userColoursList.clear();
613 public void removeAllViewport()
615 this._viewportList.clear();
619 * Method removeJGroup.
622 * @return true if the object was removed from the collection.
624 public boolean removeJGroup(
625 final jalview.schemabinding.version2.JGroup vJGroup)
627 boolean removed = _JGroupList.remove(vJGroup);
632 * Method removeJGroupAt.
635 * @return the element removed from the collection
637 public jalview.schemabinding.version2.JGroup removeJGroupAt(
640 java.lang.Object obj = this._JGroupList.remove(index);
641 return (jalview.schemabinding.version2.JGroup) obj;
648 * @return true if the object was removed from the collection.
650 public boolean removeJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
652 boolean removed = _JSeqList.remove(vJSeq);
657 * Method removeJSeqAt.
660 * @return the element removed from the collection
662 public jalview.schemabinding.version2.JSeq removeJSeqAt(final int index)
664 java.lang.Object obj = this._JSeqList.remove(index);
665 return (jalview.schemabinding.version2.JSeq) obj;
672 * @return true if the object was removed from the collection.
674 public boolean removeTree(final jalview.schemabinding.version2.Tree vTree)
676 boolean removed = _treeList.remove(vTree);
681 * Method removeTreeAt.
684 * @return the element removed from the collection
686 public jalview.schemabinding.version2.Tree removeTreeAt(final int index)
688 java.lang.Object obj = this._treeList.remove(index);
689 return (jalview.schemabinding.version2.Tree) obj;
693 * Method removeUserColours.
695 * @param vUserColours
696 * @return true if the object was removed from the collection.
698 public boolean removeUserColours(
699 final jalview.schemabinding.version2.UserColours vUserColours)
701 boolean removed = _userColoursList.remove(vUserColours);
706 * Method removeUserColoursAt.
709 * @return the element removed from the collection
711 public jalview.schemabinding.version2.UserColours removeUserColoursAt(
714 java.lang.Object obj = this._userColoursList.remove(index);
715 return (jalview.schemabinding.version2.UserColours) obj;
719 * Method removeViewport.
722 * @return true if the object was removed from the collection.
724 public boolean removeViewport(
725 final jalview.schemabinding.version2.Viewport vViewport)
727 boolean removed = _viewportList.remove(vViewport);
732 * Method removeViewportAt.
735 * @return the element removed from the collection
737 public jalview.schemabinding.version2.Viewport removeViewportAt(
740 java.lang.Object obj = this._viewportList.remove(index);
741 return (jalview.schemabinding.version2.Viewport) obj;
745 * Sets the value of field 'featureSettings'.
747 * @param featureSettings
748 * the value of field 'featureSettings'.
750 public void setFeatureSettings(
751 final jalview.schemabinding.version2.FeatureSettings featureSettings)
753 this._featureSettings = featureSettings;
761 * @throws java.lang.IndexOutOfBoundsException
762 * if the index given is outside the bounds of the collection
764 public void setJGroup(final int index,
765 final jalview.schemabinding.version2.JGroup vJGroup)
766 throws java.lang.IndexOutOfBoundsException
768 // check bounds for index
769 if (index < 0 || index >= this._JGroupList.size())
771 throw new IndexOutOfBoundsException("setJGroup: Index value '"
772 + index + "' not in range [0.."
773 + (this._JGroupList.size() - 1) + "]");
776 this._JGroupList.set(index, vJGroup);
782 * @param vJGroupArray
784 public void setJGroup(
785 final jalview.schemabinding.version2.JGroup[] vJGroupArray)
790 for (int i = 0; i < vJGroupArray.length; i++)
792 this._JGroupList.add(vJGroupArray[i]);
801 * @throws java.lang.IndexOutOfBoundsException
802 * if the index given is outside the bounds of the collection
804 public void setJSeq(final int index,
805 final jalview.schemabinding.version2.JSeq vJSeq)
806 throws java.lang.IndexOutOfBoundsException
808 // check bounds for index
809 if (index < 0 || index >= this._JSeqList.size())
811 throw new IndexOutOfBoundsException("setJSeq: Index value '" + index
812 + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
815 this._JSeqList.set(index, vJSeq);
823 public void setJSeq(final jalview.schemabinding.version2.JSeq[] vJSeqArray)
828 for (int i = 0; i < vJSeqArray.length; i++)
830 this._JSeqList.add(vJSeqArray[i]);
839 * @throws java.lang.IndexOutOfBoundsException
840 * if the index given is outside the bounds of the collection
842 public void setTree(final int index,
843 final jalview.schemabinding.version2.Tree vTree)
844 throws java.lang.IndexOutOfBoundsException
846 // check bounds for index
847 if (index < 0 || index >= this._treeList.size())
849 throw new IndexOutOfBoundsException("setTree: Index value '" + index
850 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
853 this._treeList.set(index, vTree);
861 public void setTree(final jalview.schemabinding.version2.Tree[] vTreeArray)
866 for (int i = 0; i < vTreeArray.length; i++)
868 this._treeList.add(vTreeArray[i]);
876 * @param vUserColours
877 * @throws java.lang.IndexOutOfBoundsException
878 * if the index given is outside the bounds of the collection
880 public void setUserColours(final int index,
881 final jalview.schemabinding.version2.UserColours vUserColours)
882 throws java.lang.IndexOutOfBoundsException
884 // check bounds for index
885 if (index < 0 || index >= this._userColoursList.size())
887 throw new IndexOutOfBoundsException("setUserColours: Index value '"
888 + index + "' not in range [0.."
889 + (this._userColoursList.size() - 1) + "]");
892 this._userColoursList.set(index, vUserColours);
898 * @param vUserColoursArray
900 public void setUserColours(
901 final jalview.schemabinding.version2.UserColours[] vUserColoursArray)
904 _userColoursList.clear();
906 for (int i = 0; i < vUserColoursArray.length; i++)
908 this._userColoursList.add(vUserColoursArray[i]);
917 * @throws java.lang.IndexOutOfBoundsException
918 * if the index given is outside the bounds of the collection
920 public void setViewport(final int index,
921 final jalview.schemabinding.version2.Viewport vViewport)
922 throws java.lang.IndexOutOfBoundsException
924 // check bounds for index
925 if (index < 0 || index >= this._viewportList.size())
927 throw new IndexOutOfBoundsException("setViewport: Index value '"
928 + index + "' not in range [0.."
929 + (this._viewportList.size() - 1) + "]");
932 this._viewportList.set(index, vViewport);
938 * @param vViewportArray
940 public void setViewport(
941 final jalview.schemabinding.version2.Viewport[] vViewportArray)
944 _viewportList.clear();
946 for (int i = 0; i < vViewportArray.length; i++)
948 this._viewportList.add(vViewportArray[i]);
956 * @throws org.exolab.castor.xml.MarshalException
957 * if object is null or if any SAXException is thrown during
959 * @throws org.exolab.castor.xml.ValidationException
960 * if this object is an invalid instance according to the schema
961 * @return the unmarshaled jalview.schemabinding.version2.JalviewModelSequence
963 public static jalview.schemabinding.version2.JalviewModelSequence unmarshal(
964 final java.io.Reader reader)
965 throws org.exolab.castor.xml.MarshalException,
966 org.exolab.castor.xml.ValidationException
968 return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller
970 jalview.schemabinding.version2.JalviewModelSequence.class,
977 * @throws org.exolab.castor.xml.ValidationException
978 * if this object is an invalid instance according to the schema
980 public void validate() throws org.exolab.castor.xml.ValidationException
982 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
983 validator.validate(this);