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 * Jalview - A Sequence Alignment Editor and Viewer
\r
9 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
11 * This program is free software; you can redistribute it and/or
\r
12 * modify it under the terms of the GNU General Public License
\r
13 * as published by the Free Software Foundation; either version 2
\r
14 * of the License, or (at your option) any later version.
\r
16 * This program is distributed in the hope that it will be useful,
\r
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
19 * GNU General Public License for more details.
\r
21 * You should have received a copy of the GNU General Public License
\r
22 * along with this program; if not, write to the Free Software
\r
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
25 package jalview.binding;
\r
27 import org.exolab.castor.xml.MarshalException;
\r
28 import org.exolab.castor.xml.Marshaller;
\r
29 import org.exolab.castor.xml.Unmarshaller;
\r
30 import org.exolab.castor.xml.ValidationException;
\r
32 import org.xml.sax.ContentHandler;
\r
34 //---------------------------------/
\r
35 //- Imported classes and packages -/
\r
36 //---------------------------------/
\r
37 import java.io.IOException;
\r
38 import java.io.Reader;
\r
39 import java.io.Serializable;
\r
40 import java.io.Writer;
\r
42 import java.util.Enumeration;
\r
43 import java.util.Vector;
\r
49 * @version $Revision$ $Date$
\r
51 public class VAMSAS implements java.io.Serializable {
\r
52 //--------------------------/
\r
53 //- Class/Member Variables -/
\r
54 //--------------------------/
\r
57 * Field _alignmentList
\r
59 private java.util.Vector _alignmentList;
\r
64 private java.util.Vector _treeList;
\r
67 * Field _sequenceSetList
\r
69 private java.util.Vector _sequenceSetList;
\r
76 _alignmentList = new Vector();
\r
77 _treeList = new Vector();
\r
78 _sequenceSetList = new Vector();
\r
80 //-- jalview.binding.VAMSAS()
\r
83 public void addAlignment(jalview.binding.Alignment vAlignment)
\r
84 throws java.lang.IndexOutOfBoundsException {
\r
85 _alignmentList.addElement(vAlignment);
\r
87 //-- void addAlignment(jalview.binding.Alignment)
\r
90 * Method addAlignment
\r
97 public void addAlignment(int index, jalview.binding.Alignment vAlignment)
\r
98 throws java.lang.IndexOutOfBoundsException {
\r
99 _alignmentList.insertElementAt(vAlignment, index);
\r
101 //-- void addAlignment(int, jalview.binding.Alignment)
\r
104 * Method addSequenceSet
\r
108 * @param vSequenceSet
\r
110 public void addSequenceSet(jalview.binding.SequenceSet vSequenceSet)
\r
111 throws java.lang.IndexOutOfBoundsException {
\r
112 _sequenceSetList.addElement(vSequenceSet);
\r
114 //-- void addSequenceSet(jalview.binding.SequenceSet)
\r
117 * Method addSequenceSet
\r
122 * @param vSequenceSet
\r
124 public void addSequenceSet(int index,
\r
125 jalview.binding.SequenceSet vSequenceSet)
\r
126 throws java.lang.IndexOutOfBoundsException {
\r
127 _sequenceSetList.insertElementAt(vSequenceSet, index);
\r
129 //-- void addSequenceSet(int, jalview.binding.SequenceSet)
\r
138 public void addTree(java.lang.String vTree)
\r
139 throws java.lang.IndexOutOfBoundsException {
\r
140 _treeList.addElement(vTree);
\r
142 //-- void addTree(java.lang.String)
\r
152 public void addTree(int index, java.lang.String vTree)
\r
153 throws java.lang.IndexOutOfBoundsException {
\r
154 _treeList.insertElementAt(vTree, index);
\r
156 //-- void addTree(int, java.lang.String)
\r
159 * Method enumerateAlignment
\r
163 * @return Enumeration
\r
165 public java.util.Enumeration enumerateAlignment() {
\r
166 return _alignmentList.elements();
\r
168 //-- java.util.Enumeration enumerateAlignment()
\r
171 * Method enumerateSequenceSet
\r
175 * @return Enumeration
\r
177 public java.util.Enumeration enumerateSequenceSet() {
\r
178 return _sequenceSetList.elements();
\r
180 //-- java.util.Enumeration enumerateSequenceSet()
\r
183 * Method enumerateTree
\r
187 * @return Enumeration
\r
189 public java.util.Enumeration enumerateTree() {
\r
190 return _treeList.elements();
\r
192 //-- java.util.Enumeration enumerateTree()
\r
195 * Method getAlignment
\r
200 * @return Alignment
\r
202 public jalview.binding.Alignment getAlignment(int index)
\r
203 throws java.lang.IndexOutOfBoundsException {
\r
204 //-- check bounds for index
\r
205 if ((index < 0) || (index > _alignmentList.size())) {
\r
206 throw new IndexOutOfBoundsException();
\r
209 return (jalview.binding.Alignment) _alignmentList.elementAt(index);
\r
211 //-- jalview.binding.Alignment getAlignment(int)
\r
214 * Method getAlignment
\r
218 * @return Alignment
\r
220 public jalview.binding.Alignment[] getAlignment() {
\r
221 int size = _alignmentList.size();
\r
222 jalview.binding.Alignment[] mArray = new jalview.binding.Alignment[size];
\r
224 for (int index = 0; index < size; index++) {
\r
225 mArray[index] = (jalview.binding.Alignment) _alignmentList.elementAt(index);
\r
230 //-- jalview.binding.Alignment[] getAlignment()
\r
233 * Method getAlignmentCount
\r
239 public int getAlignmentCount() {
\r
240 return _alignmentList.size();
\r
242 //-- int getAlignmentCount()
\r
245 * Method getSequenceSet
\r
250 * @return SequenceSet
\r
252 public jalview.binding.SequenceSet getSequenceSet(int index)
\r
253 throws java.lang.IndexOutOfBoundsException {
\r
254 //-- check bounds for index
\r
255 if ((index < 0) || (index > _sequenceSetList.size())) {
\r
256 throw new IndexOutOfBoundsException();
\r
259 return (jalview.binding.SequenceSet) _sequenceSetList.elementAt(index);
\r
261 //-- jalview.binding.SequenceSet getSequenceSet(int)
\r
264 * Method getSequenceSet
\r
268 * @return SequenceSet
\r
270 public jalview.binding.SequenceSet[] getSequenceSet() {
\r
271 int size = _sequenceSetList.size();
\r
272 jalview.binding.SequenceSet[] mArray = new jalview.binding.SequenceSet[size];
\r
274 for (int index = 0; index < size; index++) {
\r
275 mArray[index] = (jalview.binding.SequenceSet) _sequenceSetList.elementAt(index);
\r
280 //-- jalview.binding.SequenceSet[] getSequenceSet()
\r
283 * Method getSequenceSetCount
\r
289 public int getSequenceSetCount() {
\r
290 return _sequenceSetList.size();
\r
292 //-- int getSequenceSetCount()
\r
302 public java.lang.String getTree(int index)
\r
303 throws java.lang.IndexOutOfBoundsException {
\r
304 //-- check bounds for index
\r
305 if ((index < 0) || (index > _treeList.size())) {
\r
306 throw new IndexOutOfBoundsException();
\r
309 return (String) _treeList.elementAt(index);
\r
311 //-- java.lang.String getTree(int)
\r
320 public java.lang.String[] getTree() {
\r
321 int size = _treeList.size();
\r
322 java.lang.String[] mArray = new java.lang.String[size];
\r
324 for (int index = 0; index < size; index++) {
\r
325 mArray[index] = (String) _treeList.elementAt(index);
\r
330 //-- java.lang.String[] getTree()
\r
333 * Method getTreeCount
\r
339 public int getTreeCount() {
\r
340 return _treeList.size();
\r
342 //-- int getTreeCount()
\r
351 public boolean isValid() {
\r
354 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
360 //-- boolean isValid()
\r
369 public void marshal(java.io.Writer out)
\r
370 throws org.exolab.castor.xml.MarshalException,
\r
371 org.exolab.castor.xml.ValidationException {
\r
372 Marshaller.marshal(this, out);
\r
374 //-- void marshal(java.io.Writer)
\r
383 public void marshal(org.xml.sax.ContentHandler handler)
\r
384 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
\r
385 org.exolab.castor.xml.ValidationException {
\r
386 Marshaller.marshal(this, handler);
\r
388 //-- void marshal(org.xml.sax.ContentHandler)
\r
391 * Method removeAlignment
\r
396 * @return Alignment
\r
398 public jalview.binding.Alignment removeAlignment(int index) {
\r
399 java.lang.Object obj = _alignmentList.elementAt(index);
\r
400 _alignmentList.removeElementAt(index);
\r
402 return (jalview.binding.Alignment) obj;
\r
404 //-- jalview.binding.Alignment removeAlignment(int)
\r
407 * Method removeAllAlignment
\r
410 public void removeAllAlignment() {
\r
411 _alignmentList.removeAllElements();
\r
413 //-- void removeAllAlignment()
\r
416 * Method removeAllSequenceSet
\r
419 public void removeAllSequenceSet() {
\r
420 _sequenceSetList.removeAllElements();
\r
422 //-- void removeAllSequenceSet()
\r
425 * Method removeAllTree
\r
428 public void removeAllTree() {
\r
429 _treeList.removeAllElements();
\r
431 //-- void removeAllTree()
\r
434 * Method removeSequenceSet
\r
439 * @return SequenceSet
\r
441 public jalview.binding.SequenceSet removeSequenceSet(int index) {
\r
442 java.lang.Object obj = _sequenceSetList.elementAt(index);
\r
443 _sequenceSetList.removeElementAt(index);
\r
445 return (jalview.binding.SequenceSet) obj;
\r
447 //-- jalview.binding.SequenceSet removeSequenceSet(int)
\r
450 * Method removeTree
\r
457 public java.lang.String removeTree(int index) {
\r
458 java.lang.Object obj = _treeList.elementAt(index);
\r
459 _treeList.removeElementAt(index);
\r
461 return (String) obj;
\r
463 //-- java.lang.String removeTree(int)
\r
466 * Method setAlignment
\r
471 * @param vAlignment
\r
473 public void setAlignment(int index, jalview.binding.Alignment vAlignment)
\r
474 throws java.lang.IndexOutOfBoundsException {
\r
475 //-- check bounds for index
\r
476 if ((index < 0) || (index > _alignmentList.size())) {
\r
477 throw new IndexOutOfBoundsException();
\r
480 _alignmentList.setElementAt(vAlignment, index);
\r
482 //-- void setAlignment(int, jalview.binding.Alignment)
\r
485 * Method setAlignment
\r
489 * @param alignmentArray
\r
491 public void setAlignment(jalview.binding.Alignment[] alignmentArray) {
\r
493 _alignmentList.removeAllElements();
\r
495 for (int i = 0; i < alignmentArray.length; i++) {
\r
496 _alignmentList.addElement(alignmentArray[i]);
\r
499 //-- void setAlignment(jalview.binding.Alignment)
\r
502 * Method setSequenceSet
\r
507 * @param vSequenceSet
\r
509 public void setSequenceSet(int index,
\r
510 jalview.binding.SequenceSet vSequenceSet)
\r
511 throws java.lang.IndexOutOfBoundsException {
\r
512 //-- check bounds for index
\r
513 if ((index < 0) || (index > _sequenceSetList.size())) {
\r
514 throw new IndexOutOfBoundsException();
\r
517 _sequenceSetList.setElementAt(vSequenceSet, index);
\r
519 //-- void setSequenceSet(int, jalview.binding.SequenceSet)
\r
522 * Method setSequenceSet
\r
526 * @param sequenceSetArray
\r
528 public void setSequenceSet(jalview.binding.SequenceSet[] sequenceSetArray) {
\r
530 _sequenceSetList.removeAllElements();
\r
532 for (int i = 0; i < sequenceSetArray.length; i++) {
\r
533 _sequenceSetList.addElement(sequenceSetArray[i]);
\r
536 //-- void setSequenceSet(jalview.binding.SequenceSet)
\r
546 public void setTree(int index, java.lang.String vTree)
\r
547 throws java.lang.IndexOutOfBoundsException {
\r
548 //-- check bounds for index
\r
549 if ((index < 0) || (index > _treeList.size())) {
\r
550 throw new IndexOutOfBoundsException();
\r
553 _treeList.setElementAt(vTree, index);
\r
555 //-- void setTree(int, java.lang.String)
\r
564 public void setTree(java.lang.String[] treeArray) {
\r
566 _treeList.removeAllElements();
\r
568 for (int i = 0; i < treeArray.length; i++) {
\r
569 _treeList.addElement(treeArray[i]);
\r
572 //-- void setTree(java.lang.String)
\r
582 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
583 throws org.exolab.castor.xml.MarshalException,
\r
584 org.exolab.castor.xml.ValidationException {
\r
585 return (jalview.binding.VAMSAS) Unmarshaller.unmarshal(jalview.binding.VAMSAS.class,
\r
588 //-- java.lang.Object unmarshal(java.io.Reader)
\r
594 public void validate() throws org.exolab.castor.xml.ValidationException {
\r
595 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
596 validator.validate(this);
\r
598 //-- void validate()
\r