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
68 public JalviewModelSequence() {
\r
70 _JSeqList = new Vector();
\r
71 _JGroupList = new Vector();
\r
72 _viewportList = new Vector();
\r
73 _userColoursList = new Vector();
\r
74 _treeList = new Vector();
\r
75 } //-- jalview.binding.JalviewModelSequence()
\r
89 public void addJGroup(jalview.binding.JGroup vJGroup)
\r
90 throws java.lang.IndexOutOfBoundsException
\r
92 _JGroupList.addElement(vJGroup);
\r
93 } //-- void addJGroup(jalview.binding.JGroup)
\r
103 public void addJGroup(int index, jalview.binding.JGroup vJGroup)
\r
104 throws java.lang.IndexOutOfBoundsException
\r
106 _JGroupList.insertElementAt(vJGroup, index);
\r
107 } //-- void addJGroup(int, jalview.binding.JGroup)
\r
116 public void addJSeq(jalview.binding.JSeq vJSeq)
\r
117 throws java.lang.IndexOutOfBoundsException
\r
119 _JSeqList.addElement(vJSeq);
\r
120 } //-- void addJSeq(jalview.binding.JSeq)
\r
130 public void addJSeq(int index, jalview.binding.JSeq vJSeq)
\r
131 throws java.lang.IndexOutOfBoundsException
\r
133 _JSeqList.insertElementAt(vJSeq, index);
\r
134 } //-- void addJSeq(int, jalview.binding.JSeq)
\r
143 public void addTree(jalview.binding.Tree vTree)
\r
144 throws java.lang.IndexOutOfBoundsException
\r
146 _treeList.addElement(vTree);
\r
147 } //-- void addTree(jalview.binding.Tree)
\r
157 public void addTree(int index, jalview.binding.Tree vTree)
\r
158 throws java.lang.IndexOutOfBoundsException
\r
160 _treeList.insertElementAt(vTree, index);
\r
161 } //-- void addTree(int, jalview.binding.Tree)
\r
164 * Method addUserColours
\r
168 * @param vUserColours
\r
170 public void addUserColours(jalview.binding.UserColours vUserColours)
\r
171 throws java.lang.IndexOutOfBoundsException
\r
173 _userColoursList.addElement(vUserColours);
\r
174 } //-- void addUserColours(jalview.binding.UserColours)
\r
177 * Method addUserColours
\r
182 * @param vUserColours
\r
184 public void addUserColours(int index, jalview.binding.UserColours vUserColours)
\r
185 throws java.lang.IndexOutOfBoundsException
\r
187 _userColoursList.insertElementAt(vUserColours, index);
\r
188 } //-- void addUserColours(int, jalview.binding.UserColours)
\r
191 * Method addViewport
\r
197 public void addViewport(jalview.binding.Viewport vViewport)
\r
198 throws java.lang.IndexOutOfBoundsException
\r
200 _viewportList.addElement(vViewport);
\r
201 } //-- void addViewport(jalview.binding.Viewport)
\r
204 * Method addViewport
\r
211 public void addViewport(int index, jalview.binding.Viewport vViewport)
\r
212 throws java.lang.IndexOutOfBoundsException
\r
214 _viewportList.insertElementAt(vViewport, index);
\r
215 } //-- void addViewport(int, jalview.binding.Viewport)
\r
218 * Method enumerateJGroup
\r
222 * @return Enumeration
\r
224 public java.util.Enumeration enumerateJGroup()
\r
226 return _JGroupList.elements();
\r
227 } //-- java.util.Enumeration enumerateJGroup()
\r
230 * Method enumerateJSeq
\r
234 * @return Enumeration
\r
236 public java.util.Enumeration enumerateJSeq()
\r
238 return _JSeqList.elements();
\r
239 } //-- java.util.Enumeration enumerateJSeq()
\r
242 * Method enumerateTree
\r
246 * @return Enumeration
\r
248 public java.util.Enumeration enumerateTree()
\r
250 return _treeList.elements();
\r
251 } //-- java.util.Enumeration enumerateTree()
\r
254 * Method enumerateUserColours
\r
258 * @return Enumeration
\r
260 public java.util.Enumeration enumerateUserColours()
\r
262 return _userColoursList.elements();
\r
263 } //-- java.util.Enumeration enumerateUserColours()
\r
266 * Method enumerateViewport
\r
270 * @return Enumeration
\r
272 public java.util.Enumeration enumerateViewport()
\r
274 return _viewportList.elements();
\r
275 } //-- java.util.Enumeration enumerateViewport()
\r
285 public jalview.binding.JGroup getJGroup(int index)
\r
286 throws java.lang.IndexOutOfBoundsException
\r
288 //-- check bounds for index
\r
289 if ((index < 0) || (index > _JGroupList.size())) {
\r
290 throw new IndexOutOfBoundsException();
\r
293 return (jalview.binding.JGroup) _JGroupList.elementAt(index);
\r
294 } //-- jalview.binding.JGroup getJGroup(int)
\r
303 public jalview.binding.JGroup[] getJGroup()
\r
305 int size = _JGroupList.size();
\r
306 jalview.binding.JGroup[] mArray = new jalview.binding.JGroup[size];
\r
307 for (int index = 0; index < size; index++) {
\r
308 mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index);
\r
311 } //-- jalview.binding.JGroup[] getJGroup()
\r
314 * Method getJGroupCount
\r
320 public int getJGroupCount()
\r
322 return _JGroupList.size();
\r
323 } //-- int getJGroupCount()
\r
333 public jalview.binding.JSeq getJSeq(int index)
\r
334 throws java.lang.IndexOutOfBoundsException
\r
336 //-- check bounds for index
\r
337 if ((index < 0) || (index > _JSeqList.size())) {
\r
338 throw new IndexOutOfBoundsException();
\r
341 return (jalview.binding.JSeq) _JSeqList.elementAt(index);
\r
342 } //-- jalview.binding.JSeq getJSeq(int)
\r
351 public jalview.binding.JSeq[] getJSeq()
\r
353 int size = _JSeqList.size();
\r
354 jalview.binding.JSeq[] mArray = new jalview.binding.JSeq[size];
\r
355 for (int index = 0; index < size; index++) {
\r
356 mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index);
\r
359 } //-- jalview.binding.JSeq[] getJSeq()
\r
362 * Method getJSeqCount
\r
368 public int getJSeqCount()
\r
370 return _JSeqList.size();
\r
371 } //-- int getJSeqCount()
\r
381 public jalview.binding.Tree getTree(int index)
\r
382 throws java.lang.IndexOutOfBoundsException
\r
384 //-- check bounds for index
\r
385 if ((index < 0) || (index > _treeList.size())) {
\r
386 throw new IndexOutOfBoundsException();
\r
389 return (jalview.binding.Tree) _treeList.elementAt(index);
\r
390 } //-- jalview.binding.Tree getTree(int)
\r
399 public jalview.binding.Tree[] getTree()
\r
401 int size = _treeList.size();
\r
402 jalview.binding.Tree[] mArray = new jalview.binding.Tree[size];
\r
403 for (int index = 0; index < size; index++) {
\r
404 mArray[index] = (jalview.binding.Tree) _treeList.elementAt(index);
\r
407 } //-- jalview.binding.Tree[] getTree()
\r
410 * Method getTreeCount
\r
416 public int getTreeCount()
\r
418 return _treeList.size();
\r
419 } //-- int getTreeCount()
\r
422 * Method getUserColours
\r
427 * @return UserColours
\r
429 public jalview.binding.UserColours getUserColours(int index)
\r
430 throws java.lang.IndexOutOfBoundsException
\r
432 //-- check bounds for index
\r
433 if ((index < 0) || (index > _userColoursList.size())) {
\r
434 throw new IndexOutOfBoundsException();
\r
437 return (jalview.binding.UserColours) _userColoursList.elementAt(index);
\r
438 } //-- jalview.binding.UserColours getUserColours(int)
\r
441 * Method getUserColours
\r
445 * @return UserColours
\r
447 public jalview.binding.UserColours[] getUserColours()
\r
449 int size = _userColoursList.size();
\r
450 jalview.binding.UserColours[] mArray = new jalview.binding.UserColours[size];
\r
451 for (int index = 0; index < size; index++) {
\r
452 mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(index);
\r
455 } //-- jalview.binding.UserColours[] getUserColours()
\r
458 * Method getUserColoursCount
\r
464 public int getUserColoursCount()
\r
466 return _userColoursList.size();
\r
467 } //-- int getUserColoursCount()
\r
470 * Method getViewport
\r
477 public jalview.binding.Viewport getViewport(int index)
\r
478 throws java.lang.IndexOutOfBoundsException
\r
480 //-- check bounds for index
\r
481 if ((index < 0) || (index > _viewportList.size())) {
\r
482 throw new IndexOutOfBoundsException();
\r
485 return (jalview.binding.Viewport) _viewportList.elementAt(index);
\r
486 } //-- jalview.binding.Viewport getViewport(int)
\r
489 * Method getViewport
\r
495 public jalview.binding.Viewport[] getViewport()
\r
497 int size = _viewportList.size();
\r
498 jalview.binding.Viewport[] mArray = new jalview.binding.Viewport[size];
\r
499 for (int index = 0; index < size; index++) {
\r
500 mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index);
\r
503 } //-- jalview.binding.Viewport[] getViewport()
\r
506 * Method getViewportCount
\r
512 public int getViewportCount()
\r
514 return _viewportList.size();
\r
515 } //-- int getViewportCount()
\r
524 public boolean isValid()
\r
529 catch (org.exolab.castor.xml.ValidationException vex) {
\r
533 } //-- boolean isValid()
\r
542 public void marshal(java.io.Writer out)
\r
543 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
546 Marshaller.marshal(this, out);
\r
547 } //-- void marshal(java.io.Writer)
\r
556 public void marshal(org.xml.sax.ContentHandler handler)
\r
557 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
560 Marshaller.marshal(this, handler);
\r
561 } //-- void marshal(org.xml.sax.ContentHandler)
\r
564 * Method removeAllJGroup
\r
567 public void removeAllJGroup()
\r
569 _JGroupList.removeAllElements();
\r
570 } //-- void removeAllJGroup()
\r
573 * Method removeAllJSeq
\r
576 public void removeAllJSeq()
\r
578 _JSeqList.removeAllElements();
\r
579 } //-- void removeAllJSeq()
\r
582 * Method removeAllTree
\r
585 public void removeAllTree()
\r
587 _treeList.removeAllElements();
\r
588 } //-- void removeAllTree()
\r
591 * Method removeAllUserColours
\r
594 public void removeAllUserColours()
\r
596 _userColoursList.removeAllElements();
\r
597 } //-- void removeAllUserColours()
\r
600 * Method removeAllViewport
\r
603 public void removeAllViewport()
\r
605 _viewportList.removeAllElements();
\r
606 } //-- void removeAllViewport()
\r
609 * Method removeJGroup
\r
616 public jalview.binding.JGroup removeJGroup(int index)
\r
618 java.lang.Object obj = _JGroupList.elementAt(index);
\r
619 _JGroupList.removeElementAt(index);
\r
620 return (jalview.binding.JGroup) obj;
\r
621 } //-- jalview.binding.JGroup removeJGroup(int)
\r
624 * Method removeJSeq
\r
631 public jalview.binding.JSeq removeJSeq(int index)
\r
633 java.lang.Object obj = _JSeqList.elementAt(index);
\r
634 _JSeqList.removeElementAt(index);
\r
635 return (jalview.binding.JSeq) obj;
\r
636 } //-- jalview.binding.JSeq removeJSeq(int)
\r
639 * Method removeTree
\r
646 public jalview.binding.Tree removeTree(int index)
\r
648 java.lang.Object obj = _treeList.elementAt(index);
\r
649 _treeList.removeElementAt(index);
\r
650 return (jalview.binding.Tree) obj;
\r
651 } //-- jalview.binding.Tree removeTree(int)
\r
654 * Method removeUserColours
\r
659 * @return UserColours
\r
661 public jalview.binding.UserColours removeUserColours(int index)
\r
663 java.lang.Object obj = _userColoursList.elementAt(index);
\r
664 _userColoursList.removeElementAt(index);
\r
665 return (jalview.binding.UserColours) obj;
\r
666 } //-- jalview.binding.UserColours removeUserColours(int)
\r
669 * Method removeViewport
\r
676 public jalview.binding.Viewport removeViewport(int index)
\r
678 java.lang.Object obj = _viewportList.elementAt(index);
\r
679 _viewportList.removeElementAt(index);
\r
680 return (jalview.binding.Viewport) obj;
\r
681 } //-- jalview.binding.Viewport removeViewport(int)
\r
691 public void setJGroup(int index, jalview.binding.JGroup vJGroup)
\r
692 throws java.lang.IndexOutOfBoundsException
\r
694 //-- check bounds for index
\r
695 if ((index < 0) || (index > _JGroupList.size())) {
\r
696 throw new IndexOutOfBoundsException();
\r
698 _JGroupList.setElementAt(vJGroup, index);
\r
699 } //-- void setJGroup(int, jalview.binding.JGroup)
\r
706 * @param JGroupArray
\r
708 public void setJGroup(jalview.binding.JGroup[] JGroupArray)
\r
711 _JGroupList.removeAllElements();
\r
712 for (int i = 0; i < JGroupArray.length; i++) {
\r
713 _JGroupList.addElement(JGroupArray[i]);
\r
715 } //-- void setJGroup(jalview.binding.JGroup)
\r
725 public void setJSeq(int index, jalview.binding.JSeq vJSeq)
\r
726 throws java.lang.IndexOutOfBoundsException
\r
728 //-- check bounds for index
\r
729 if ((index < 0) || (index > _JSeqList.size())) {
\r
730 throw new IndexOutOfBoundsException();
\r
732 _JSeqList.setElementAt(vJSeq, index);
\r
733 } //-- void setJSeq(int, jalview.binding.JSeq)
\r
742 public void setJSeq(jalview.binding.JSeq[] JSeqArray)
\r
745 _JSeqList.removeAllElements();
\r
746 for (int i = 0; i < JSeqArray.length; i++) {
\r
747 _JSeqList.addElement(JSeqArray[i]);
\r
749 } //-- void setJSeq(jalview.binding.JSeq)
\r
759 public void setTree(int index, jalview.binding.Tree vTree)
\r
760 throws java.lang.IndexOutOfBoundsException
\r
762 //-- check bounds for index
\r
763 if ((index < 0) || (index > _treeList.size())) {
\r
764 throw new IndexOutOfBoundsException();
\r
766 _treeList.setElementAt(vTree, index);
\r
767 } //-- void setTree(int, jalview.binding.Tree)
\r
776 public void setTree(jalview.binding.Tree[] treeArray)
\r
779 _treeList.removeAllElements();
\r
780 for (int i = 0; i < treeArray.length; i++) {
\r
781 _treeList.addElement(treeArray[i]);
\r
783 } //-- void setTree(jalview.binding.Tree)
\r
786 * Method setUserColours
\r
791 * @param vUserColours
\r
793 public void setUserColours(int index, jalview.binding.UserColours vUserColours)
\r
794 throws java.lang.IndexOutOfBoundsException
\r
796 //-- check bounds for index
\r
797 if ((index < 0) || (index > _userColoursList.size())) {
\r
798 throw new IndexOutOfBoundsException();
\r
800 _userColoursList.setElementAt(vUserColours, index);
\r
801 } //-- void setUserColours(int, jalview.binding.UserColours)
\r
804 * Method setUserColours
\r
808 * @param userColoursArray
\r
810 public void setUserColours(jalview.binding.UserColours[] userColoursArray)
\r
813 _userColoursList.removeAllElements();
\r
814 for (int i = 0; i < userColoursArray.length; i++) {
\r
815 _userColoursList.addElement(userColoursArray[i]);
\r
817 } //-- void setUserColours(jalview.binding.UserColours)
\r
820 * Method setViewport
\r
827 public void setViewport(int index, jalview.binding.Viewport vViewport)
\r
828 throws java.lang.IndexOutOfBoundsException
\r
830 //-- check bounds for index
\r
831 if ((index < 0) || (index > _viewportList.size())) {
\r
832 throw new IndexOutOfBoundsException();
\r
834 _viewportList.setElementAt(vViewport, index);
\r
835 } //-- void setViewport(int, jalview.binding.Viewport)
\r
838 * Method setViewport
\r
842 * @param viewportArray
\r
844 public void setViewport(jalview.binding.Viewport[] viewportArray)
\r
847 _viewportList.removeAllElements();
\r
848 for (int i = 0; i < viewportArray.length; i++) {
\r
849 _viewportList.addElement(viewportArray[i]);
\r
851 } //-- void setViewport(jalview.binding.Viewport)
\r
861 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
862 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
864 return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);
\r
865 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
871 public void validate()
\r
872 throws org.exolab.castor.xml.ValidationException
\r
874 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
875 validator.validate(this);
\r
876 } //-- void validate()
\r