2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.binding;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class JSeq implements java.io.Serializable {
25 //--------------------------/
26 //- Class/Member Variables -/
27 //--------------------------/
35 * keeps track of state for field: _colour
37 private boolean _has_colour;
45 * keeps track of state for field: _start
47 private boolean _has_start;
55 * keeps track of state for field: _end
57 private boolean _has_end;
65 * keeps track of state for field: _id
67 private boolean _has_id;
70 * Field _featuresList.
72 private java.util.Vector _featuresList;
77 private java.util.Vector _pdbidsList;
86 this._featuresList = new java.util.Vector();
87 this._pdbidsList = new java.util.Vector();
99 * @throws java.lang.IndexOutOfBoundsException if the index
100 * given is outside the bounds of the collection
102 public void addFeatures(
103 final jalview.binding.Features vFeatures)
104 throws java.lang.IndexOutOfBoundsException {
105 this._featuresList.addElement(vFeatures);
113 * @throws java.lang.IndexOutOfBoundsException if the index
114 * given is outside the bounds of the collection
116 public void addFeatures(
118 final jalview.binding.Features vFeatures)
119 throws java.lang.IndexOutOfBoundsException {
120 this._featuresList.add(index, vFeatures);
127 * @throws java.lang.IndexOutOfBoundsException if the index
128 * given is outside the bounds of the collection
130 public void addPdbids(
131 final jalview.binding.Pdbids vPdbids)
132 throws java.lang.IndexOutOfBoundsException {
133 this._pdbidsList.addElement(vPdbids);
141 * @throws java.lang.IndexOutOfBoundsException if the index
142 * given is outside the bounds of the collection
144 public void addPdbids(
146 final jalview.binding.Pdbids vPdbids)
147 throws java.lang.IndexOutOfBoundsException {
148 this._pdbidsList.add(index, vPdbids);
153 public void deleteColour(
155 this._has_colour= false;
160 public void deleteEnd(
162 this._has_end= false;
167 public void deleteId(
174 public void deleteStart(
176 this._has_start= false;
180 * Method enumerateFeatures.
182 * @return an Enumeration over all jalview.binding.Features
185 public java.util.Enumeration enumerateFeatures(
187 return this._featuresList.elements();
191 * Method enumeratePdbids.
193 * @return an Enumeration over all jalview.binding.Pdbids
196 public java.util.Enumeration enumeratePdbids(
198 return this._pdbidsList.elements();
202 * Returns the value of field 'colour'.
204 * @return the value of field 'Colour'.
206 public int getColour(
212 * Returns the value of field 'end'.
214 * @return the value of field 'End'.
222 * Method getFeatures.
225 * @throws java.lang.IndexOutOfBoundsException if the index
226 * given is outside the bounds of the collection
227 * @return the value of the jalview.binding.Features at the
230 public jalview.binding.Features getFeatures(
232 throws java.lang.IndexOutOfBoundsException {
233 // check bounds for index
234 if (index < 0 || index >= this._featuresList.size()) {
235 throw new IndexOutOfBoundsException("getFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
238 return (jalview.binding.Features) _featuresList.get(index);
242 * Method getFeatures.Returns the contents of the collection in
243 * an Array. <p>Note: Just in case the collection contents
244 * are changing in another thread, we pass a 0-length Array of
245 * the correct type into the API call. This way we <i>know</i>
246 * that the Array returned is of exactly the correct length.
248 * @return this collection as an Array
250 public jalview.binding.Features[] getFeatures(
252 jalview.binding.Features[] array = new jalview.binding.Features[0];
253 return (jalview.binding.Features[]) this._featuresList.toArray(array);
257 * Method getFeaturesCount.
259 * @return the size of this collection
261 public int getFeaturesCount(
263 return this._featuresList.size();
267 * Returns the value of field 'id'.
269 * @return the value of field 'Id'.
280 * @throws java.lang.IndexOutOfBoundsException if the index
281 * given is outside the bounds of the collection
282 * @return the value of the jalview.binding.Pdbids at the given
285 public jalview.binding.Pdbids getPdbids(
287 throws java.lang.IndexOutOfBoundsException {
288 // check bounds for index
289 if (index < 0 || index >= this._pdbidsList.size()) {
290 throw new IndexOutOfBoundsException("getPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
293 return (jalview.binding.Pdbids) _pdbidsList.get(index);
297 * Method getPdbids.Returns the contents of the collection in
298 * an Array. <p>Note: Just in case the collection contents
299 * are changing in another thread, we pass a 0-length Array of
300 * the correct type into the API call. This way we <i>know</i>
301 * that the Array returned is of exactly the correct length.
303 * @return this collection as an Array
305 public jalview.binding.Pdbids[] getPdbids(
307 jalview.binding.Pdbids[] array = new jalview.binding.Pdbids[0];
308 return (jalview.binding.Pdbids[]) this._pdbidsList.toArray(array);
312 * Method getPdbidsCount.
314 * @return the size of this collection
316 public int getPdbidsCount(
318 return this._pdbidsList.size();
322 * Returns the value of field 'start'.
324 * @return the value of field 'Start'.
334 * @return true if at least one Colour has been added
336 public boolean hasColour(
338 return this._has_colour;
344 * @return true if at least one End has been added
346 public boolean hasEnd(
348 return this._has_end;
354 * @return true if at least one Id has been added
356 public boolean hasId(
364 * @return true if at least one Start has been added
366 public boolean hasStart(
368 return this._has_start;
374 * @return true if this object is valid according to the schema
376 public boolean isValid(
380 } catch (org.exolab.castor.xml.ValidationException vex) {
390 * @throws org.exolab.castor.xml.MarshalException if object is
391 * null or if any SAXException is thrown during marshaling
392 * @throws org.exolab.castor.xml.ValidationException if this
393 * object is an invalid instance according to the schema
396 final java.io.Writer out)
397 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
398 Marshaller.marshal(this, out);
405 * @throws java.io.IOException if an IOException occurs during
407 * @throws org.exolab.castor.xml.ValidationException if this
408 * object is an invalid instance according to the schema
409 * @throws org.exolab.castor.xml.MarshalException if object is
410 * null or if any SAXException is thrown during marshaling
413 final org.xml.sax.ContentHandler handler)
414 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
415 Marshaller.marshal(this, handler);
420 public void removeAllFeatures(
422 this._featuresList.clear();
427 public void removeAllPdbids(
429 this._pdbidsList.clear();
433 * Method removeFeatures.
436 * @return true if the object was removed from the collection.
438 public boolean removeFeatures(
439 final jalview.binding.Features vFeatures) {
440 boolean removed = _featuresList.remove(vFeatures);
445 * Method removeFeaturesAt.
448 * @return the element removed from the collection
450 public jalview.binding.Features removeFeaturesAt(
452 java.lang.Object obj = this._featuresList.remove(index);
453 return (jalview.binding.Features) obj;
457 * Method removePdbids.
460 * @return true if the object was removed from the collection.
462 public boolean removePdbids(
463 final jalview.binding.Pdbids vPdbids) {
464 boolean removed = _pdbidsList.remove(vPdbids);
469 * Method removePdbidsAt.
472 * @return the element removed from the collection
474 public jalview.binding.Pdbids removePdbidsAt(
476 java.lang.Object obj = this._pdbidsList.remove(index);
477 return (jalview.binding.Pdbids) obj;
481 * Sets the value of field 'colour'.
483 * @param colour the value of field 'colour'.
485 public void setColour(
487 this._colour = colour;
488 this._has_colour = true;
492 * Sets the value of field 'end'.
494 * @param end the value of field 'end'.
499 this._has_end = true;
507 * @throws java.lang.IndexOutOfBoundsException if the index
508 * given is outside the bounds of the collection
510 public void setFeatures(
512 final jalview.binding.Features vFeatures)
513 throws java.lang.IndexOutOfBoundsException {
514 // check bounds for index
515 if (index < 0 || index >= this._featuresList.size()) {
516 throw new IndexOutOfBoundsException("setFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
519 this._featuresList.set(index, vFeatures);
525 * @param vFeaturesArray
527 public void setFeatures(
528 final jalview.binding.Features[] vFeaturesArray) {
530 _featuresList.clear();
532 for (int i = 0; i < vFeaturesArray.length; i++) {
533 this._featuresList.add(vFeaturesArray[i]);
538 * Sets the value of field 'id'.
540 * @param id the value of field 'id'.
553 * @throws java.lang.IndexOutOfBoundsException if the index
554 * given is outside the bounds of the collection
556 public void setPdbids(
558 final jalview.binding.Pdbids vPdbids)
559 throws java.lang.IndexOutOfBoundsException {
560 // check bounds for index
561 if (index < 0 || index >= this._pdbidsList.size()) {
562 throw new IndexOutOfBoundsException("setPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
565 this._pdbidsList.set(index, vPdbids);
571 * @param vPdbidsArray
573 public void setPdbids(
574 final jalview.binding.Pdbids[] vPdbidsArray) {
578 for (int i = 0; i < vPdbidsArray.length; i++) {
579 this._pdbidsList.add(vPdbidsArray[i]);
584 * Sets the value of field 'start'.
586 * @param start the value of field 'start'.
588 public void setStart(
591 this._has_start = true;
598 * @throws org.exolab.castor.xml.MarshalException if object is
599 * null or if any SAXException is thrown during marshaling
600 * @throws org.exolab.castor.xml.ValidationException if this
601 * object is an invalid instance according to the schema
602 * @return the unmarshaled jalview.binding.JSeq
604 public static jalview.binding.JSeq unmarshal(
605 final java.io.Reader reader)
606 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
607 return (jalview.binding.JSeq) Unmarshaller.unmarshal(jalview.binding.JSeq.class, reader);
613 * @throws org.exolab.castor.xml.ValidationException if this
614 * object is an invalid instance according to the schema
616 public void validate(
618 throws org.exolab.castor.xml.ValidationException {
619 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
620 validator.validate(this);