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
29 * @version $Revision$ $Date$
\r
31 public class JSeq implements java.io.Serializable {
\r
34 //--------------------------/
\r
35 //- Class/Member Variables -/
\r
36 //--------------------------/
\r
41 private int _colour;
\r
44 * keeps track of state for field: _colour
\r
46 private boolean _has_colour;
\r
54 * keeps track of state for field: _start
\r
56 private boolean _has_start;
\r
64 * keeps track of state for field: _end
\r
66 private boolean _has_end;
\r
74 * keeps track of state for field: _id
\r
76 private boolean _has_id;
\r
79 * Field _featuresList
\r
81 private java.util.Vector _featuresList;
\r
86 private java.util.Vector _pdbidsList;
\r
95 _featuresList = new Vector();
\r
96 _pdbidsList = new Vector();
\r
97 } //-- jalview.binding.JSeq()
\r
105 * Method addFeatures
\r
111 public void addFeatures(jalview.binding.Features vFeatures)
\r
112 throws java.lang.IndexOutOfBoundsException
\r
114 _featuresList.addElement(vFeatures);
\r
115 } //-- void addFeatures(jalview.binding.Features)
\r
118 * Method addFeatures
\r
125 public void addFeatures(int index, jalview.binding.Features vFeatures)
\r
126 throws java.lang.IndexOutOfBoundsException
\r
128 _featuresList.insertElementAt(vFeatures, index);
\r
129 } //-- void addFeatures(int, jalview.binding.Features)
\r
138 public void addPdbids(jalview.binding.Pdbids vPdbids)
\r
139 throws java.lang.IndexOutOfBoundsException
\r
141 _pdbidsList.addElement(vPdbids);
\r
142 } //-- void addPdbids(jalview.binding.Pdbids)
\r
152 public void addPdbids(int index, jalview.binding.Pdbids vPdbids)
\r
153 throws java.lang.IndexOutOfBoundsException
\r
155 _pdbidsList.insertElementAt(vPdbids, index);
\r
156 } //-- void addPdbids(int, jalview.binding.Pdbids)
\r
159 * Method deleteColour
\r
162 public void deleteColour()
\r
164 this._has_colour= false;
\r
165 } //-- void deleteColour()
\r
171 public void deleteEnd()
\r
173 this._has_end= false;
\r
174 } //-- void deleteEnd()
\r
180 public void deleteId()
\r
182 this._has_id= false;
\r
183 } //-- void deleteId()
\r
186 * Method deleteStart
\r
189 public void deleteStart()
\r
191 this._has_start= false;
\r
192 } //-- void deleteStart()
\r
195 * Method enumerateFeatures
\r
199 * @return Enumeration
\r
201 public java.util.Enumeration enumerateFeatures()
\r
203 return _featuresList.elements();
\r
204 } //-- java.util.Enumeration enumerateFeatures()
\r
207 * Method enumeratePdbids
\r
211 * @return Enumeration
\r
213 public java.util.Enumeration enumeratePdbids()
\r
215 return _pdbidsList.elements();
\r
216 } //-- java.util.Enumeration enumeratePdbids()
\r
219 * Returns the value of field 'colour'.
\r
222 * @return the value of field 'colour'.
\r
224 public int getColour()
\r
226 return this._colour;
\r
227 } //-- int getColour()
\r
230 * Returns the value of field 'end'.
\r
233 * @return the value of field 'end'.
\r
235 public int getEnd()
\r
238 } //-- int getEnd()
\r
241 * Method getFeatures
\r
248 public jalview.binding.Features getFeatures(int index)
\r
249 throws java.lang.IndexOutOfBoundsException
\r
251 //-- check bounds for index
\r
252 if ((index < 0) || (index > _featuresList.size())) {
\r
253 throw new IndexOutOfBoundsException();
\r
256 return (jalview.binding.Features) _featuresList.elementAt(index);
\r
257 } //-- jalview.binding.Features getFeatures(int)
\r
260 * Method getFeatures
\r
266 public jalview.binding.Features[] getFeatures()
\r
268 int size = _featuresList.size();
\r
269 jalview.binding.Features[] mArray = new jalview.binding.Features[size];
\r
270 for (int index = 0; index < size; index++) {
\r
271 mArray[index] = (jalview.binding.Features) _featuresList.elementAt(index);
\r
274 } //-- jalview.binding.Features[] getFeatures()
\r
277 * Method getFeaturesCount
\r
283 public int getFeaturesCount()
\r
285 return _featuresList.size();
\r
286 } //-- int getFeaturesCount()
\r
289 * Returns the value of field 'id'.
\r
292 * @return the value of field 'id'.
\r
297 } //-- int getId()
\r
307 public jalview.binding.Pdbids getPdbids(int index)
\r
308 throws java.lang.IndexOutOfBoundsException
\r
310 //-- check bounds for index
\r
311 if ((index < 0) || (index > _pdbidsList.size())) {
\r
312 throw new IndexOutOfBoundsException();
\r
315 return (jalview.binding.Pdbids) _pdbidsList.elementAt(index);
\r
316 } //-- jalview.binding.Pdbids getPdbids(int)
\r
325 public jalview.binding.Pdbids[] getPdbids()
\r
327 int size = _pdbidsList.size();
\r
328 jalview.binding.Pdbids[] mArray = new jalview.binding.Pdbids[size];
\r
329 for (int index = 0; index < size; index++) {
\r
330 mArray[index] = (jalview.binding.Pdbids) _pdbidsList.elementAt(index);
\r
333 } //-- jalview.binding.Pdbids[] getPdbids()
\r
336 * Method getPdbidsCount
\r
342 public int getPdbidsCount()
\r
344 return _pdbidsList.size();
\r
345 } //-- int getPdbidsCount()
\r
348 * Returns the value of field 'start'.
\r
351 * @return the value of field 'start'.
\r
353 public int getStart()
\r
355 return this._start;
\r
356 } //-- int getStart()
\r
365 public boolean hasColour()
\r
367 return this._has_colour;
\r
368 } //-- boolean hasColour()
\r
377 public boolean hasEnd()
\r
379 return this._has_end;
\r
380 } //-- boolean hasEnd()
\r
389 public boolean hasId()
\r
391 return this._has_id;
\r
392 } //-- boolean hasId()
\r
401 public boolean hasStart()
\r
403 return this._has_start;
\r
404 } //-- boolean hasStart()
\r
413 public boolean isValid()
\r
418 catch (org.exolab.castor.xml.ValidationException vex) {
\r
422 } //-- boolean isValid()
\r
431 public void marshal(java.io.Writer out)
\r
432 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
435 Marshaller.marshal(this, out);
\r
436 } //-- void marshal(java.io.Writer)
\r
445 public void marshal(org.xml.sax.ContentHandler handler)
\r
446 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
449 Marshaller.marshal(this, handler);
\r
450 } //-- void marshal(org.xml.sax.ContentHandler)
\r
453 * Method removeAllFeatures
\r
456 public void removeAllFeatures()
\r
458 _featuresList.removeAllElements();
\r
459 } //-- void removeAllFeatures()
\r
462 * Method removeAllPdbids
\r
465 public void removeAllPdbids()
\r
467 _pdbidsList.removeAllElements();
\r
468 } //-- void removeAllPdbids()
\r
471 * Method removeFeatures
\r
478 public jalview.binding.Features removeFeatures(int index)
\r
480 java.lang.Object obj = _featuresList.elementAt(index);
\r
481 _featuresList.removeElementAt(index);
\r
482 return (jalview.binding.Features) obj;
\r
483 } //-- jalview.binding.Features removeFeatures(int)
\r
486 * Method removePdbids
\r
493 public jalview.binding.Pdbids removePdbids(int index)
\r
495 java.lang.Object obj = _pdbidsList.elementAt(index);
\r
496 _pdbidsList.removeElementAt(index);
\r
497 return (jalview.binding.Pdbids) obj;
\r
498 } //-- jalview.binding.Pdbids removePdbids(int)
\r
501 * Sets the value of field 'colour'.
\r
503 * @param colour the value of field 'colour'.
\r
505 public void setColour(int colour)
\r
507 this._colour = colour;
\r
508 this._has_colour = true;
\r
509 } //-- void setColour(int)
\r
512 * Sets the value of field 'end'.
\r
514 * @param end the value of field 'end'.
\r
516 public void setEnd(int end)
\r
519 this._has_end = true;
\r
520 } //-- void setEnd(int)
\r
523 * Method setFeatures
\r
530 public void setFeatures(int index, jalview.binding.Features vFeatures)
\r
531 throws java.lang.IndexOutOfBoundsException
\r
533 //-- check bounds for index
\r
534 if ((index < 0) || (index > _featuresList.size())) {
\r
535 throw new IndexOutOfBoundsException();
\r
537 _featuresList.setElementAt(vFeatures, index);
\r
538 } //-- void setFeatures(int, jalview.binding.Features)
\r
541 * Method setFeatures
\r
545 * @param featuresArray
\r
547 public void setFeatures(jalview.binding.Features[] featuresArray)
\r
550 _featuresList.removeAllElements();
\r
551 for (int i = 0; i < featuresArray.length; i++) {
\r
552 _featuresList.addElement(featuresArray[i]);
\r
554 } //-- void setFeatures(jalview.binding.Features)
\r
557 * Sets the value of field 'id'.
\r
559 * @param id the value of field 'id'.
\r
561 public void setId(int id)
\r
564 this._has_id = true;
\r
565 } //-- void setId(int)
\r
575 public void setPdbids(int index, jalview.binding.Pdbids vPdbids)
\r
576 throws java.lang.IndexOutOfBoundsException
\r
578 //-- check bounds for index
\r
579 if ((index < 0) || (index > _pdbidsList.size())) {
\r
580 throw new IndexOutOfBoundsException();
\r
582 _pdbidsList.setElementAt(vPdbids, index);
\r
583 } //-- void setPdbids(int, jalview.binding.Pdbids)
\r
590 * @param pdbidsArray
\r
592 public void setPdbids(jalview.binding.Pdbids[] pdbidsArray)
\r
595 _pdbidsList.removeAllElements();
\r
596 for (int i = 0; i < pdbidsArray.length; i++) {
\r
597 _pdbidsList.addElement(pdbidsArray[i]);
\r
599 } //-- void setPdbids(jalview.binding.Pdbids)
\r
602 * Sets the value of field 'start'.
\r
604 * @param start the value of field 'start'.
\r
606 public void setStart(int start)
\r
608 this._start = start;
\r
609 this._has_start = true;
\r
610 } //-- void setStart(int)
\r
620 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
621 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
623 return (jalview.binding.JSeq) Unmarshaller.unmarshal(jalview.binding.JSeq.class, reader);
\r
624 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
630 public void validate()
\r
631 throws org.exolab.castor.xml.ValidationException
\r
633 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
634 validator.validate(this);
\r
635 } //-- void validate()
\r