2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
7 package jalview.binding;
\r
9 import org.exolab.castor.xml.MarshalException;
\r
10 import org.exolab.castor.xml.Marshaller;
\r
11 import org.exolab.castor.xml.Unmarshaller;
\r
12 import org.exolab.castor.xml.ValidationException;
\r
14 import org.xml.sax.ContentHandler;
\r
16 //---------------------------------/
\r
17 //- Imported classes and packages -/
\r
18 //---------------------------------/
\r
19 import java.io.IOException;
\r
20 import java.io.Reader;
\r
21 import java.io.Serializable;
\r
22 import java.io.Writer;
\r
24 import java.util.Enumeration;
\r
25 import java.util.Vector;
\r
29 * Class SequenceSet.
\r
31 * @version $Revision$ $Date$
\r
33 public class SequenceSet implements java.io.Serializable
\r
35 //--------------------------/
\r
36 //- Class/Member Variables -/
\r
37 //--------------------------/
\r
42 private java.lang.String _gapChar;
\r
47 private boolean _aligned;
\r
50 * keeps track of state for field: _aligned
\r
52 private boolean _has_aligned;
\r
55 * Field _sequenceList
\r
57 private java.util.Vector _sequenceList;
\r
60 * Field _annotationList
\r
62 private java.util.Vector _annotationList;
\r
67 public SequenceSet()
\r
70 _sequenceList = new Vector();
\r
71 _annotationList = new Vector();
\r
74 //-- jalview.binding.SequenceSet()
\r
80 * @param vAnnotation DOCUMENT ME!
\r
82 * @throws java.lang.IndexOutOfBoundsException DOCUMENT ME!
\r
84 public void addAnnotation(jalview.binding.Annotation vAnnotation)
\r
85 throws java.lang.IndexOutOfBoundsException
\r
87 _annotationList.addElement(vAnnotation);
\r
90 //-- void addAnnotation(jalview.binding.Annotation)
\r
93 * Method addAnnotation
\r
98 * @param vAnnotation
\r
100 public void addAnnotation(int index, jalview.binding.Annotation vAnnotation)
\r
101 throws java.lang.IndexOutOfBoundsException
\r
103 _annotationList.insertElementAt(vAnnotation, index);
\r
106 //-- void addAnnotation(int, jalview.binding.Annotation)
\r
109 * Method addSequence
\r
115 public void addSequence(jalview.binding.Sequence vSequence)
\r
116 throws java.lang.IndexOutOfBoundsException
\r
118 _sequenceList.addElement(vSequence);
\r
121 //-- void addSequence(jalview.binding.Sequence)
\r
124 * Method addSequence
\r
131 public void addSequence(int index, jalview.binding.Sequence vSequence)
\r
132 throws java.lang.IndexOutOfBoundsException
\r
134 _sequenceList.insertElementAt(vSequence, index);
\r
137 //-- void addSequence(int, jalview.binding.Sequence)
\r
140 * Method deleteAligned
\r
143 public void deleteAligned()
\r
145 this._has_aligned = false;
\r
148 //-- void deleteAligned()
\r
151 * Method enumerateAnnotation
\r
155 * @return Enumeration
\r
157 public java.util.Enumeration enumerateAnnotation()
\r
159 return _annotationList.elements();
\r
162 //-- java.util.Enumeration enumerateAnnotation()
\r
165 * Method enumerateSequence
\r
169 * @return Enumeration
\r
171 public java.util.Enumeration enumerateSequence()
\r
173 return _sequenceList.elements();
\r
176 //-- java.util.Enumeration enumerateSequence()
\r
179 * Returns the value of field 'aligned'.
\r
182 * @return the value of field 'aligned'.
\r
184 public boolean getAligned()
\r
186 return this._aligned;
\r
189 //-- boolean getAligned()
\r
192 * Method getAnnotation
\r
197 * @return Annotation
\r
199 public jalview.binding.Annotation getAnnotation(int index)
\r
200 throws java.lang.IndexOutOfBoundsException
\r
202 //-- check bounds for index
\r
203 if ((index < 0) || (index > _annotationList.size()))
\r
205 throw new IndexOutOfBoundsException();
\r
208 return (jalview.binding.Annotation) _annotationList.elementAt(index);
\r
211 //-- jalview.binding.Annotation getAnnotation(int)
\r
214 * Method getAnnotation
\r
218 * @return Annotation
\r
220 public jalview.binding.Annotation[] getAnnotation()
\r
222 int size = _annotationList.size();
\r
223 jalview.binding.Annotation[] mArray = new jalview.binding.Annotation[size];
\r
225 for (int index = 0; index < size; index++)
\r
227 mArray[index] = (jalview.binding.Annotation) _annotationList.elementAt(index);
\r
233 //-- jalview.binding.Annotation[] getAnnotation()
\r
236 * Method getAnnotationCount
\r
242 public int getAnnotationCount()
\r
244 return _annotationList.size();
\r
247 //-- int getAnnotationCount()
\r
250 * Returns the value of field 'gapChar'.
\r
253 * @return the value of field 'gapChar'.
\r
255 public java.lang.String getGapChar()
\r
257 return this._gapChar;
\r
260 //-- java.lang.String getGapChar()
\r
263 * Method getSequence
\r
270 public jalview.binding.Sequence getSequence(int index)
\r
271 throws java.lang.IndexOutOfBoundsException
\r
273 //-- check bounds for index
\r
274 if ((index < 0) || (index > _sequenceList.size()))
\r
276 throw new IndexOutOfBoundsException();
\r
279 return (jalview.binding.Sequence) _sequenceList.elementAt(index);
\r
282 //-- jalview.binding.Sequence getSequence(int)
\r
285 * Method getSequence
\r
291 public jalview.binding.Sequence[] getSequence()
\r
293 int size = _sequenceList.size();
\r
294 jalview.binding.Sequence[] mArray = new jalview.binding.Sequence[size];
\r
296 for (int index = 0; index < size; index++)
\r
298 mArray[index] = (jalview.binding.Sequence) _sequenceList.elementAt(index);
\r
304 //-- jalview.binding.Sequence[] getSequence()
\r
307 * Method getSequenceCount
\r
313 public int getSequenceCount()
\r
315 return _sequenceList.size();
\r
318 //-- int getSequenceCount()
\r
321 * Method hasAligned
\r
327 public boolean hasAligned()
\r
329 return this._has_aligned;
\r
332 //-- boolean hasAligned()
\r
341 public boolean isValid()
\r
347 catch (org.exolab.castor.xml.ValidationException vex)
\r
355 //-- boolean isValid()
\r
364 public void marshal(java.io.Writer out)
\r
365 throws org.exolab.castor.xml.MarshalException,
\r
366 org.exolab.castor.xml.ValidationException
\r
368 Marshaller.marshal(this, out);
\r
371 //-- void marshal(java.io.Writer)
\r
380 public void marshal(org.xml.sax.ContentHandler handler)
\r
381 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
\r
382 org.exolab.castor.xml.ValidationException
\r
384 Marshaller.marshal(this, handler);
\r
387 //-- void marshal(org.xml.sax.ContentHandler)
\r
390 * Method removeAllAnnotation
\r
393 public void removeAllAnnotation()
\r
395 _annotationList.removeAllElements();
\r
398 //-- void removeAllAnnotation()
\r
401 * Method removeAllSequence
\r
404 public void removeAllSequence()
\r
406 _sequenceList.removeAllElements();
\r
409 //-- void removeAllSequence()
\r
412 * Method removeAnnotation
\r
417 * @return Annotation
\r
419 public jalview.binding.Annotation removeAnnotation(int index)
\r
421 java.lang.Object obj = _annotationList.elementAt(index);
\r
422 _annotationList.removeElementAt(index);
\r
424 return (jalview.binding.Annotation) obj;
\r
427 //-- jalview.binding.Annotation removeAnnotation(int)
\r
430 * Method removeSequence
\r
437 public jalview.binding.Sequence removeSequence(int index)
\r
439 java.lang.Object obj = _sequenceList.elementAt(index);
\r
440 _sequenceList.removeElementAt(index);
\r
442 return (jalview.binding.Sequence) obj;
\r
445 //-- jalview.binding.Sequence removeSequence(int)
\r
448 * Sets the value of field 'aligned'.
\r
450 * @param aligned the value of field 'aligned'.
\r
452 public void setAligned(boolean aligned)
\r
454 this._aligned = aligned;
\r
455 this._has_aligned = true;
\r
458 //-- void setAligned(boolean)
\r
461 * Method setAnnotation
\r
466 * @param vAnnotation
\r
468 public void setAnnotation(int index, jalview.binding.Annotation vAnnotation)
\r
469 throws java.lang.IndexOutOfBoundsException
\r
471 //-- check bounds for index
\r
472 if ((index < 0) || (index > _annotationList.size()))
\r
474 throw new IndexOutOfBoundsException();
\r
477 _annotationList.setElementAt(vAnnotation, index);
\r
480 //-- void setAnnotation(int, jalview.binding.Annotation)
\r
483 * Method setAnnotation
\r
487 * @param annotationArray
\r
489 public void setAnnotation(jalview.binding.Annotation[] annotationArray)
\r
492 _annotationList.removeAllElements();
\r
494 for (int i = 0; i < annotationArray.length; i++)
\r
496 _annotationList.addElement(annotationArray[i]);
\r
500 //-- void setAnnotation(jalview.binding.Annotation)
\r
503 * Sets the value of field 'gapChar'.
\r
505 * @param gapChar the value of field 'gapChar'.
\r
507 public void setGapChar(java.lang.String gapChar)
\r
509 this._gapChar = gapChar;
\r
512 //-- void setGapChar(java.lang.String)
\r
515 * Method setSequence
\r
522 public void setSequence(int index, jalview.binding.Sequence vSequence)
\r
523 throws java.lang.IndexOutOfBoundsException
\r
525 //-- check bounds for index
\r
526 if ((index < 0) || (index > _sequenceList.size()))
\r
528 throw new IndexOutOfBoundsException();
\r
531 _sequenceList.setElementAt(vSequence, index);
\r
534 //-- void setSequence(int, jalview.binding.Sequence)
\r
537 * Method setSequence
\r
541 * @param sequenceArray
\r
543 public void setSequence(jalview.binding.Sequence[] sequenceArray)
\r
546 _sequenceList.removeAllElements();
\r
548 for (int i = 0; i < sequenceArray.length; i++)
\r
550 _sequenceList.addElement(sequenceArray[i]);
\r
554 //-- void setSequence(jalview.binding.Sequence)
\r
564 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
565 throws org.exolab.castor.xml.MarshalException,
\r
566 org.exolab.castor.xml.ValidationException
\r
568 return (jalview.binding.SequenceSet) Unmarshaller.unmarshal(jalview.binding.SequenceSet.class,
\r
572 //-- java.lang.Object unmarshal(java.io.Reader)
\r
578 public void validate() throws org.exolab.castor.xml.ValidationException
\r
580 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
581 validator.validate(this);
\r
584 //-- void validate()
\r