2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.binding;
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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.Viewport vViewport)
214 throws java.lang.IndexOutOfBoundsException {
215 this._viewportList.add(index, vViewport);
219 * Method enumerateJGroup.
221 * @return an Enumeration over all jalview.binding.JGroup
224 public java.util.Enumeration enumerateJGroup(
226 return this._JGroupList.elements();
230 * Method enumerateJSeq.
232 * @return an Enumeration over all jalview.binding.JSeq elements
234 public java.util.Enumeration enumerateJSeq(
236 return this._JSeqList.elements();
240 * Method enumerateTree.
242 * @return an Enumeration over all jalview.binding.Tree elements
244 public java.util.Enumeration enumerateTree(
246 return this._treeList.elements();
250 * Method enumerateUserColours.
252 * @return an Enumeration over all jalview.binding.UserColours
255 public java.util.Enumeration enumerateUserColours(
257 return this._userColoursList.elements();
261 * Method enumerateViewport.
263 * @return an Enumeration over all jalview.binding.Viewport
266 public java.util.Enumeration enumerateViewport(
268 return this._viewportList.elements();
272 * Returns the value of field 'featureSettings'.
274 * @return the value of field 'FeatureSettings'.
276 public jalview.binding.FeatureSettings getFeatureSettings(
278 return this._featureSettings;
285 * @throws java.lang.IndexOutOfBoundsException if the index
286 * given is outside the bounds of the collection
287 * @return the value of the jalview.binding.JGroup at the given
290 public jalview.binding.JGroup getJGroup(
292 throws java.lang.IndexOutOfBoundsException {
293 // check bounds for index
294 if (index < 0 || index >= this._JGroupList.size()) {
295 throw new IndexOutOfBoundsException("getJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]");
298 return (jalview.binding.JGroup) _JGroupList.get(index);
302 * Method getJGroup.Returns the contents of the collection in
303 * an Array. <p>Note: Just in case the collection contents
304 * are changing in another thread, we pass a 0-length Array of
305 * the correct type into the API call. This way we <i>know</i>
306 * that the Array returned is of exactly the correct length.
308 * @return this collection as an Array
310 public jalview.binding.JGroup[] getJGroup(
312 jalview.binding.JGroup[] array = new jalview.binding.JGroup[0];
313 return (jalview.binding.JGroup[]) this._JGroupList.toArray(array);
317 * Method getJGroupCount.
319 * @return the size of this collection
321 public int getJGroupCount(
323 return this._JGroupList.size();
330 * @throws java.lang.IndexOutOfBoundsException if the index
331 * given is outside the bounds of the collection
332 * @return the value of the jalview.binding.JSeq at the given
335 public jalview.binding.JSeq getJSeq(
337 throws java.lang.IndexOutOfBoundsException {
338 // check bounds for index
339 if (index < 0 || index >= this._JSeqList.size()) {
340 throw new IndexOutOfBoundsException("getJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
343 return (jalview.binding.JSeq) _JSeqList.get(index);
347 * Method getJSeq.Returns the contents of the collection in an
348 * Array. <p>Note: Just in case the collection contents are
349 * changing in another thread, we pass a 0-length Array of the
350 * correct type into the API call. This way we <i>know</i>
351 * that the Array returned is of exactly the correct length.
353 * @return this collection as an Array
355 public jalview.binding.JSeq[] getJSeq(
357 jalview.binding.JSeq[] array = new jalview.binding.JSeq[0];
358 return (jalview.binding.JSeq[]) this._JSeqList.toArray(array);
362 * Method getJSeqCount.
364 * @return the size of this collection
366 public int getJSeqCount(
368 return this._JSeqList.size();
375 * @throws java.lang.IndexOutOfBoundsException if the index
376 * given is outside the bounds of the collection
377 * @return the value of the jalview.binding.Tree at the given
380 public jalview.binding.Tree getTree(
382 throws java.lang.IndexOutOfBoundsException {
383 // check bounds for index
384 if (index < 0 || index >= this._treeList.size()) {
385 throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
388 return (jalview.binding.Tree) _treeList.get(index);
392 * Method getTree.Returns the contents of the collection in an
393 * Array. <p>Note: Just in case the collection contents are
394 * changing in another thread, we pass a 0-length Array of the
395 * correct type into the API call. This way we <i>know</i>
396 * that the Array returned is of exactly the correct length.
398 * @return this collection as an Array
400 public jalview.binding.Tree[] getTree(
402 jalview.binding.Tree[] array = new jalview.binding.Tree[0];
403 return (jalview.binding.Tree[]) this._treeList.toArray(array);
407 * Method getTreeCount.
409 * @return the size of this collection
411 public int getTreeCount(
413 return this._treeList.size();
417 * Method getUserColours.
420 * @throws java.lang.IndexOutOfBoundsException if the index
421 * given is outside the bounds of the collection
422 * @return the value of the jalview.binding.UserColours at the
425 public jalview.binding.UserColours getUserColours(
427 throws java.lang.IndexOutOfBoundsException {
428 // check bounds for index
429 if (index < 0 || index >= this._userColoursList.size()) {
430 throw new IndexOutOfBoundsException("getUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]");
433 return (jalview.binding.UserColours) _userColoursList.get(index);
437 * Method getUserColours.Returns the contents of the collection
438 * in an Array. <p>Note: Just in case the collection contents
439 * are changing in another thread, we pass a 0-length Array of
440 * the correct type into the API call. This way we <i>know</i>
441 * that the Array returned is of exactly the correct length.
443 * @return this collection as an Array
445 public jalview.binding.UserColours[] getUserColours(
447 jalview.binding.UserColours[] array = new jalview.binding.UserColours[0];
448 return (jalview.binding.UserColours[]) this._userColoursList.toArray(array);
452 * Method getUserColoursCount.
454 * @return the size of this collection
456 public int getUserColoursCount(
458 return this._userColoursList.size();
462 * Method getViewport.
465 * @throws java.lang.IndexOutOfBoundsException if the index
466 * given is outside the bounds of the collection
467 * @return the value of the jalview.binding.Viewport at the
470 public jalview.binding.Viewport getViewport(
472 throws java.lang.IndexOutOfBoundsException {
473 // check bounds for index
474 if (index < 0 || index >= this._viewportList.size()) {
475 throw new IndexOutOfBoundsException("getViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]");
478 return (jalview.binding.Viewport) _viewportList.get(index);
482 * Method getViewport.Returns the contents of the collection in
483 * an Array. <p>Note: Just in case the collection contents
484 * are changing in another thread, we pass a 0-length Array of
485 * the correct type into the API call. This way we <i>know</i>
486 * that the Array returned is of exactly the correct length.
488 * @return this collection as an Array
490 public jalview.binding.Viewport[] getViewport(
492 jalview.binding.Viewport[] array = new jalview.binding.Viewport[0];
493 return (jalview.binding.Viewport[]) this._viewportList.toArray(array);
497 * Method getViewportCount.
499 * @return the size of this collection
501 public int getViewportCount(
503 return this._viewportList.size();
509 * @return true if this object is valid according to the schema
511 public boolean isValid(
515 } catch (org.exolab.castor.xml.ValidationException vex) {
525 * @throws org.exolab.castor.xml.MarshalException if object is
526 * null or if any SAXException is thrown during marshaling
527 * @throws org.exolab.castor.xml.ValidationException if this
528 * object is an invalid instance according to the schema
531 final java.io.Writer out)
532 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
533 Marshaller.marshal(this, out);
540 * @throws java.io.IOException if an IOException occurs during
542 * @throws org.exolab.castor.xml.ValidationException if this
543 * object is an invalid instance according to the schema
544 * @throws org.exolab.castor.xml.MarshalException if object is
545 * null or if any SAXException is thrown during marshaling
548 final org.xml.sax.ContentHandler handler)
549 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
550 Marshaller.marshal(this, handler);
555 public void removeAllJGroup(
557 this._JGroupList.clear();
562 public void removeAllJSeq(
564 this._JSeqList.clear();
569 public void removeAllTree(
571 this._treeList.clear();
576 public void removeAllUserColours(
578 this._userColoursList.clear();
583 public void removeAllViewport(
585 this._viewportList.clear();
589 * Method removeJGroup.
592 * @return true if the object was removed from the collection.
594 public boolean removeJGroup(
595 final jalview.binding.JGroup vJGroup) {
596 boolean removed = _JGroupList.remove(vJGroup);
601 * Method removeJGroupAt.
604 * @return the element removed from the collection
606 public jalview.binding.JGroup removeJGroupAt(
608 java.lang.Object obj = this._JGroupList.remove(index);
609 return (jalview.binding.JGroup) obj;
616 * @return true if the object was removed from the collection.
618 public boolean removeJSeq(
619 final jalview.binding.JSeq vJSeq) {
620 boolean removed = _JSeqList.remove(vJSeq);
625 * Method removeJSeqAt.
628 * @return the element removed from the collection
630 public jalview.binding.JSeq removeJSeqAt(
632 java.lang.Object obj = this._JSeqList.remove(index);
633 return (jalview.binding.JSeq) obj;
640 * @return true if the object was removed from the collection.
642 public boolean removeTree(
643 final jalview.binding.Tree vTree) {
644 boolean removed = _treeList.remove(vTree);
649 * Method removeTreeAt.
652 * @return the element removed from the collection
654 public jalview.binding.Tree removeTreeAt(
656 java.lang.Object obj = this._treeList.remove(index);
657 return (jalview.binding.Tree) obj;
661 * Method removeUserColours.
663 * @param vUserColours
664 * @return true if the object was removed from the collection.
666 public boolean removeUserColours(
667 final jalview.binding.UserColours vUserColours) {
668 boolean removed = _userColoursList.remove(vUserColours);
673 * Method removeUserColoursAt.
676 * @return the element removed from the collection
678 public jalview.binding.UserColours removeUserColoursAt(
680 java.lang.Object obj = this._userColoursList.remove(index);
681 return (jalview.binding.UserColours) obj;
685 * Method removeViewport.
688 * @return true if the object was removed from the collection.
690 public boolean removeViewport(
691 final jalview.binding.Viewport vViewport) {
692 boolean removed = _viewportList.remove(vViewport);
697 * Method removeViewportAt.
700 * @return the element removed from the collection
702 public jalview.binding.Viewport removeViewportAt(
704 java.lang.Object obj = this._viewportList.remove(index);
705 return (jalview.binding.Viewport) obj;
709 * Sets the value of field 'featureSettings'.
711 * @param featureSettings the value of field 'featureSettings'.
713 public void setFeatureSettings(
714 final jalview.binding.FeatureSettings featureSettings) {
715 this._featureSettings = featureSettings;
723 * @throws java.lang.IndexOutOfBoundsException if the index
724 * given is outside the bounds of the collection
726 public void setJGroup(
728 final jalview.binding.JGroup vJGroup)
729 throws java.lang.IndexOutOfBoundsException {
730 // check bounds for index
731 if (index < 0 || index >= this._JGroupList.size()) {
732 throw new IndexOutOfBoundsException("setJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]");
735 this._JGroupList.set(index, vJGroup);
741 * @param vJGroupArray
743 public void setJGroup(
744 final jalview.binding.JGroup[] vJGroupArray) {
748 for (int i = 0; i < vJGroupArray.length; i++) {
749 this._JGroupList.add(vJGroupArray[i]);
758 * @throws java.lang.IndexOutOfBoundsException if the index
759 * given is outside the bounds of the collection
763 final jalview.binding.JSeq vJSeq)
764 throws java.lang.IndexOutOfBoundsException {
765 // check bounds for index
766 if (index < 0 || index >= this._JSeqList.size()) {
767 throw new IndexOutOfBoundsException("setJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
770 this._JSeqList.set(index, vJSeq);
779 final jalview.binding.JSeq[] vJSeqArray) {
783 for (int i = 0; i < vJSeqArray.length; i++) {
784 this._JSeqList.add(vJSeqArray[i]);
793 * @throws java.lang.IndexOutOfBoundsException if the index
794 * given is outside the bounds of the collection
798 final jalview.binding.Tree vTree)
799 throws java.lang.IndexOutOfBoundsException {
800 // check bounds for index
801 if (index < 0 || index >= this._treeList.size()) {
802 throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
805 this._treeList.set(index, vTree);
814 final jalview.binding.Tree[] vTreeArray) {
818 for (int i = 0; i < vTreeArray.length; i++) {
819 this._treeList.add(vTreeArray[i]);
827 * @param vUserColours
828 * @throws java.lang.IndexOutOfBoundsException if the index
829 * given is outside the bounds of the collection
831 public void setUserColours(
833 final jalview.binding.UserColours vUserColours)
834 throws java.lang.IndexOutOfBoundsException {
835 // check bounds for index
836 if (index < 0 || index >= this._userColoursList.size()) {
837 throw new IndexOutOfBoundsException("setUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]");
840 this._userColoursList.set(index, vUserColours);
846 * @param vUserColoursArray
848 public void setUserColours(
849 final jalview.binding.UserColours[] vUserColoursArray) {
851 _userColoursList.clear();
853 for (int i = 0; i < vUserColoursArray.length; i++) {
854 this._userColoursList.add(vUserColoursArray[i]);
863 * @throws java.lang.IndexOutOfBoundsException if the index
864 * given is outside the bounds of the collection
866 public void setViewport(
868 final jalview.binding.Viewport vViewport)
869 throws java.lang.IndexOutOfBoundsException {
870 // check bounds for index
871 if (index < 0 || index >= this._viewportList.size()) {
872 throw new IndexOutOfBoundsException("setViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]");
875 this._viewportList.set(index, vViewport);
881 * @param vViewportArray
883 public void setViewport(
884 final jalview.binding.Viewport[] vViewportArray) {
886 _viewportList.clear();
888 for (int i = 0; i < vViewportArray.length; i++) {
889 this._viewportList.add(vViewportArray[i]);
897 * @throws org.exolab.castor.xml.MarshalException if object is
898 * null or if any SAXException is thrown during marshaling
899 * @throws org.exolab.castor.xml.ValidationException if this
900 * object is an invalid instance according to the schema
901 * @return the unmarshaled jalview.binding.JalviewModelSequence
903 public static jalview.binding.JalviewModelSequence unmarshal(
904 final java.io.Reader reader)
905 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
906 return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);
912 * @throws org.exolab.castor.xml.ValidationException if this
913 * object is an invalid instance according to the schema
915 public void validate(
917 throws org.exolab.castor.xml.ValidationException {
918 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
919 validator.validate(this);