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.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
16 import org.exolab.castor.xml.*;
\r
19 * Class SequenceSet.
\r
21 * @version $Revision$ $Date$
\r
23 public class SequenceSet
\r
24 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
34 private java.lang.String _gapChar;
\r
37 * Field _sequenceList
\r
39 private java.util.Vector _sequenceList;
\r
42 * Field _annotationList
\r
44 private java.util.Vector _annotationList;
\r
50 public SequenceSet()
\r
53 _sequenceList = new Vector();
\r
54 _annotationList = new Vector();
\r
55 } //-- jalview.schemabinding.version2.SequenceSet()
\r
62 * Method addAnnotation
\r
66 * @param vAnnotation
\r
68 public void addAnnotation(jalview.schemabinding.version2.Annotation
\r
70 throws java.lang.IndexOutOfBoundsException
\r
72 _annotationList.addElement(vAnnotation);
\r
73 } //-- void addAnnotation(jalview.schemabinding.version2.Annotation)
\r
76 * Method addAnnotation
\r
81 * @param vAnnotation
\r
83 public void addAnnotation(int index,
\r
84 jalview.schemabinding.version2.Annotation
\r
86 throws java.lang.IndexOutOfBoundsException
\r
88 _annotationList.insertElementAt(vAnnotation, index);
\r
89 } //-- void addAnnotation(int, jalview.schemabinding.version2.Annotation)
\r
92 * Method addSequence
\r
98 public void addSequence(jalview.schemabinding.version2.Sequence vSequence)
\r
99 throws java.lang.IndexOutOfBoundsException
\r
101 _sequenceList.addElement(vSequence);
\r
102 } //-- void addSequence(jalview.schemabinding.version2.Sequence)
\r
105 * Method addSequence
\r
112 public void addSequence(int index,
\r
113 jalview.schemabinding.version2.Sequence vSequence)
\r
114 throws java.lang.IndexOutOfBoundsException
\r
116 _sequenceList.insertElementAt(vSequence, index);
\r
117 } //-- void addSequence(int, jalview.schemabinding.version2.Sequence)
\r
120 * Method enumerateAnnotation
\r
124 * @return Enumeration
\r
126 public java.util.Enumeration enumerateAnnotation()
\r
128 return _annotationList.elements();
\r
129 } //-- java.util.Enumeration enumerateAnnotation()
\r
132 * Method enumerateSequence
\r
136 * @return Enumeration
\r
138 public java.util.Enumeration enumerateSequence()
\r
140 return _sequenceList.elements();
\r
141 } //-- java.util.Enumeration enumerateSequence()
\r
144 * Method getAnnotation
\r
149 * @return Annotation
\r
151 public jalview.schemabinding.version2.Annotation getAnnotation(int index)
\r
152 throws java.lang.IndexOutOfBoundsException
\r
154 //-- check bounds for index
\r
155 if ( (index < 0) || (index > _annotationList.size()))
\r
157 throw new IndexOutOfBoundsException();
\r
160 return (jalview.schemabinding.version2.Annotation) _annotationList.
\r
162 } //-- jalview.schemabinding.version2.Annotation getAnnotation(int)
\r
165 * Method getAnnotation
\r
169 * @return Annotation
\r
171 public jalview.schemabinding.version2.Annotation[] getAnnotation()
\r
173 int size = _annotationList.size();
\r
174 jalview.schemabinding.version2.Annotation[] mArray = new jalview.
\r
175 schemabinding.version2.Annotation[size];
\r
176 for (int index = 0; index < size; index++)
\r
178 mArray[index] = (jalview.schemabinding.version2.Annotation)
\r
179 _annotationList.elementAt(index);
\r
182 } //-- jalview.schemabinding.version2.Annotation[] getAnnotation()
\r
185 * Method getAnnotationCount
\r
191 public int getAnnotationCount()
\r
193 return _annotationList.size();
\r
194 } //-- int getAnnotationCount()
\r
197 * Returns the value of field 'gapChar'.
\r
200 * @return the value of field 'gapChar'.
\r
202 public java.lang.String getGapChar()
\r
204 return this._gapChar;
\r
205 } //-- java.lang.String getGapChar()
\r
208 * Method getSequence
\r
215 public jalview.schemabinding.version2.Sequence getSequence(int index)
\r
216 throws java.lang.IndexOutOfBoundsException
\r
218 //-- check bounds for index
\r
219 if ( (index < 0) || (index > _sequenceList.size()))
\r
221 throw new IndexOutOfBoundsException();
\r
224 return (jalview.schemabinding.version2.Sequence) _sequenceList.elementAt(
\r
226 } //-- jalview.schemabinding.version2.Sequence getSequence(int)
\r
229 * Method getSequence
\r
235 public jalview.schemabinding.version2.Sequence[] getSequence()
\r
237 int size = _sequenceList.size();
\r
238 jalview.schemabinding.version2.Sequence[] mArray = new jalview.
\r
239 schemabinding.version2.Sequence[size];
\r
240 for (int index = 0; index < size; index++)
\r
242 mArray[index] = (jalview.schemabinding.version2.Sequence) _sequenceList.
\r
246 } //-- jalview.schemabinding.version2.Sequence[] getSequence()
\r
249 * Method getSequenceCount
\r
255 public int getSequenceCount()
\r
257 return _sequenceList.size();
\r
258 } //-- int getSequenceCount()
\r
267 public boolean isValid()
\r
273 catch (org.exolab.castor.xml.ValidationException vex)
\r
278 } //-- boolean isValid()
\r
287 public void marshal(java.io.Writer out)
\r
288 throws org.exolab.castor.xml.MarshalException,
\r
289 org.exolab.castor.xml.ValidationException
\r
292 Marshaller.marshal(this, out);
\r
293 } //-- void marshal(java.io.Writer)
\r
302 public void marshal(org.xml.sax.ContentHandler handler)
\r
303 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
\r
304 org.exolab.castor.xml.ValidationException
\r
307 Marshaller.marshal(this, handler);
\r
308 } //-- void marshal(org.xml.sax.ContentHandler)
\r
311 * Method removeAllAnnotation
\r
314 public void removeAllAnnotation()
\r
316 _annotationList.removeAllElements();
\r
317 } //-- void removeAllAnnotation()
\r
320 * Method removeAllSequence
\r
323 public void removeAllSequence()
\r
325 _sequenceList.removeAllElements();
\r
326 } //-- void removeAllSequence()
\r
329 * Method removeAnnotation
\r
334 * @return Annotation
\r
336 public jalview.schemabinding.version2.Annotation removeAnnotation(int index)
\r
338 java.lang.Object obj = _annotationList.elementAt(index);
\r
339 _annotationList.removeElementAt(index);
\r
340 return (jalview.schemabinding.version2.Annotation) obj;
\r
341 } //-- jalview.schemabinding.version2.Annotation removeAnnotation(int)
\r
344 * Method removeSequence
\r
351 public jalview.schemabinding.version2.Sequence removeSequence(int index)
\r
353 java.lang.Object obj = _sequenceList.elementAt(index);
\r
354 _sequenceList.removeElementAt(index);
\r
355 return (jalview.schemabinding.version2.Sequence) obj;
\r
356 } //-- jalview.schemabinding.version2.Sequence removeSequence(int)
\r
359 * Method setAnnotation
\r
364 * @param vAnnotation
\r
366 public void setAnnotation(int index,
\r
367 jalview.schemabinding.version2.Annotation
\r
369 throws java.lang.IndexOutOfBoundsException
\r
371 //-- check bounds for index
\r
372 if ( (index < 0) || (index > _annotationList.size()))
\r
374 throw new IndexOutOfBoundsException();
\r
376 _annotationList.setElementAt(vAnnotation, index);
\r
377 } //-- void setAnnotation(int, jalview.schemabinding.version2.Annotation)
\r
380 * Method setAnnotation
\r
384 * @param annotationArray
\r
386 public void setAnnotation(jalview.schemabinding.version2.Annotation[]
\r
390 _annotationList.removeAllElements();
\r
391 for (int i = 0; i < annotationArray.length; i++)
\r
393 _annotationList.addElement(annotationArray[i]);
\r
395 } //-- void setAnnotation(jalview.schemabinding.version2.Annotation)
\r
398 * Sets the value of field 'gapChar'.
\r
400 * @param gapChar the value of field 'gapChar'.
\r
402 public void setGapChar(java.lang.String gapChar)
\r
404 this._gapChar = gapChar;
\r
405 } //-- void setGapChar(java.lang.String)
\r
408 * Method setSequence
\r
415 public void setSequence(int index,
\r
416 jalview.schemabinding.version2.Sequence vSequence)
\r
417 throws java.lang.IndexOutOfBoundsException
\r
419 //-- check bounds for index
\r
420 if ( (index < 0) || (index > _sequenceList.size()))
\r
422 throw new IndexOutOfBoundsException();
\r
424 _sequenceList.setElementAt(vSequence, index);
\r
425 } //-- void setSequence(int, jalview.schemabinding.version2.Sequence)
\r
428 * Method setSequence
\r
432 * @param sequenceArray
\r
434 public void setSequence(jalview.schemabinding.version2.Sequence[]
\r
438 _sequenceList.removeAllElements();
\r
439 for (int i = 0; i < sequenceArray.length; i++)
\r
441 _sequenceList.addElement(sequenceArray[i]);
\r
443 } //-- void setSequence(jalview.schemabinding.version2.Sequence)
\r
453 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
454 throws org.exolab.castor.xml.MarshalException,
\r
455 org.exolab.castor.xml.ValidationException
\r
457 return (jalview.schemabinding.version2.SequenceSet) Unmarshaller.unmarshal(
\r
458 jalview.schemabinding.version2.SequenceSet.class, reader);
\r
459 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
465 public void validate()
\r
466 throws org.exolab.castor.xml.ValidationException
\r
468 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.
\r
470 validator.validate(this);
\r
471 } //-- void validate()
\r