2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
9 * Jalview - A Sequence Alignment Editor and Viewer
\r
10 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
12 * This program is free software; you can redistribute it and/or
\r
13 * modify it under the terms of the GNU General Public License
\r
14 * as published by the Free Software Foundation; either version 2
\r
15 * of the License, or (at your option) any later version.
\r
17 * This program is distributed in the hope that it will be useful,
\r
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
20 * GNU General Public License for more details.
\r
22 * You should have received a copy of the GNU General Public License
\r
23 * along with this program; if not, write to the Free Software
\r
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
27 package jalview.binding;
\r
29 //---------------------------------/
\r
30 //- Imported classes and packages -/
\r
31 //---------------------------------/
\r
33 import java.io.IOException;
\r
34 import java.io.Reader;
\r
35 import java.io.Serializable;
\r
36 import java.io.Writer;
\r
37 import java.util.Enumeration;
\r
38 import java.util.Vector;
\r
39 import org.exolab.castor.xml.MarshalException;
\r
40 import org.exolab.castor.xml.Marshaller;
\r
41 import org.exolab.castor.xml.Unmarshaller;
\r
42 import org.exolab.castor.xml.ValidationException;
\r
43 import org.xml.sax.ContentHandler;
\r
46 * Class JalviewModelSequence.
\r
48 * @version $Revision$ $Date$
\r
50 public class JalviewModelSequence implements java.io.Serializable {
\r
53 //--------------------------/
\r
54 //- Class/Member Variables -/
\r
55 //--------------------------/
\r
60 private java.util.Vector _JSeqList;
\r
65 private java.util.Vector _JGroupList;
\r
68 * Field _viewportList
\r
70 private java.util.Vector _viewportList;
\r
73 * Field _userColoursList
\r
75 private java.util.Vector _userColoursList;
\r
82 public JalviewModelSequence() {
\r
84 _JSeqList = new Vector();
\r
85 _JGroupList = new Vector();
\r
86 _viewportList = new Vector();
\r
87 _userColoursList = new Vector();
\r
88 } //-- jalview.binding.JalviewModelSequence()
\r
102 public void addJGroup(jalview.binding.JGroup vJGroup)
\r
103 throws java.lang.IndexOutOfBoundsException
\r
105 _JGroupList.addElement(vJGroup);
\r
106 } //-- void addJGroup(jalview.binding.JGroup)
\r
116 public void addJGroup(int index, jalview.binding.JGroup vJGroup)
\r
117 throws java.lang.IndexOutOfBoundsException
\r
119 _JGroupList.insertElementAt(vJGroup, index);
\r
120 } //-- void addJGroup(int, jalview.binding.JGroup)
\r
129 public void addJSeq(jalview.binding.JSeq vJSeq)
\r
130 throws java.lang.IndexOutOfBoundsException
\r
132 _JSeqList.addElement(vJSeq);
\r
133 } //-- void addJSeq(jalview.binding.JSeq)
\r
143 public void addJSeq(int index, jalview.binding.JSeq vJSeq)
\r
144 throws java.lang.IndexOutOfBoundsException
\r
146 _JSeqList.insertElementAt(vJSeq, index);
\r
147 } //-- void addJSeq(int, jalview.binding.JSeq)
\r
150 * Method addUserColours
\r
154 * @param vUserColours
\r
156 public void addUserColours(jalview.binding.UserColours vUserColours)
\r
157 throws java.lang.IndexOutOfBoundsException
\r
159 _userColoursList.addElement(vUserColours);
\r
160 } //-- void addUserColours(jalview.binding.UserColours)
\r
163 * Method addUserColours
\r
168 * @param vUserColours
\r
170 public void addUserColours(int index, jalview.binding.UserColours vUserColours)
\r
171 throws java.lang.IndexOutOfBoundsException
\r
173 _userColoursList.insertElementAt(vUserColours, index);
\r
174 } //-- void addUserColours(int, jalview.binding.UserColours)
\r
177 * Method addViewport
\r
183 public void addViewport(jalview.binding.Viewport vViewport)
\r
184 throws java.lang.IndexOutOfBoundsException
\r
186 _viewportList.addElement(vViewport);
\r
187 } //-- void addViewport(jalview.binding.Viewport)
\r
190 * Method addViewport
\r
197 public void addViewport(int index, jalview.binding.Viewport vViewport)
\r
198 throws java.lang.IndexOutOfBoundsException
\r
200 _viewportList.insertElementAt(vViewport, index);
\r
201 } //-- void addViewport(int, jalview.binding.Viewport)
\r
204 * Method enumerateJGroup
\r
208 * @return Enumeration
\r
210 public java.util.Enumeration enumerateJGroup()
\r
212 return _JGroupList.elements();
\r
213 } //-- java.util.Enumeration enumerateJGroup()
\r
216 * Method enumerateJSeq
\r
220 * @return Enumeration
\r
222 public java.util.Enumeration enumerateJSeq()
\r
224 return _JSeqList.elements();
\r
225 } //-- java.util.Enumeration enumerateJSeq()
\r
228 * Method enumerateUserColours
\r
232 * @return Enumeration
\r
234 public java.util.Enumeration enumerateUserColours()
\r
236 return _userColoursList.elements();
\r
237 } //-- java.util.Enumeration enumerateUserColours()
\r
240 * Method enumerateViewport
\r
244 * @return Enumeration
\r
246 public java.util.Enumeration enumerateViewport()
\r
248 return _viewportList.elements();
\r
249 } //-- java.util.Enumeration enumerateViewport()
\r
259 public jalview.binding.JGroup getJGroup(int index)
\r
260 throws java.lang.IndexOutOfBoundsException
\r
262 //-- check bounds for index
\r
263 if ((index < 0) || (index > _JGroupList.size())) {
\r
264 throw new IndexOutOfBoundsException();
\r
267 return (jalview.binding.JGroup) _JGroupList.elementAt(index);
\r
268 } //-- jalview.binding.JGroup getJGroup(int)
\r
277 public jalview.binding.JGroup[] getJGroup()
\r
279 int size = _JGroupList.size();
\r
280 jalview.binding.JGroup[] mArray = new jalview.binding.JGroup[size];
\r
281 for (int index = 0; index < size; index++) {
\r
282 mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index);
\r
285 } //-- jalview.binding.JGroup[] getJGroup()
\r
288 * Method getJGroupCount
\r
294 public int getJGroupCount()
\r
296 return _JGroupList.size();
\r
297 } //-- int getJGroupCount()
\r
307 public jalview.binding.JSeq getJSeq(int index)
\r
308 throws java.lang.IndexOutOfBoundsException
\r
310 //-- check bounds for index
\r
311 if ((index < 0) || (index > _JSeqList.size())) {
\r
312 throw new IndexOutOfBoundsException();
\r
315 return (jalview.binding.JSeq) _JSeqList.elementAt(index);
\r
316 } //-- jalview.binding.JSeq getJSeq(int)
\r
325 public jalview.binding.JSeq[] getJSeq()
\r
327 int size = _JSeqList.size();
\r
328 jalview.binding.JSeq[] mArray = new jalview.binding.JSeq[size];
\r
329 for (int index = 0; index < size; index++) {
\r
330 mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index);
\r
333 } //-- jalview.binding.JSeq[] getJSeq()
\r
336 * Method getJSeqCount
\r
342 public int getJSeqCount()
\r
344 return _JSeqList.size();
\r
345 } //-- int getJSeqCount()
\r
348 * Method getUserColours
\r
353 * @return UserColours
\r
355 public jalview.binding.UserColours getUserColours(int index)
\r
356 throws java.lang.IndexOutOfBoundsException
\r
358 //-- check bounds for index
\r
359 if ((index < 0) || (index > _userColoursList.size())) {
\r
360 throw new IndexOutOfBoundsException();
\r
363 return (jalview.binding.UserColours) _userColoursList.elementAt(index);
\r
364 } //-- jalview.binding.UserColours getUserColours(int)
\r
367 * Method getUserColours
\r
371 * @return UserColours
\r
373 public jalview.binding.UserColours[] getUserColours()
\r
375 int size = _userColoursList.size();
\r
376 jalview.binding.UserColours[] mArray = new jalview.binding.UserColours[size];
\r
377 for (int index = 0; index < size; index++) {
\r
378 mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(index);
\r
381 } //-- jalview.binding.UserColours[] getUserColours()
\r
384 * Method getUserColoursCount
\r
390 public int getUserColoursCount()
\r
392 return _userColoursList.size();
\r
393 } //-- int getUserColoursCount()
\r
396 * Method getViewport
\r
403 public jalview.binding.Viewport getViewport(int index)
\r
404 throws java.lang.IndexOutOfBoundsException
\r
406 //-- check bounds for index
\r
407 if ((index < 0) || (index > _viewportList.size())) {
\r
408 throw new IndexOutOfBoundsException();
\r
411 return (jalview.binding.Viewport) _viewportList.elementAt(index);
\r
412 } //-- jalview.binding.Viewport getViewport(int)
\r
415 * Method getViewport
\r
421 public jalview.binding.Viewport[] getViewport()
\r
423 int size = _viewportList.size();
\r
424 jalview.binding.Viewport[] mArray = new jalview.binding.Viewport[size];
\r
425 for (int index = 0; index < size; index++) {
\r
426 mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index);
\r
429 } //-- jalview.binding.Viewport[] getViewport()
\r
432 * Method getViewportCount
\r
438 public int getViewportCount()
\r
440 return _viewportList.size();
\r
441 } //-- int getViewportCount()
\r
450 public boolean isValid()
\r
455 catch (org.exolab.castor.xml.ValidationException vex) {
\r
459 } //-- boolean isValid()
\r
468 public void marshal(java.io.Writer out)
\r
469 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
472 Marshaller.marshal(this, out);
\r
473 } //-- void marshal(java.io.Writer)
\r
482 public void marshal(org.xml.sax.ContentHandler handler)
\r
483 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
486 Marshaller.marshal(this, handler);
\r
487 } //-- void marshal(org.xml.sax.ContentHandler)
\r
490 * Method removeAllJGroup
\r
493 public void removeAllJGroup()
\r
495 _JGroupList.removeAllElements();
\r
496 } //-- void removeAllJGroup()
\r
499 * Method removeAllJSeq
\r
502 public void removeAllJSeq()
\r
504 _JSeqList.removeAllElements();
\r
505 } //-- void removeAllJSeq()
\r
508 * Method removeAllUserColours
\r
511 public void removeAllUserColours()
\r
513 _userColoursList.removeAllElements();
\r
514 } //-- void removeAllUserColours()
\r
517 * Method removeAllViewport
\r
520 public void removeAllViewport()
\r
522 _viewportList.removeAllElements();
\r
523 } //-- void removeAllViewport()
\r
526 * Method removeJGroup
\r
533 public jalview.binding.JGroup removeJGroup(int index)
\r
535 java.lang.Object obj = _JGroupList.elementAt(index);
\r
536 _JGroupList.removeElementAt(index);
\r
537 return (jalview.binding.JGroup) obj;
\r
538 } //-- jalview.binding.JGroup removeJGroup(int)
\r
541 * Method removeJSeq
\r
548 public jalview.binding.JSeq removeJSeq(int index)
\r
550 java.lang.Object obj = _JSeqList.elementAt(index);
\r
551 _JSeqList.removeElementAt(index);
\r
552 return (jalview.binding.JSeq) obj;
\r
553 } //-- jalview.binding.JSeq removeJSeq(int)
\r
556 * Method removeUserColours
\r
561 * @return UserColours
\r
563 public jalview.binding.UserColours removeUserColours(int index)
\r
565 java.lang.Object obj = _userColoursList.elementAt(index);
\r
566 _userColoursList.removeElementAt(index);
\r
567 return (jalview.binding.UserColours) obj;
\r
568 } //-- jalview.binding.UserColours removeUserColours(int)
\r
571 * Method removeViewport
\r
578 public jalview.binding.Viewport removeViewport(int index)
\r
580 java.lang.Object obj = _viewportList.elementAt(index);
\r
581 _viewportList.removeElementAt(index);
\r
582 return (jalview.binding.Viewport) obj;
\r
583 } //-- jalview.binding.Viewport removeViewport(int)
\r
593 public void setJGroup(int index, jalview.binding.JGroup vJGroup)
\r
594 throws java.lang.IndexOutOfBoundsException
\r
596 //-- check bounds for index
\r
597 if ((index < 0) || (index > _JGroupList.size())) {
\r
598 throw new IndexOutOfBoundsException();
\r
600 _JGroupList.setElementAt(vJGroup, index);
\r
601 } //-- void setJGroup(int, jalview.binding.JGroup)
\r
608 * @param JGroupArray
\r
610 public void setJGroup(jalview.binding.JGroup[] JGroupArray)
\r
613 _JGroupList.removeAllElements();
\r
614 for (int i = 0; i < JGroupArray.length; i++) {
\r
615 _JGroupList.addElement(JGroupArray[i]);
\r
617 } //-- void setJGroup(jalview.binding.JGroup)
\r
627 public void setJSeq(int index, jalview.binding.JSeq vJSeq)
\r
628 throws java.lang.IndexOutOfBoundsException
\r
630 //-- check bounds for index
\r
631 if ((index < 0) || (index > _JSeqList.size())) {
\r
632 throw new IndexOutOfBoundsException();
\r
634 _JSeqList.setElementAt(vJSeq, index);
\r
635 } //-- void setJSeq(int, jalview.binding.JSeq)
\r
644 public void setJSeq(jalview.binding.JSeq[] JSeqArray)
\r
647 _JSeqList.removeAllElements();
\r
648 for (int i = 0; i < JSeqArray.length; i++) {
\r
649 _JSeqList.addElement(JSeqArray[i]);
\r
651 } //-- void setJSeq(jalview.binding.JSeq)
\r
654 * Method setUserColours
\r
659 * @param vUserColours
\r
661 public void setUserColours(int index, jalview.binding.UserColours vUserColours)
\r
662 throws java.lang.IndexOutOfBoundsException
\r
664 //-- check bounds for index
\r
665 if ((index < 0) || (index > _userColoursList.size())) {
\r
666 throw new IndexOutOfBoundsException();
\r
668 _userColoursList.setElementAt(vUserColours, index);
\r
669 } //-- void setUserColours(int, jalview.binding.UserColours)
\r
672 * Method setUserColours
\r
676 * @param userColoursArray
\r
678 public void setUserColours(jalview.binding.UserColours[] userColoursArray)
\r
681 _userColoursList.removeAllElements();
\r
682 for (int i = 0; i < userColoursArray.length; i++) {
\r
683 _userColoursList.addElement(userColoursArray[i]);
\r
685 } //-- void setUserColours(jalview.binding.UserColours)
\r
688 * Method setViewport
\r
695 public void setViewport(int index, jalview.binding.Viewport vViewport)
\r
696 throws java.lang.IndexOutOfBoundsException
\r
698 //-- check bounds for index
\r
699 if ((index < 0) || (index > _viewportList.size())) {
\r
700 throw new IndexOutOfBoundsException();
\r
702 _viewportList.setElementAt(vViewport, index);
\r
703 } //-- void setViewport(int, jalview.binding.Viewport)
\r
706 * Method setViewport
\r
710 * @param viewportArray
\r
712 public void setViewport(jalview.binding.Viewport[] viewportArray)
\r
715 _viewportList.removeAllElements();
\r
716 for (int i = 0; i < viewportArray.length; i++) {
\r
717 _viewportList.addElement(viewportArray[i]);
\r
719 } //-- void setViewport(jalview.binding.Viewport)
\r
729 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
730 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
732 return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);
\r
733 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
739 public void validate()
\r
740 throws org.exolab.castor.xml.ValidationException
\r
742 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
743 validator.validate(this);
\r
744 } //-- void validate()
\r