2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
8 package jalview.binding;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import java.io.IOException;
\r
15 import java.io.Reader;
\r
16 import java.io.Serializable;
\r
17 import java.io.Writer;
\r
18 import java.util.Enumeration;
\r
19 import java.util.Vector;
\r
20 import org.exolab.castor.xml.MarshalException;
\r
21 import org.exolab.castor.xml.Marshaller;
\r
22 import org.exolab.castor.xml.Unmarshaller;
\r
23 import org.exolab.castor.xml.ValidationException;
\r
24 import org.xml.sax.ContentHandler;
\r
27 * Class JalviewModelSequence.
\r
29 * @version $Revision$ $Date$
\r
31 public class JalviewModelSequence implements java.io.Serializable {
\r
34 //--------------------------/
\r
35 //- Class/Member Variables -/
\r
36 //--------------------------/
\r
41 private java.util.Vector _JSeqList;
\r
46 private java.util.Vector _JGroupList;
\r
49 * Field _viewportList
\r
51 private java.util.Vector _viewportList;
\r
54 * Field _userColoursList
\r
56 private java.util.Vector _userColoursList;
\r
61 private java.util.Vector _treeList;
\r
64 * Field _featureSettings
\r
66 private jalview.binding.FeatureSettings _featureSettings;
\r
73 public JalviewModelSequence() {
\r
75 _JSeqList = new Vector();
\r
76 _JGroupList = new Vector();
\r
77 _viewportList = new Vector();
\r
78 _userColoursList = new Vector();
\r
79 _treeList = new Vector();
\r
80 } //-- jalview.binding.JalviewModelSequence()
\r
94 public void addJGroup(jalview.binding.JGroup vJGroup)
\r
95 throws java.lang.IndexOutOfBoundsException
\r
97 _JGroupList.addElement(vJGroup);
\r
98 } //-- void addJGroup(jalview.binding.JGroup)
\r
108 public void addJGroup(int index, jalview.binding.JGroup vJGroup)
\r
109 throws java.lang.IndexOutOfBoundsException
\r
111 _JGroupList.insertElementAt(vJGroup, index);
\r
112 } //-- void addJGroup(int, jalview.binding.JGroup)
\r
121 public void addJSeq(jalview.binding.JSeq vJSeq)
\r
122 throws java.lang.IndexOutOfBoundsException
\r
124 _JSeqList.addElement(vJSeq);
\r
125 } //-- void addJSeq(jalview.binding.JSeq)
\r
135 public void addJSeq(int index, jalview.binding.JSeq vJSeq)
\r
136 throws java.lang.IndexOutOfBoundsException
\r
138 _JSeqList.insertElementAt(vJSeq, index);
\r
139 } //-- void addJSeq(int, jalview.binding.JSeq)
\r
148 public void addTree(jalview.binding.Tree vTree)
\r
149 throws java.lang.IndexOutOfBoundsException
\r
151 _treeList.addElement(vTree);
\r
152 } //-- void addTree(jalview.binding.Tree)
\r
162 public void addTree(int index, jalview.binding.Tree vTree)
\r
163 throws java.lang.IndexOutOfBoundsException
\r
165 _treeList.insertElementAt(vTree, index);
\r
166 } //-- void addTree(int, jalview.binding.Tree)
\r
169 * Method addUserColours
\r
173 * @param vUserColours
\r
175 public void addUserColours(jalview.binding.UserColours vUserColours)
\r
176 throws java.lang.IndexOutOfBoundsException
\r
178 _userColoursList.addElement(vUserColours);
\r
179 } //-- void addUserColours(jalview.binding.UserColours)
\r
182 * Method addUserColours
\r
187 * @param vUserColours
\r
189 public void addUserColours(int index, jalview.binding.UserColours vUserColours)
\r
190 throws java.lang.IndexOutOfBoundsException
\r
192 _userColoursList.insertElementAt(vUserColours, index);
\r
193 } //-- void addUserColours(int, jalview.binding.UserColours)
\r
196 * Method addViewport
\r
202 public void addViewport(jalview.binding.Viewport vViewport)
\r
203 throws java.lang.IndexOutOfBoundsException
\r
205 _viewportList.addElement(vViewport);
\r
206 } //-- void addViewport(jalview.binding.Viewport)
\r
209 * Method addViewport
\r
216 public void addViewport(int index, jalview.binding.Viewport vViewport)
\r
217 throws java.lang.IndexOutOfBoundsException
\r
219 _viewportList.insertElementAt(vViewport, index);
\r
220 } //-- void addViewport(int, jalview.binding.Viewport)
\r
223 * Method enumerateJGroup
\r
227 * @return Enumeration
\r
229 public java.util.Enumeration enumerateJGroup()
\r
231 return _JGroupList.elements();
\r
232 } //-- java.util.Enumeration enumerateJGroup()
\r
235 * Method enumerateJSeq
\r
239 * @return Enumeration
\r
241 public java.util.Enumeration enumerateJSeq()
\r
243 return _JSeqList.elements();
\r
244 } //-- java.util.Enumeration enumerateJSeq()
\r
247 * Method enumerateTree
\r
251 * @return Enumeration
\r
253 public java.util.Enumeration enumerateTree()
\r
255 return _treeList.elements();
\r
256 } //-- java.util.Enumeration enumerateTree()
\r
259 * Method enumerateUserColours
\r
263 * @return Enumeration
\r
265 public java.util.Enumeration enumerateUserColours()
\r
267 return _userColoursList.elements();
\r
268 } //-- java.util.Enumeration enumerateUserColours()
\r
271 * Method enumerateViewport
\r
275 * @return Enumeration
\r
277 public java.util.Enumeration enumerateViewport()
\r
279 return _viewportList.elements();
\r
280 } //-- java.util.Enumeration enumerateViewport()
\r
283 * Returns the value of field 'featureSettings'.
\r
285 * @return FeatureSettings
\r
286 * @return the value of field 'featureSettings'.
\r
288 public jalview.binding.FeatureSettings getFeatureSettings()
\r
290 return this._featureSettings;
\r
291 } //-- jalview.binding.FeatureSettings getFeatureSettings()
\r
301 public jalview.binding.JGroup getJGroup(int index)
\r
302 throws java.lang.IndexOutOfBoundsException
\r
304 //-- check bounds for index
\r
305 if ((index < 0) || (index > _JGroupList.size())) {
\r
306 throw new IndexOutOfBoundsException();
\r
309 return (jalview.binding.JGroup) _JGroupList.elementAt(index);
\r
310 } //-- jalview.binding.JGroup getJGroup(int)
\r
319 public jalview.binding.JGroup[] getJGroup()
\r
321 int size = _JGroupList.size();
\r
322 jalview.binding.JGroup[] mArray = new jalview.binding.JGroup[size];
\r
323 for (int index = 0; index < size; index++) {
\r
324 mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index);
\r
327 } //-- jalview.binding.JGroup[] getJGroup()
\r
330 * Method getJGroupCount
\r
336 public int getJGroupCount()
\r
338 return _JGroupList.size();
\r
339 } //-- int getJGroupCount()
\r
349 public jalview.binding.JSeq getJSeq(int index)
\r
350 throws java.lang.IndexOutOfBoundsException
\r
352 //-- check bounds for index
\r
353 if ((index < 0) || (index > _JSeqList.size())) {
\r
354 throw new IndexOutOfBoundsException();
\r
357 return (jalview.binding.JSeq) _JSeqList.elementAt(index);
\r
358 } //-- jalview.binding.JSeq getJSeq(int)
\r
367 public jalview.binding.JSeq[] getJSeq()
\r
369 int size = _JSeqList.size();
\r
370 jalview.binding.JSeq[] mArray = new jalview.binding.JSeq[size];
\r
371 for (int index = 0; index < size; index++) {
\r
372 mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index);
\r
375 } //-- jalview.binding.JSeq[] getJSeq()
\r
378 * Method getJSeqCount
\r
384 public int getJSeqCount()
\r
386 return _JSeqList.size();
\r
387 } //-- int getJSeqCount()
\r
397 public jalview.binding.Tree getTree(int index)
\r
398 throws java.lang.IndexOutOfBoundsException
\r
400 //-- check bounds for index
\r
401 if ((index < 0) || (index > _treeList.size())) {
\r
402 throw new IndexOutOfBoundsException();
\r
405 return (jalview.binding.Tree) _treeList.elementAt(index);
\r
406 } //-- jalview.binding.Tree getTree(int)
\r
415 public jalview.binding.Tree[] getTree()
\r
417 int size = _treeList.size();
\r
418 jalview.binding.Tree[] mArray = new jalview.binding.Tree[size];
\r
419 for (int index = 0; index < size; index++) {
\r
420 mArray[index] = (jalview.binding.Tree) _treeList.elementAt(index);
\r
423 } //-- jalview.binding.Tree[] getTree()
\r
426 * Method getTreeCount
\r
432 public int getTreeCount()
\r
434 return _treeList.size();
\r
435 } //-- int getTreeCount()
\r
438 * Method getUserColours
\r
443 * @return UserColours
\r
445 public jalview.binding.UserColours getUserColours(int index)
\r
446 throws java.lang.IndexOutOfBoundsException
\r
448 //-- check bounds for index
\r
449 if ((index < 0) || (index > _userColoursList.size())) {
\r
450 throw new IndexOutOfBoundsException();
\r
453 return (jalview.binding.UserColours) _userColoursList.elementAt(index);
\r
454 } //-- jalview.binding.UserColours getUserColours(int)
\r
457 * Method getUserColours
\r
461 * @return UserColours
\r
463 public jalview.binding.UserColours[] getUserColours()
\r
465 int size = _userColoursList.size();
\r
466 jalview.binding.UserColours[] mArray = new jalview.binding.UserColours[size];
\r
467 for (int index = 0; index < size; index++) {
\r
468 mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(index);
\r
471 } //-- jalview.binding.UserColours[] getUserColours()
\r
474 * Method getUserColoursCount
\r
480 public int getUserColoursCount()
\r
482 return _userColoursList.size();
\r
483 } //-- int getUserColoursCount()
\r
486 * Method getViewport
\r
493 public jalview.binding.Viewport getViewport(int index)
\r
494 throws java.lang.IndexOutOfBoundsException
\r
496 //-- check bounds for index
\r
497 if ((index < 0) || (index > _viewportList.size())) {
\r
498 throw new IndexOutOfBoundsException();
\r
501 return (jalview.binding.Viewport) _viewportList.elementAt(index);
\r
502 } //-- jalview.binding.Viewport getViewport(int)
\r
505 * Method getViewport
\r
511 public jalview.binding.Viewport[] getViewport()
\r
513 int size = _viewportList.size();
\r
514 jalview.binding.Viewport[] mArray = new jalview.binding.Viewport[size];
\r
515 for (int index = 0; index < size; index++) {
\r
516 mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index);
\r
519 } //-- jalview.binding.Viewport[] getViewport()
\r
522 * Method getViewportCount
\r
528 public int getViewportCount()
\r
530 return _viewportList.size();
\r
531 } //-- int getViewportCount()
\r
540 public boolean isValid()
\r
545 catch (org.exolab.castor.xml.ValidationException vex) {
\r
549 } //-- boolean isValid()
\r
558 public void marshal(java.io.Writer out)
\r
559 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
562 Marshaller.marshal(this, out);
\r
563 } //-- void marshal(java.io.Writer)
\r
572 public void marshal(org.xml.sax.ContentHandler handler)
\r
573 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
576 Marshaller.marshal(this, handler);
\r
577 } //-- void marshal(org.xml.sax.ContentHandler)
\r
580 * Method removeAllJGroup
\r
583 public void removeAllJGroup()
\r
585 _JGroupList.removeAllElements();
\r
586 } //-- void removeAllJGroup()
\r
589 * Method removeAllJSeq
\r
592 public void removeAllJSeq()
\r
594 _JSeqList.removeAllElements();
\r
595 } //-- void removeAllJSeq()
\r
598 * Method removeAllTree
\r
601 public void removeAllTree()
\r
603 _treeList.removeAllElements();
\r
604 } //-- void removeAllTree()
\r
607 * Method removeAllUserColours
\r
610 public void removeAllUserColours()
\r
612 _userColoursList.removeAllElements();
\r
613 } //-- void removeAllUserColours()
\r
616 * Method removeAllViewport
\r
619 public void removeAllViewport()
\r
621 _viewportList.removeAllElements();
\r
622 } //-- void removeAllViewport()
\r
625 * Method removeJGroup
\r
632 public jalview.binding.JGroup removeJGroup(int index)
\r
634 java.lang.Object obj = _JGroupList.elementAt(index);
\r
635 _JGroupList.removeElementAt(index);
\r
636 return (jalview.binding.JGroup) obj;
\r
637 } //-- jalview.binding.JGroup removeJGroup(int)
\r
640 * Method removeJSeq
\r
647 public jalview.binding.JSeq removeJSeq(int index)
\r
649 java.lang.Object obj = _JSeqList.elementAt(index);
\r
650 _JSeqList.removeElementAt(index);
\r
651 return (jalview.binding.JSeq) obj;
\r
652 } //-- jalview.binding.JSeq removeJSeq(int)
\r
655 * Method removeTree
\r
662 public jalview.binding.Tree removeTree(int index)
\r
664 java.lang.Object obj = _treeList.elementAt(index);
\r
665 _treeList.removeElementAt(index);
\r
666 return (jalview.binding.Tree) obj;
\r
667 } //-- jalview.binding.Tree removeTree(int)
\r
670 * Method removeUserColours
\r
675 * @return UserColours
\r
677 public jalview.binding.UserColours removeUserColours(int index)
\r
679 java.lang.Object obj = _userColoursList.elementAt(index);
\r
680 _userColoursList.removeElementAt(index);
\r
681 return (jalview.binding.UserColours) obj;
\r
682 } //-- jalview.binding.UserColours removeUserColours(int)
\r
685 * Method removeViewport
\r
692 public jalview.binding.Viewport removeViewport(int index)
\r
694 java.lang.Object obj = _viewportList.elementAt(index);
\r
695 _viewportList.removeElementAt(index);
\r
696 return (jalview.binding.Viewport) obj;
\r
697 } //-- jalview.binding.Viewport removeViewport(int)
\r
700 * Sets the value of field 'featureSettings'.
\r
702 * @param featureSettings the value of field 'featureSettings'.
\r
704 public void setFeatureSettings(jalview.binding.FeatureSettings featureSettings)
\r
706 this._featureSettings = featureSettings;
\r
707 } //-- void setFeatureSettings(jalview.binding.FeatureSettings)
\r
717 public void setJGroup(int index, jalview.binding.JGroup vJGroup)
\r
718 throws java.lang.IndexOutOfBoundsException
\r
720 //-- check bounds for index
\r
721 if ((index < 0) || (index > _JGroupList.size())) {
\r
722 throw new IndexOutOfBoundsException();
\r
724 _JGroupList.setElementAt(vJGroup, index);
\r
725 } //-- void setJGroup(int, jalview.binding.JGroup)
\r
732 * @param JGroupArray
\r
734 public void setJGroup(jalview.binding.JGroup[] JGroupArray)
\r
737 _JGroupList.removeAllElements();
\r
738 for (int i = 0; i < JGroupArray.length; i++) {
\r
739 _JGroupList.addElement(JGroupArray[i]);
\r
741 } //-- void setJGroup(jalview.binding.JGroup)
\r
751 public void setJSeq(int index, jalview.binding.JSeq vJSeq)
\r
752 throws java.lang.IndexOutOfBoundsException
\r
754 //-- check bounds for index
\r
755 if ((index < 0) || (index > _JSeqList.size())) {
\r
756 throw new IndexOutOfBoundsException();
\r
758 _JSeqList.setElementAt(vJSeq, index);
\r
759 } //-- void setJSeq(int, jalview.binding.JSeq)
\r
768 public void setJSeq(jalview.binding.JSeq[] JSeqArray)
\r
771 _JSeqList.removeAllElements();
\r
772 for (int i = 0; i < JSeqArray.length; i++) {
\r
773 _JSeqList.addElement(JSeqArray[i]);
\r
775 } //-- void setJSeq(jalview.binding.JSeq)
\r
785 public void setTree(int index, jalview.binding.Tree vTree)
\r
786 throws java.lang.IndexOutOfBoundsException
\r
788 //-- check bounds for index
\r
789 if ((index < 0) || (index > _treeList.size())) {
\r
790 throw new IndexOutOfBoundsException();
\r
792 _treeList.setElementAt(vTree, index);
\r
793 } //-- void setTree(int, jalview.binding.Tree)
\r
802 public void setTree(jalview.binding.Tree[] treeArray)
\r
805 _treeList.removeAllElements();
\r
806 for (int i = 0; i < treeArray.length; i++) {
\r
807 _treeList.addElement(treeArray[i]);
\r
809 } //-- void setTree(jalview.binding.Tree)
\r
812 * Method setUserColours
\r
817 * @param vUserColours
\r
819 public void setUserColours(int index, jalview.binding.UserColours vUserColours)
\r
820 throws java.lang.IndexOutOfBoundsException
\r
822 //-- check bounds for index
\r
823 if ((index < 0) || (index > _userColoursList.size())) {
\r
824 throw new IndexOutOfBoundsException();
\r
826 _userColoursList.setElementAt(vUserColours, index);
\r
827 } //-- void setUserColours(int, jalview.binding.UserColours)
\r
830 * Method setUserColours
\r
834 * @param userColoursArray
\r
836 public void setUserColours(jalview.binding.UserColours[] userColoursArray)
\r
839 _userColoursList.removeAllElements();
\r
840 for (int i = 0; i < userColoursArray.length; i++) {
\r
841 _userColoursList.addElement(userColoursArray[i]);
\r
843 } //-- void setUserColours(jalview.binding.UserColours)
\r
846 * Method setViewport
\r
853 public void setViewport(int index, jalview.binding.Viewport vViewport)
\r
854 throws java.lang.IndexOutOfBoundsException
\r
856 //-- check bounds for index
\r
857 if ((index < 0) || (index > _viewportList.size())) {
\r
858 throw new IndexOutOfBoundsException();
\r
860 _viewportList.setElementAt(vViewport, index);
\r
861 } //-- void setViewport(int, jalview.binding.Viewport)
\r
864 * Method setViewport
\r
868 * @param viewportArray
\r
870 public void setViewport(jalview.binding.Viewport[] viewportArray)
\r
873 _viewportList.removeAllElements();
\r
874 for (int i = 0; i < viewportArray.length; i++) {
\r
875 _viewportList.addElement(viewportArray[i]);
\r
877 } //-- void setViewport(jalview.binding.Viewport)
\r
887 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
888 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
890 return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);
\r
891 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
897 public void validate()
\r
898 throws org.exolab.castor.xml.ValidationException
\r
900 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
901 validator.validate(this);
\r
902 } //-- void validate()
\r