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.binding;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import java.io.IOException;
\r
15 import java.io.Reader;
\r
16 import java.io.Serializable;
\r
17 import java.io.Writer;
\r
18 import java.util.Enumeration;
\r
19 import java.util.Vector;
\r
20 import org.exolab.castor.xml.MarshalException;
\r
21 import org.exolab.castor.xml.Marshaller;
\r
22 import org.exolab.castor.xml.Unmarshaller;
\r
23 import org.exolab.castor.xml.ValidationException;
\r
24 import org.xml.sax.ContentHandler;
\r
27 * Class SequenceSet.
\r
29 * @version $Revision$ $Date$
\r
31 public class SequenceSet implements java.io.Serializable {
\r
34 //--------------------------/
\r
35 //- Class/Member Variables -/
\r
36 //--------------------------/
\r
41 private java.lang.String _gapChar;
\r
46 private boolean _aligned;
\r
49 * keeps track of state for field: _aligned
\r
51 private boolean _has_aligned;
\r
54 * Field _sequenceList
\r
56 private java.util.Vector _sequenceList;
\r
59 * Field _annotationList
\r
61 private java.util.Vector _annotationList;
\r
68 public SequenceSet() {
\r
70 _sequenceList = new Vector();
\r
71 _annotationList = new Vector();
\r
72 } //-- jalview.binding.SequenceSet()
\r
80 * Method addAnnotation
\r
84 * @param vAnnotation
\r
86 public void addAnnotation(jalview.binding.Annotation vAnnotation)
\r
87 throws java.lang.IndexOutOfBoundsException
\r
89 _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
104 } //-- void addAnnotation(int, jalview.binding.Annotation)
\r
107 * Method addSequence
\r
113 public void addSequence(jalview.binding.Sequence vSequence)
\r
114 throws java.lang.IndexOutOfBoundsException
\r
116 _sequenceList.addElement(vSequence);
\r
117 } //-- void addSequence(jalview.binding.Sequence)
\r
120 * Method addSequence
\r
127 public void addSequence(int index, jalview.binding.Sequence vSequence)
\r
128 throws java.lang.IndexOutOfBoundsException
\r
130 _sequenceList.insertElementAt(vSequence, index);
\r
131 } //-- void addSequence(int, jalview.binding.Sequence)
\r
134 * Method deleteAligned
\r
137 public void deleteAligned()
\r
139 this._has_aligned= false;
\r
140 } //-- void deleteAligned()
\r
143 * Method enumerateAnnotation
\r
147 * @return Enumeration
\r
149 public java.util.Enumeration enumerateAnnotation()
\r
151 return _annotationList.elements();
\r
152 } //-- java.util.Enumeration enumerateAnnotation()
\r
155 * Method enumerateSequence
\r
159 * @return Enumeration
\r
161 public java.util.Enumeration enumerateSequence()
\r
163 return _sequenceList.elements();
\r
164 } //-- java.util.Enumeration enumerateSequence()
\r
167 * Returns the value of field 'aligned'.
\r
170 * @return the value of field 'aligned'.
\r
172 public boolean getAligned()
\r
174 return this._aligned;
\r
175 } //-- boolean getAligned()
\r
178 * Method getAnnotation
\r
183 * @return Annotation
\r
185 public jalview.binding.Annotation getAnnotation(int index)
\r
186 throws java.lang.IndexOutOfBoundsException
\r
188 //-- check bounds for index
\r
189 if ((index < 0) || (index > _annotationList.size())) {
\r
190 throw new IndexOutOfBoundsException();
\r
193 return (jalview.binding.Annotation) _annotationList.elementAt(index);
\r
194 } //-- jalview.binding.Annotation getAnnotation(int)
\r
197 * Method getAnnotation
\r
201 * @return Annotation
\r
203 public jalview.binding.Annotation[] getAnnotation()
\r
205 int size = _annotationList.size();
\r
206 jalview.binding.Annotation[] mArray = new jalview.binding.Annotation[size];
\r
207 for (int index = 0; index < size; index++) {
\r
208 mArray[index] = (jalview.binding.Annotation) _annotationList.elementAt(index);
\r
211 } //-- jalview.binding.Annotation[] getAnnotation()
\r
214 * Method getAnnotationCount
\r
220 public int getAnnotationCount()
\r
222 return _annotationList.size();
\r
223 } //-- int getAnnotationCount()
\r
226 * Returns the value of field 'gapChar'.
\r
229 * @return the value of field 'gapChar'.
\r
231 public java.lang.String getGapChar()
\r
233 return this._gapChar;
\r
234 } //-- java.lang.String getGapChar()
\r
237 * Method getSequence
\r
244 public jalview.binding.Sequence getSequence(int index)
\r
245 throws java.lang.IndexOutOfBoundsException
\r
247 //-- check bounds for index
\r
248 if ((index < 0) || (index > _sequenceList.size())) {
\r
249 throw new IndexOutOfBoundsException();
\r
252 return (jalview.binding.Sequence) _sequenceList.elementAt(index);
\r
253 } //-- jalview.binding.Sequence getSequence(int)
\r
256 * Method getSequence
\r
262 public jalview.binding.Sequence[] getSequence()
\r
264 int size = _sequenceList.size();
\r
265 jalview.binding.Sequence[] mArray = new jalview.binding.Sequence[size];
\r
266 for (int index = 0; index < size; index++) {
\r
267 mArray[index] = (jalview.binding.Sequence) _sequenceList.elementAt(index);
\r
270 } //-- jalview.binding.Sequence[] getSequence()
\r
273 * Method getSequenceCount
\r
279 public int getSequenceCount()
\r
281 return _sequenceList.size();
\r
282 } //-- int getSequenceCount()
\r
285 * Method hasAligned
\r
291 public boolean hasAligned()
\r
293 return this._has_aligned;
\r
294 } //-- boolean hasAligned()
\r
303 public boolean isValid()
\r
308 catch (org.exolab.castor.xml.ValidationException vex) {
\r
312 } //-- boolean isValid()
\r
321 public void marshal(java.io.Writer out)
\r
322 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
325 Marshaller.marshal(this, out);
\r
326 } //-- void marshal(java.io.Writer)
\r
335 public void marshal(org.xml.sax.ContentHandler handler)
\r
336 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
339 Marshaller.marshal(this, handler);
\r
340 } //-- void marshal(org.xml.sax.ContentHandler)
\r
343 * Method removeAllAnnotation
\r
346 public void removeAllAnnotation()
\r
348 _annotationList.removeAllElements();
\r
349 } //-- void removeAllAnnotation()
\r
352 * Method removeAllSequence
\r
355 public void removeAllSequence()
\r
357 _sequenceList.removeAllElements();
\r
358 } //-- void removeAllSequence()
\r
361 * Method removeAnnotation
\r
366 * @return Annotation
\r
368 public jalview.binding.Annotation removeAnnotation(int index)
\r
370 java.lang.Object obj = _annotationList.elementAt(index);
\r
371 _annotationList.removeElementAt(index);
\r
372 return (jalview.binding.Annotation) obj;
\r
373 } //-- jalview.binding.Annotation removeAnnotation(int)
\r
376 * Method removeSequence
\r
383 public jalview.binding.Sequence removeSequence(int index)
\r
385 java.lang.Object obj = _sequenceList.elementAt(index);
\r
386 _sequenceList.removeElementAt(index);
\r
387 return (jalview.binding.Sequence) obj;
\r
388 } //-- jalview.binding.Sequence removeSequence(int)
\r
391 * Sets the value of field 'aligned'.
\r
393 * @param aligned the value of field 'aligned'.
\r
395 public void setAligned(boolean aligned)
\r
397 this._aligned = aligned;
\r
398 this._has_aligned = true;
\r
399 } //-- void setAligned(boolean)
\r
402 * Method setAnnotation
\r
407 * @param vAnnotation
\r
409 public void setAnnotation(int index, jalview.binding.Annotation vAnnotation)
\r
410 throws java.lang.IndexOutOfBoundsException
\r
412 //-- check bounds for index
\r
413 if ((index < 0) || (index > _annotationList.size())) {
\r
414 throw new IndexOutOfBoundsException();
\r
416 _annotationList.setElementAt(vAnnotation, index);
\r
417 } //-- void setAnnotation(int, jalview.binding.Annotation)
\r
420 * Method setAnnotation
\r
424 * @param annotationArray
\r
426 public void setAnnotation(jalview.binding.Annotation[] annotationArray)
\r
429 _annotationList.removeAllElements();
\r
430 for (int i = 0; i < annotationArray.length; i++) {
\r
431 _annotationList.addElement(annotationArray[i]);
\r
433 } //-- void setAnnotation(jalview.binding.Annotation)
\r
436 * Sets the value of field 'gapChar'.
\r
438 * @param gapChar the value of field 'gapChar'.
\r
440 public void setGapChar(java.lang.String gapChar)
\r
442 this._gapChar = gapChar;
\r
443 } //-- void setGapChar(java.lang.String)
\r
446 * Method setSequence
\r
453 public void setSequence(int index, jalview.binding.Sequence vSequence)
\r
454 throws java.lang.IndexOutOfBoundsException
\r
456 //-- check bounds for index
\r
457 if ((index < 0) || (index > _sequenceList.size())) {
\r
458 throw new IndexOutOfBoundsException();
\r
460 _sequenceList.setElementAt(vSequence, index);
\r
461 } //-- void setSequence(int, jalview.binding.Sequence)
\r
464 * Method setSequence
\r
468 * @param sequenceArray
\r
470 public void setSequence(jalview.binding.Sequence[] sequenceArray)
\r
473 _sequenceList.removeAllElements();
\r
474 for (int i = 0; i < sequenceArray.length; i++) {
\r
475 _sequenceList.addElement(sequenceArray[i]);
\r
477 } //-- void setSequence(jalview.binding.Sequence)
\r
487 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
488 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
490 return (jalview.binding.SequenceSet) Unmarshaller.unmarshal(jalview.binding.SequenceSet.class, reader);
\r
491 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
497 public void validate()
\r
498 throws org.exolab.castor.xml.ValidationException
\r
500 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
501 validator.validate(this);
\r
502 } //-- void validate()
\r