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
63 public JalviewModelSequence() {
\r
65 _JSeqList = new Vector();
\r
66 _JGroupList = new Vector();
\r
67 _viewportList = new Vector();
\r
68 _userColoursList = new Vector();
\r
69 } //-- jalview.binding.JalviewModelSequence()
\r
83 public void addJGroup(jalview.binding.JGroup vJGroup)
\r
84 throws java.lang.IndexOutOfBoundsException
\r
86 _JGroupList.addElement(vJGroup);
\r
87 } //-- void addJGroup(jalview.binding.JGroup)
\r
97 public void addJGroup(int index, jalview.binding.JGroup vJGroup)
\r
98 throws java.lang.IndexOutOfBoundsException
\r
100 _JGroupList.insertElementAt(vJGroup, index);
\r
101 } //-- void addJGroup(int, jalview.binding.JGroup)
\r
110 public void addJSeq(jalview.binding.JSeq vJSeq)
\r
111 throws java.lang.IndexOutOfBoundsException
\r
113 _JSeqList.addElement(vJSeq);
\r
114 } //-- void addJSeq(jalview.binding.JSeq)
\r
124 public void addJSeq(int index, jalview.binding.JSeq vJSeq)
\r
125 throws java.lang.IndexOutOfBoundsException
\r
127 _JSeqList.insertElementAt(vJSeq, index);
\r
128 } //-- void addJSeq(int, jalview.binding.JSeq)
\r
131 * Method addUserColours
\r
135 * @param vUserColours
\r
137 public void addUserColours(jalview.binding.UserColours vUserColours)
\r
138 throws java.lang.IndexOutOfBoundsException
\r
140 _userColoursList.addElement(vUserColours);
\r
141 } //-- void addUserColours(jalview.binding.UserColours)
\r
144 * Method addUserColours
\r
149 * @param vUserColours
\r
151 public void addUserColours(int index, jalview.binding.UserColours vUserColours)
\r
152 throws java.lang.IndexOutOfBoundsException
\r
154 _userColoursList.insertElementAt(vUserColours, index);
\r
155 } //-- void addUserColours(int, jalview.binding.UserColours)
\r
158 * Method addViewport
\r
164 public void addViewport(jalview.binding.Viewport vViewport)
\r
165 throws java.lang.IndexOutOfBoundsException
\r
167 _viewportList.addElement(vViewport);
\r
168 } //-- void addViewport(jalview.binding.Viewport)
\r
171 * Method addViewport
\r
178 public void addViewport(int index, jalview.binding.Viewport vViewport)
\r
179 throws java.lang.IndexOutOfBoundsException
\r
181 _viewportList.insertElementAt(vViewport, index);
\r
182 } //-- void addViewport(int, jalview.binding.Viewport)
\r
185 * Method enumerateJGroup
\r
189 * @return Enumeration
\r
191 public java.util.Enumeration enumerateJGroup()
\r
193 return _JGroupList.elements();
\r
194 } //-- java.util.Enumeration enumerateJGroup()
\r
197 * Method enumerateJSeq
\r
201 * @return Enumeration
\r
203 public java.util.Enumeration enumerateJSeq()
\r
205 return _JSeqList.elements();
\r
206 } //-- java.util.Enumeration enumerateJSeq()
\r
209 * Method enumerateUserColours
\r
213 * @return Enumeration
\r
215 public java.util.Enumeration enumerateUserColours()
\r
217 return _userColoursList.elements();
\r
218 } //-- java.util.Enumeration enumerateUserColours()
\r
221 * Method enumerateViewport
\r
225 * @return Enumeration
\r
227 public java.util.Enumeration enumerateViewport()
\r
229 return _viewportList.elements();
\r
230 } //-- java.util.Enumeration enumerateViewport()
\r
240 public jalview.binding.JGroup getJGroup(int index)
\r
241 throws java.lang.IndexOutOfBoundsException
\r
243 //-- check bounds for index
\r
244 if ((index < 0) || (index > _JGroupList.size())) {
\r
245 throw new IndexOutOfBoundsException();
\r
248 return (jalview.binding.JGroup) _JGroupList.elementAt(index);
\r
249 } //-- jalview.binding.JGroup getJGroup(int)
\r
258 public jalview.binding.JGroup[] getJGroup()
\r
260 int size = _JGroupList.size();
\r
261 jalview.binding.JGroup[] mArray = new jalview.binding.JGroup[size];
\r
262 for (int index = 0; index < size; index++) {
\r
263 mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index);
\r
266 } //-- jalview.binding.JGroup[] getJGroup()
\r
269 * Method getJGroupCount
\r
275 public int getJGroupCount()
\r
277 return _JGroupList.size();
\r
278 } //-- int getJGroupCount()
\r
288 public jalview.binding.JSeq getJSeq(int index)
\r
289 throws java.lang.IndexOutOfBoundsException
\r
291 //-- check bounds for index
\r
292 if ((index < 0) || (index > _JSeqList.size())) {
\r
293 throw new IndexOutOfBoundsException();
\r
296 return (jalview.binding.JSeq) _JSeqList.elementAt(index);
\r
297 } //-- jalview.binding.JSeq getJSeq(int)
\r
306 public jalview.binding.JSeq[] getJSeq()
\r
308 int size = _JSeqList.size();
\r
309 jalview.binding.JSeq[] mArray = new jalview.binding.JSeq[size];
\r
310 for (int index = 0; index < size; index++) {
\r
311 mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index);
\r
314 } //-- jalview.binding.JSeq[] getJSeq()
\r
317 * Method getJSeqCount
\r
323 public int getJSeqCount()
\r
325 return _JSeqList.size();
\r
326 } //-- int getJSeqCount()
\r
329 * Method getUserColours
\r
334 * @return UserColours
\r
336 public jalview.binding.UserColours getUserColours(int index)
\r
337 throws java.lang.IndexOutOfBoundsException
\r
339 //-- check bounds for index
\r
340 if ((index < 0) || (index > _userColoursList.size())) {
\r
341 throw new IndexOutOfBoundsException();
\r
344 return (jalview.binding.UserColours) _userColoursList.elementAt(index);
\r
345 } //-- jalview.binding.UserColours getUserColours(int)
\r
348 * Method getUserColours
\r
352 * @return UserColours
\r
354 public jalview.binding.UserColours[] getUserColours()
\r
356 int size = _userColoursList.size();
\r
357 jalview.binding.UserColours[] mArray = new jalview.binding.UserColours[size];
\r
358 for (int index = 0; index < size; index++) {
\r
359 mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(index);
\r
362 } //-- jalview.binding.UserColours[] getUserColours()
\r
365 * Method getUserColoursCount
\r
371 public int getUserColoursCount()
\r
373 return _userColoursList.size();
\r
374 } //-- int getUserColoursCount()
\r
377 * Method getViewport
\r
384 public jalview.binding.Viewport getViewport(int index)
\r
385 throws java.lang.IndexOutOfBoundsException
\r
387 //-- check bounds for index
\r
388 if ((index < 0) || (index > _viewportList.size())) {
\r
389 throw new IndexOutOfBoundsException();
\r
392 return (jalview.binding.Viewport) _viewportList.elementAt(index);
\r
393 } //-- jalview.binding.Viewport getViewport(int)
\r
396 * Method getViewport
\r
402 public jalview.binding.Viewport[] getViewport()
\r
404 int size = _viewportList.size();
\r
405 jalview.binding.Viewport[] mArray = new jalview.binding.Viewport[size];
\r
406 for (int index = 0; index < size; index++) {
\r
407 mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index);
\r
410 } //-- jalview.binding.Viewport[] getViewport()
\r
413 * Method getViewportCount
\r
419 public int getViewportCount()
\r
421 return _viewportList.size();
\r
422 } //-- int getViewportCount()
\r
431 public boolean isValid()
\r
436 catch (org.exolab.castor.xml.ValidationException vex) {
\r
440 } //-- boolean isValid()
\r
449 public void marshal(java.io.Writer out)
\r
450 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
453 Marshaller.marshal(this, out);
\r
454 } //-- void marshal(java.io.Writer)
\r
463 public void marshal(org.xml.sax.ContentHandler handler)
\r
464 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
467 Marshaller.marshal(this, handler);
\r
468 } //-- void marshal(org.xml.sax.ContentHandler)
\r
471 * Method removeAllJGroup
\r
474 public void removeAllJGroup()
\r
476 _JGroupList.removeAllElements();
\r
477 } //-- void removeAllJGroup()
\r
480 * Method removeAllJSeq
\r
483 public void removeAllJSeq()
\r
485 _JSeqList.removeAllElements();
\r
486 } //-- void removeAllJSeq()
\r
489 * Method removeAllUserColours
\r
492 public void removeAllUserColours()
\r
494 _userColoursList.removeAllElements();
\r
495 } //-- void removeAllUserColours()
\r
498 * Method removeAllViewport
\r
501 public void removeAllViewport()
\r
503 _viewportList.removeAllElements();
\r
504 } //-- void removeAllViewport()
\r
507 * Method removeJGroup
\r
514 public jalview.binding.JGroup removeJGroup(int index)
\r
516 java.lang.Object obj = _JGroupList.elementAt(index);
\r
517 _JGroupList.removeElementAt(index);
\r
518 return (jalview.binding.JGroup) obj;
\r
519 } //-- jalview.binding.JGroup removeJGroup(int)
\r
522 * Method removeJSeq
\r
529 public jalview.binding.JSeq removeJSeq(int index)
\r
531 java.lang.Object obj = _JSeqList.elementAt(index);
\r
532 _JSeqList.removeElementAt(index);
\r
533 return (jalview.binding.JSeq) obj;
\r
534 } //-- jalview.binding.JSeq removeJSeq(int)
\r
537 * Method removeUserColours
\r
542 * @return UserColours
\r
544 public jalview.binding.UserColours removeUserColours(int index)
\r
546 java.lang.Object obj = _userColoursList.elementAt(index);
\r
547 _userColoursList.removeElementAt(index);
\r
548 return (jalview.binding.UserColours) obj;
\r
549 } //-- jalview.binding.UserColours removeUserColours(int)
\r
552 * Method removeViewport
\r
559 public jalview.binding.Viewport removeViewport(int index)
\r
561 java.lang.Object obj = _viewportList.elementAt(index);
\r
562 _viewportList.removeElementAt(index);
\r
563 return (jalview.binding.Viewport) obj;
\r
564 } //-- jalview.binding.Viewport removeViewport(int)
\r
574 public void setJGroup(int index, jalview.binding.JGroup vJGroup)
\r
575 throws java.lang.IndexOutOfBoundsException
\r
577 //-- check bounds for index
\r
578 if ((index < 0) || (index > _JGroupList.size())) {
\r
579 throw new IndexOutOfBoundsException();
\r
581 _JGroupList.setElementAt(vJGroup, index);
\r
582 } //-- void setJGroup(int, jalview.binding.JGroup)
\r
589 * @param JGroupArray
\r
591 public void setJGroup(jalview.binding.JGroup[] JGroupArray)
\r
594 _JGroupList.removeAllElements();
\r
595 for (int i = 0; i < JGroupArray.length; i++) {
\r
596 _JGroupList.addElement(JGroupArray[i]);
\r
598 } //-- void setJGroup(jalview.binding.JGroup)
\r
608 public void setJSeq(int index, jalview.binding.JSeq vJSeq)
\r
609 throws java.lang.IndexOutOfBoundsException
\r
611 //-- check bounds for index
\r
612 if ((index < 0) || (index > _JSeqList.size())) {
\r
613 throw new IndexOutOfBoundsException();
\r
615 _JSeqList.setElementAt(vJSeq, index);
\r
616 } //-- void setJSeq(int, jalview.binding.JSeq)
\r
625 public void setJSeq(jalview.binding.JSeq[] JSeqArray)
\r
628 _JSeqList.removeAllElements();
\r
629 for (int i = 0; i < JSeqArray.length; i++) {
\r
630 _JSeqList.addElement(JSeqArray[i]);
\r
632 } //-- void setJSeq(jalview.binding.JSeq)
\r
635 * Method setUserColours
\r
640 * @param vUserColours
\r
642 public void setUserColours(int index, jalview.binding.UserColours vUserColours)
\r
643 throws java.lang.IndexOutOfBoundsException
\r
645 //-- check bounds for index
\r
646 if ((index < 0) || (index > _userColoursList.size())) {
\r
647 throw new IndexOutOfBoundsException();
\r
649 _userColoursList.setElementAt(vUserColours, index);
\r
650 } //-- void setUserColours(int, jalview.binding.UserColours)
\r
653 * Method setUserColours
\r
657 * @param userColoursArray
\r
659 public void setUserColours(jalview.binding.UserColours[] userColoursArray)
\r
662 _userColoursList.removeAllElements();
\r
663 for (int i = 0; i < userColoursArray.length; i++) {
\r
664 _userColoursList.addElement(userColoursArray[i]);
\r
666 } //-- void setUserColours(jalview.binding.UserColours)
\r
669 * Method setViewport
\r
676 public void setViewport(int index, jalview.binding.Viewport vViewport)
\r
677 throws java.lang.IndexOutOfBoundsException
\r
679 //-- check bounds for index
\r
680 if ((index < 0) || (index > _viewportList.size())) {
\r
681 throw new IndexOutOfBoundsException();
\r
683 _viewportList.setElementAt(vViewport, index);
\r
684 } //-- void setViewport(int, jalview.binding.Viewport)
\r
687 * Method setViewport
\r
691 * @param viewportArray
\r
693 public void setViewport(jalview.binding.Viewport[] viewportArray)
\r
696 _viewportList.removeAllElements();
\r
697 for (int i = 0; i < viewportArray.length; i++) {
\r
698 _viewportList.addElement(viewportArray[i]);
\r
700 } //-- void setViewport(jalview.binding.Viewport)
\r
710 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
711 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
713 return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);
\r
714 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
720 public void validate()
\r
721 throws org.exolab.castor.xml.ValidationException
\r
723 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
724 validator.validate(this);
\r
725 } //-- void validate()
\r