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
48 * @version $Revision$ $Date$
\r
50 public class VAMSAS implements java.io.Serializable {
\r
53 //--------------------------/
\r
54 //- Class/Member Variables -/
\r
55 //--------------------------/
\r
58 * Field _alignmentList
\r
60 private java.util.Vector _alignmentList;
\r
65 private java.util.Vector _treeList;
\r
68 * Field _sequenceSetList
\r
70 private java.util.Vector _sequenceSetList;
\r
79 _alignmentList = new Vector();
\r
80 _treeList = new Vector();
\r
81 _sequenceSetList = new Vector();
\r
82 } //-- jalview.binding.VAMSAS()
\r
90 * Method addAlignment
\r
96 public void addAlignment(jalview.binding.Alignment vAlignment)
\r
97 throws java.lang.IndexOutOfBoundsException
\r
99 _alignmentList.addElement(vAlignment);
\r
100 } //-- void addAlignment(jalview.binding.Alignment)
\r
103 * Method addAlignment
\r
108 * @param vAlignment
\r
110 public void addAlignment(int index, jalview.binding.Alignment vAlignment)
\r
111 throws java.lang.IndexOutOfBoundsException
\r
113 _alignmentList.insertElementAt(vAlignment, index);
\r
114 } //-- void addAlignment(int, jalview.binding.Alignment)
\r
117 * Method addSequenceSet
\r
121 * @param vSequenceSet
\r
123 public void addSequenceSet(jalview.binding.SequenceSet vSequenceSet)
\r
124 throws java.lang.IndexOutOfBoundsException
\r
126 _sequenceSetList.addElement(vSequenceSet);
\r
127 } //-- void addSequenceSet(jalview.binding.SequenceSet)
\r
130 * Method addSequenceSet
\r
135 * @param vSequenceSet
\r
137 public void addSequenceSet(int index, jalview.binding.SequenceSet vSequenceSet)
\r
138 throws java.lang.IndexOutOfBoundsException
\r
140 _sequenceSetList.insertElementAt(vSequenceSet, index);
\r
141 } //-- void addSequenceSet(int, jalview.binding.SequenceSet)
\r
150 public void addTree(java.lang.String vTree)
\r
151 throws java.lang.IndexOutOfBoundsException
\r
153 _treeList.addElement(vTree);
\r
154 } //-- void addTree(java.lang.String)
\r
164 public void addTree(int index, java.lang.String vTree)
\r
165 throws java.lang.IndexOutOfBoundsException
\r
167 _treeList.insertElementAt(vTree, index);
\r
168 } //-- void addTree(int, java.lang.String)
\r
171 * Method enumerateAlignment
\r
175 * @return Enumeration
\r
177 public java.util.Enumeration enumerateAlignment()
\r
179 return _alignmentList.elements();
\r
180 } //-- java.util.Enumeration enumerateAlignment()
\r
183 * Method enumerateSequenceSet
\r
187 * @return Enumeration
\r
189 public java.util.Enumeration enumerateSequenceSet()
\r
191 return _sequenceSetList.elements();
\r
192 } //-- java.util.Enumeration enumerateSequenceSet()
\r
195 * Method enumerateTree
\r
199 * @return Enumeration
\r
201 public java.util.Enumeration enumerateTree()
\r
203 return _treeList.elements();
\r
204 } //-- java.util.Enumeration enumerateTree()
\r
207 * Method getAlignment
\r
212 * @return Alignment
\r
214 public jalview.binding.Alignment getAlignment(int index)
\r
215 throws java.lang.IndexOutOfBoundsException
\r
217 //-- check bounds for index
\r
218 if ((index < 0) || (index > _alignmentList.size())) {
\r
219 throw new IndexOutOfBoundsException();
\r
222 return (jalview.binding.Alignment) _alignmentList.elementAt(index);
\r
223 } //-- jalview.binding.Alignment getAlignment(int)
\r
226 * Method getAlignment
\r
230 * @return Alignment
\r
232 public jalview.binding.Alignment[] getAlignment()
\r
234 int size = _alignmentList.size();
\r
235 jalview.binding.Alignment[] mArray = new jalview.binding.Alignment[size];
\r
236 for (int index = 0; index < size; index++) {
\r
237 mArray[index] = (jalview.binding.Alignment) _alignmentList.elementAt(index);
\r
240 } //-- jalview.binding.Alignment[] getAlignment()
\r
243 * Method getAlignmentCount
\r
249 public int getAlignmentCount()
\r
251 return _alignmentList.size();
\r
252 } //-- int getAlignmentCount()
\r
255 * Method getSequenceSet
\r
260 * @return SequenceSet
\r
262 public jalview.binding.SequenceSet getSequenceSet(int index)
\r
263 throws java.lang.IndexOutOfBoundsException
\r
265 //-- check bounds for index
\r
266 if ((index < 0) || (index > _sequenceSetList.size())) {
\r
267 throw new IndexOutOfBoundsException();
\r
270 return (jalview.binding.SequenceSet) _sequenceSetList.elementAt(index);
\r
271 } //-- jalview.binding.SequenceSet getSequenceSet(int)
\r
274 * Method getSequenceSet
\r
278 * @return SequenceSet
\r
280 public jalview.binding.SequenceSet[] getSequenceSet()
\r
282 int size = _sequenceSetList.size();
\r
283 jalview.binding.SequenceSet[] mArray = new jalview.binding.SequenceSet[size];
\r
284 for (int index = 0; index < size; index++) {
\r
285 mArray[index] = (jalview.binding.SequenceSet) _sequenceSetList.elementAt(index);
\r
288 } //-- jalview.binding.SequenceSet[] getSequenceSet()
\r
291 * Method getSequenceSetCount
\r
297 public int getSequenceSetCount()
\r
299 return _sequenceSetList.size();
\r
300 } //-- int getSequenceSetCount()
\r
310 public java.lang.String getTree(int index)
\r
311 throws java.lang.IndexOutOfBoundsException
\r
313 //-- check bounds for index
\r
314 if ((index < 0) || (index > _treeList.size())) {
\r
315 throw new IndexOutOfBoundsException();
\r
318 return (String)_treeList.elementAt(index);
\r
319 } //-- java.lang.String getTree(int)
\r
328 public java.lang.String[] getTree()
\r
330 int size = _treeList.size();
\r
331 java.lang.String[] mArray = new java.lang.String[size];
\r
332 for (int index = 0; index < size; index++) {
\r
333 mArray[index] = (String)_treeList.elementAt(index);
\r
336 } //-- java.lang.String[] getTree()
\r
339 * Method getTreeCount
\r
345 public int getTreeCount()
\r
347 return _treeList.size();
\r
348 } //-- int getTreeCount()
\r
357 public boolean isValid()
\r
362 catch (org.exolab.castor.xml.ValidationException vex) {
\r
366 } //-- boolean isValid()
\r
375 public void marshal(java.io.Writer out)
\r
376 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
379 Marshaller.marshal(this, out);
\r
380 } //-- void marshal(java.io.Writer)
\r
389 public void marshal(org.xml.sax.ContentHandler handler)
\r
390 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
393 Marshaller.marshal(this, handler);
\r
394 } //-- void marshal(org.xml.sax.ContentHandler)
\r
397 * Method removeAlignment
\r
402 * @return Alignment
\r
404 public jalview.binding.Alignment removeAlignment(int index)
\r
406 java.lang.Object obj = _alignmentList.elementAt(index);
\r
407 _alignmentList.removeElementAt(index);
\r
408 return (jalview.binding.Alignment) obj;
\r
409 } //-- jalview.binding.Alignment removeAlignment(int)
\r
412 * Method removeAllAlignment
\r
415 public void removeAllAlignment()
\r
417 _alignmentList.removeAllElements();
\r
418 } //-- void removeAllAlignment()
\r
421 * Method removeAllSequenceSet
\r
424 public void removeAllSequenceSet()
\r
426 _sequenceSetList.removeAllElements();
\r
427 } //-- void removeAllSequenceSet()
\r
430 * Method removeAllTree
\r
433 public void removeAllTree()
\r
435 _treeList.removeAllElements();
\r
436 } //-- void removeAllTree()
\r
439 * Method removeSequenceSet
\r
444 * @return SequenceSet
\r
446 public jalview.binding.SequenceSet removeSequenceSet(int index)
\r
448 java.lang.Object obj = _sequenceSetList.elementAt(index);
\r
449 _sequenceSetList.removeElementAt(index);
\r
450 return (jalview.binding.SequenceSet) obj;
\r
451 } //-- jalview.binding.SequenceSet removeSequenceSet(int)
\r
454 * Method removeTree
\r
461 public java.lang.String removeTree(int index)
\r
463 java.lang.Object obj = _treeList.elementAt(index);
\r
464 _treeList.removeElementAt(index);
\r
465 return (String)obj;
\r
466 } //-- java.lang.String removeTree(int)
\r
469 * Method setAlignment
\r
474 * @param vAlignment
\r
476 public void setAlignment(int index, jalview.binding.Alignment vAlignment)
\r
477 throws java.lang.IndexOutOfBoundsException
\r
479 //-- check bounds for index
\r
480 if ((index < 0) || (index > _alignmentList.size())) {
\r
481 throw new IndexOutOfBoundsException();
\r
483 _alignmentList.setElementAt(vAlignment, index);
\r
484 } //-- void setAlignment(int, jalview.binding.Alignment)
\r
487 * Method setAlignment
\r
491 * @param alignmentArray
\r
493 public void setAlignment(jalview.binding.Alignment[] alignmentArray)
\r
496 _alignmentList.removeAllElements();
\r
497 for (int i = 0; i < alignmentArray.length; i++) {
\r
498 _alignmentList.addElement(alignmentArray[i]);
\r
500 } //-- void setAlignment(jalview.binding.Alignment)
\r
503 * Method setSequenceSet
\r
508 * @param vSequenceSet
\r
510 public void setSequenceSet(int index, jalview.binding.SequenceSet vSequenceSet)
\r
511 throws java.lang.IndexOutOfBoundsException
\r
513 //-- check bounds for index
\r
514 if ((index < 0) || (index > _sequenceSetList.size())) {
\r
515 throw new IndexOutOfBoundsException();
\r
517 _sequenceSetList.setElementAt(vSequenceSet, index);
\r
518 } //-- void setSequenceSet(int, jalview.binding.SequenceSet)
\r
521 * Method setSequenceSet
\r
525 * @param sequenceSetArray
\r
527 public void setSequenceSet(jalview.binding.SequenceSet[] sequenceSetArray)
\r
530 _sequenceSetList.removeAllElements();
\r
531 for (int i = 0; i < sequenceSetArray.length; i++) {
\r
532 _sequenceSetList.addElement(sequenceSetArray[i]);
\r
534 } //-- void setSequenceSet(jalview.binding.SequenceSet)
\r
544 public void setTree(int index, java.lang.String vTree)
\r
545 throws java.lang.IndexOutOfBoundsException
\r
547 //-- check bounds for index
\r
548 if ((index < 0) || (index > _treeList.size())) {
\r
549 throw new IndexOutOfBoundsException();
\r
551 _treeList.setElementAt(vTree, index);
\r
552 } //-- void setTree(int, java.lang.String)
\r
561 public void setTree(java.lang.String[] treeArray)
\r
564 _treeList.removeAllElements();
\r
565 for (int i = 0; i < treeArray.length; i++) {
\r
566 _treeList.addElement(treeArray[i]);
\r
568 } //-- void setTree(java.lang.String)
\r
578 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
579 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
581 return (jalview.binding.VAMSAS) Unmarshaller.unmarshal(jalview.binding.VAMSAS.class, reader);
\r
582 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
588 public void validate()
\r
589 throws org.exolab.castor.xml.ValidationException
\r
591 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
592 validator.validate(this);
\r
593 } //-- void validate()
\r