2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package jalview.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
18 * Class SequenceSet.
\r
20 * @version $Revision$ $Date$
\r
22 public class SequenceSet implements java.io.Serializable {
\r
25 //--------------------------/
\r
26 //- Class/Member Variables -/
\r
27 //--------------------------/
\r
32 private java.lang.String _gapChar;
\r
35 * Field _sequenceList.
\r
37 private java.util.Vector _sequenceList;
\r
40 * Field _annotationList.
\r
42 private java.util.Vector _annotationList;
\r
45 * Field _sequenceSetPropertiesList.
\r
47 private java.util.Vector _sequenceSetPropertiesList;
\r
54 public SequenceSet() {
\r
56 this._sequenceList = new java.util.Vector();
\r
57 this._annotationList = new java.util.Vector();
\r
58 this._sequenceSetPropertiesList = new java.util.Vector();
\r
69 * @param vAnnotation
\r
70 * @throws java.lang.IndexOutOfBoundsException if the index
\r
71 * given is outside the bounds of the collection
\r
73 public void addAnnotation(
\r
74 final jalview.schemabinding.version2.Annotation vAnnotation)
\r
75 throws java.lang.IndexOutOfBoundsException {
\r
76 this._annotationList.addElement(vAnnotation);
\r
83 * @param vAnnotation
\r
84 * @throws java.lang.IndexOutOfBoundsException if the index
\r
85 * given is outside the bounds of the collection
\r
87 public void addAnnotation(
\r
89 final jalview.schemabinding.version2.Annotation vAnnotation)
\r
90 throws java.lang.IndexOutOfBoundsException {
\r
91 this._annotationList.add(index, vAnnotation);
\r
98 * @throws java.lang.IndexOutOfBoundsException if the index
\r
99 * given is outside the bounds of the collection
\r
101 public void addSequence(
\r
102 final jalview.schemabinding.version2.Sequence vSequence)
\r
103 throws java.lang.IndexOutOfBoundsException {
\r
104 this._sequenceList.addElement(vSequence);
\r
112 * @throws java.lang.IndexOutOfBoundsException if the index
\r
113 * given is outside the bounds of the collection
\r
115 public void addSequence(
\r
117 final jalview.schemabinding.version2.Sequence vSequence)
\r
118 throws java.lang.IndexOutOfBoundsException {
\r
119 this._sequenceList.add(index, vSequence);
\r
125 * @param vSequenceSetProperties
\r
126 * @throws java.lang.IndexOutOfBoundsException if the index
\r
127 * given is outside the bounds of the collection
\r
129 public void addSequenceSetProperties(
\r
130 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
\r
131 throws java.lang.IndexOutOfBoundsException {
\r
132 this._sequenceSetPropertiesList.addElement(vSequenceSetProperties);
\r
139 * @param vSequenceSetProperties
\r
140 * @throws java.lang.IndexOutOfBoundsException if the index
\r
141 * given is outside the bounds of the collection
\r
143 public void addSequenceSetProperties(
\r
145 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
\r
146 throws java.lang.IndexOutOfBoundsException {
\r
147 this._sequenceSetPropertiesList.add(index, vSequenceSetProperties);
\r
151 * Method enumerateAnnotation.
\r
153 * @return an Enumeration over all
\r
154 * jalview.schemabinding.version2.Annotation elements
\r
156 public java.util.Enumeration enumerateAnnotation(
\r
158 return this._annotationList.elements();
\r
162 * Method enumerateSequence.
\r
164 * @return an Enumeration over all
\r
165 * jalview.schemabinding.version2.Sequence elements
\r
167 public java.util.Enumeration enumerateSequence(
\r
169 return this._sequenceList.elements();
\r
173 * Method enumerateSequenceSetProperties.
\r
175 * @return an Enumeration over all
\r
176 * jalview.schemabinding.version2.SequenceSetProperties elements
\r
178 public java.util.Enumeration enumerateSequenceSetProperties(
\r
180 return this._sequenceSetPropertiesList.elements();
\r
184 * Method getAnnotation.
\r
187 * @throws java.lang.IndexOutOfBoundsException if the index
\r
188 * given is outside the bounds of the collection
\r
189 * @return the value of the
\r
190 * jalview.schemabinding.version2.Annotation at the given index
\r
192 public jalview.schemabinding.version2.Annotation getAnnotation(
\r
194 throws java.lang.IndexOutOfBoundsException {
\r
195 // check bounds for index
\r
196 if (index < 0 || index >= this._annotationList.size()) {
\r
197 throw new IndexOutOfBoundsException("getAnnotation: Index value '" + index + "' not in range [0.." + (this._annotationList.size() - 1) + "]");
\r
200 return (jalview.schemabinding.version2.Annotation) _annotationList.get(index);
\r
204 * Method getAnnotation.Returns the contents of the collection
\r
205 * in an Array. <p>Note: Just in case the collection contents
\r
206 * are changing in another thread, we pass a 0-length Array of
\r
207 * the correct type into the API call. This way we <i>know</i>
\r
208 * that the Array returned is of exactly the correct length.
\r
210 * @return this collection as an Array
\r
212 public jalview.schemabinding.version2.Annotation[] getAnnotation(
\r
214 jalview.schemabinding.version2.Annotation[] array = new jalview.schemabinding.version2.Annotation[0];
\r
215 return (jalview.schemabinding.version2.Annotation[]) this._annotationList.toArray(array);
\r
219 * Method getAnnotationCount.
\r
221 * @return the size of this collection
\r
223 public int getAnnotationCount(
\r
225 return this._annotationList.size();
\r
229 * Returns the value of field 'gapChar'.
\r
231 * @return the value of field 'GapChar'.
\r
233 public java.lang.String getGapChar(
\r
235 return this._gapChar;
\r
239 * Method getSequence.
\r
242 * @throws java.lang.IndexOutOfBoundsException if the index
\r
243 * given is outside the bounds of the collection
\r
244 * @return the value of the
\r
245 * jalview.schemabinding.version2.Sequence at the given index
\r
247 public jalview.schemabinding.version2.Sequence getSequence(
\r
249 throws java.lang.IndexOutOfBoundsException {
\r
250 // check bounds for index
\r
251 if (index < 0 || index >= this._sequenceList.size()) {
\r
252 throw new IndexOutOfBoundsException("getSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
\r
255 return (jalview.schemabinding.version2.Sequence) _sequenceList.get(index);
\r
259 * Method getSequence.Returns the contents of the collection in
\r
260 * an Array. <p>Note: Just in case the collection contents
\r
261 * are changing in another thread, we pass a 0-length Array of
\r
262 * the correct type into the API call. This way we <i>know</i>
\r
263 * that the Array returned is of exactly the correct length.
\r
265 * @return this collection as an Array
\r
267 public jalview.schemabinding.version2.Sequence[] getSequence(
\r
269 jalview.schemabinding.version2.Sequence[] array = new jalview.schemabinding.version2.Sequence[0];
\r
270 return (jalview.schemabinding.version2.Sequence[]) this._sequenceList.toArray(array);
\r
274 * Method getSequenceCount.
\r
276 * @return the size of this collection
\r
278 public int getSequenceCount(
\r
280 return this._sequenceList.size();
\r
284 * Method getSequenceSetProperties.
\r
287 * @throws java.lang.IndexOutOfBoundsException if the index
\r
288 * given is outside the bounds of the collection
\r
289 * @return the value of the
\r
290 * jalview.schemabinding.version2.SequenceSetProperties at the
\r
293 public jalview.schemabinding.version2.SequenceSetProperties getSequenceSetProperties(
\r
295 throws java.lang.IndexOutOfBoundsException {
\r
296 // check bounds for index
\r
297 if (index < 0 || index >= this._sequenceSetPropertiesList.size()) {
\r
298 throw new IndexOutOfBoundsException("getSequenceSetProperties: Index value '" + index + "' not in range [0.." + (this._sequenceSetPropertiesList.size() - 1) + "]");
\r
301 return (jalview.schemabinding.version2.SequenceSetProperties) _sequenceSetPropertiesList.get(index);
\r
305 * Method getSequenceSetProperties.Returns the contents of the
\r
306 * collection in an Array. <p>Note: Just in case the
\r
307 * collection contents are changing in another thread, we pass
\r
308 * a 0-length Array of the correct type into the API call.
\r
309 * This way we <i>know</i> that the Array returned is of
\r
310 * exactly the correct length.
\r
312 * @return this collection as an Array
\r
314 public jalview.schemabinding.version2.SequenceSetProperties[] getSequenceSetProperties(
\r
316 jalview.schemabinding.version2.SequenceSetProperties[] array = new jalview.schemabinding.version2.SequenceSetProperties[0];
\r
317 return (jalview.schemabinding.version2.SequenceSetProperties[]) this._sequenceSetPropertiesList.toArray(array);
\r
321 * Method getSequenceSetPropertiesCount.
\r
323 * @return the size of this collection
\r
325 public int getSequenceSetPropertiesCount(
\r
327 return this._sequenceSetPropertiesList.size();
\r
333 * @return true if this object is valid according to the schema
\r
335 public boolean isValid(
\r
339 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
349 * @throws org.exolab.castor.xml.MarshalException if object is
\r
350 * null or if any SAXException is thrown during marshaling
\r
351 * @throws org.exolab.castor.xml.ValidationException if this
\r
352 * object is an invalid instance according to the schema
\r
354 public void marshal(
\r
355 final java.io.Writer out)
\r
356 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
357 Marshaller.marshal(this, out);
\r
364 * @throws java.io.IOException if an IOException occurs during
\r
366 * @throws org.exolab.castor.xml.ValidationException if this
\r
367 * object is an invalid instance according to the schema
\r
368 * @throws org.exolab.castor.xml.MarshalException if object is
\r
369 * null or if any SAXException is thrown during marshaling
\r
371 public void marshal(
\r
372 final org.xml.sax.ContentHandler handler)
\r
373 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
374 Marshaller.marshal(this, handler);
\r
379 public void removeAllAnnotation(
\r
381 this._annotationList.clear();
\r
386 public void removeAllSequence(
\r
388 this._sequenceList.clear();
\r
393 public void removeAllSequenceSetProperties(
\r
395 this._sequenceSetPropertiesList.clear();
\r
399 * Method removeAnnotation.
\r
401 * @param vAnnotation
\r
402 * @return true if the object was removed from the collection.
\r
404 public boolean removeAnnotation(
\r
405 final jalview.schemabinding.version2.Annotation vAnnotation) {
\r
406 boolean removed = _annotationList.remove(vAnnotation);
\r
411 * Method removeAnnotationAt.
\r
414 * @return the element removed from the collection
\r
416 public jalview.schemabinding.version2.Annotation removeAnnotationAt(
\r
418 java.lang.Object obj = this._annotationList.remove(index);
\r
419 return (jalview.schemabinding.version2.Annotation) obj;
\r
423 * Method removeSequence.
\r
426 * @return true if the object was removed from the collection.
\r
428 public boolean removeSequence(
\r
429 final jalview.schemabinding.version2.Sequence vSequence) {
\r
430 boolean removed = _sequenceList.remove(vSequence);
\r
435 * Method removeSequenceAt.
\r
438 * @return the element removed from the collection
\r
440 public jalview.schemabinding.version2.Sequence removeSequenceAt(
\r
442 java.lang.Object obj = this._sequenceList.remove(index);
\r
443 return (jalview.schemabinding.version2.Sequence) obj;
\r
447 * Method removeSequenceSetProperties.
\r
449 * @param vSequenceSetProperties
\r
450 * @return true if the object was removed from the collection.
\r
452 public boolean removeSequenceSetProperties(
\r
453 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) {
\r
454 boolean removed = _sequenceSetPropertiesList.remove(vSequenceSetProperties);
\r
459 * Method removeSequenceSetPropertiesAt.
\r
462 * @return the element removed from the collection
\r
464 public jalview.schemabinding.version2.SequenceSetProperties removeSequenceSetPropertiesAt(
\r
466 java.lang.Object obj = this._sequenceSetPropertiesList.remove(index);
\r
467 return (jalview.schemabinding.version2.SequenceSetProperties) obj;
\r
474 * @param vAnnotation
\r
475 * @throws java.lang.IndexOutOfBoundsException if the index
\r
476 * given is outside the bounds of the collection
\r
478 public void setAnnotation(
\r
480 final jalview.schemabinding.version2.Annotation vAnnotation)
\r
481 throws java.lang.IndexOutOfBoundsException {
\r
482 // check bounds for index
\r
483 if (index < 0 || index >= this._annotationList.size()) {
\r
484 throw new IndexOutOfBoundsException("setAnnotation: Index value '" + index + "' not in range [0.." + (this._annotationList.size() - 1) + "]");
\r
487 this._annotationList.set(index, vAnnotation);
\r
493 * @param vAnnotationArray
\r
495 public void setAnnotation(
\r
496 final jalview.schemabinding.version2.Annotation[] vAnnotationArray) {
\r
498 _annotationList.clear();
\r
500 for (int i = 0; i < vAnnotationArray.length; i++) {
\r
501 this._annotationList.add(vAnnotationArray[i]);
\r
506 * Sets the value of field 'gapChar'.
\r
508 * @param gapChar the value of field 'gapChar'.
\r
510 public void setGapChar(
\r
511 final java.lang.String gapChar) {
\r
512 this._gapChar = gapChar;
\r
520 * @throws java.lang.IndexOutOfBoundsException if the index
\r
521 * given is outside the bounds of the collection
\r
523 public void setSequence(
\r
525 final jalview.schemabinding.version2.Sequence vSequence)
\r
526 throws java.lang.IndexOutOfBoundsException {
\r
527 // check bounds for index
\r
528 if (index < 0 || index >= this._sequenceList.size()) {
\r
529 throw new IndexOutOfBoundsException("setSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
\r
532 this._sequenceList.set(index, vSequence);
\r
538 * @param vSequenceArray
\r
540 public void setSequence(
\r
541 final jalview.schemabinding.version2.Sequence[] vSequenceArray) {
\r
543 _sequenceList.clear();
\r
545 for (int i = 0; i < vSequenceArray.length; i++) {
\r
546 this._sequenceList.add(vSequenceArray[i]);
\r
554 * @param vSequenceSetProperties
\r
555 * @throws java.lang.IndexOutOfBoundsException if the index
\r
556 * given is outside the bounds of the collection
\r
558 public void setSequenceSetProperties(
\r
560 final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties)
\r
561 throws java.lang.IndexOutOfBoundsException {
\r
562 // check bounds for index
\r
563 if (index < 0 || index >= this._sequenceSetPropertiesList.size()) {
\r
564 throw new IndexOutOfBoundsException("setSequenceSetProperties: Index value '" + index + "' not in range [0.." + (this._sequenceSetPropertiesList.size() - 1) + "]");
\r
567 this._sequenceSetPropertiesList.set(index, vSequenceSetProperties);
\r
573 * @param vSequenceSetPropertiesArray
\r
575 public void setSequenceSetProperties(
\r
576 final jalview.schemabinding.version2.SequenceSetProperties[] vSequenceSetPropertiesArray) {
\r
578 _sequenceSetPropertiesList.clear();
\r
580 for (int i = 0; i < vSequenceSetPropertiesArray.length; i++) {
\r
581 this._sequenceSetPropertiesList.add(vSequenceSetPropertiesArray[i]);
\r
586 * Method unmarshal.
\r
589 * @throws org.exolab.castor.xml.MarshalException if object is
\r
590 * null or if any SAXException is thrown during marshaling
\r
591 * @throws org.exolab.castor.xml.ValidationException if this
\r
592 * object is an invalid instance according to the schema
\r
593 * @return the unmarshaled
\r
594 * jalview.schemabinding.version2.SequenceSet
\r
596 public static jalview.schemabinding.version2.SequenceSet unmarshal(
\r
597 final java.io.Reader reader)
\r
598 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
599 return (jalview.schemabinding.version2.SequenceSet) Unmarshaller.unmarshal(jalview.schemabinding.version2.SequenceSet.class, reader);
\r
605 * @throws org.exolab.castor.xml.ValidationException if this
\r
606 * object is an invalid instance according to the schema
\r
608 public void validate(
\r
610 throws org.exolab.castor.xml.ValidationException {
\r
611 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
612 validator.validate(this);
\r