2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
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 Sequence extends jalview.schemabinding.version2.SequenceType
23 implements java.io.Serializable
27 //--------------------------/
28 //- Class/Member Variables -/
29 //--------------------------/
32 * dataset sequence id for this sequence. Will be created as
36 private java.lang.String _dsseqid;
41 private java.util.Vector _DBRefList;
50 this._DBRefList = new java.util.Vector();
62 * @throws java.lang.IndexOutOfBoundsException if the index
63 * given is outside the bounds of the collection
66 final jalview.schemabinding.version2.DBRef vDBRef)
67 throws java.lang.IndexOutOfBoundsException {
68 this._DBRefList.addElement(vDBRef);
76 * @throws java.lang.IndexOutOfBoundsException if the index
77 * given is outside the bounds of the collection
81 final jalview.schemabinding.version2.DBRef vDBRef)
82 throws java.lang.IndexOutOfBoundsException {
83 this._DBRefList.add(index, vDBRef);
87 * Method enumerateDBRef.
89 * @return an Enumeration over all
90 * jalview.schemabinding.version2.DBRef elements
92 public java.util.Enumeration enumerateDBRef(
94 return this._DBRefList.elements();
101 * @throws java.lang.IndexOutOfBoundsException if the index
102 * given is outside the bounds of the collection
103 * @return the value of the
104 * jalview.schemabinding.version2.DBRef at the given index
106 public jalview.schemabinding.version2.DBRef getDBRef(
108 throws java.lang.IndexOutOfBoundsException {
109 // check bounds for index
110 if (index < 0 || index >= this._DBRefList.size()) {
111 throw new IndexOutOfBoundsException("getDBRef: Index value '" + index + "' not in range [0.." + (this._DBRefList.size() - 1) + "]");
114 return (jalview.schemabinding.version2.DBRef) _DBRefList.get(index);
118 * Method getDBRef.Returns the contents of the collection in an
119 * Array. <p>Note: Just in case the collection contents are
120 * changing in another thread, we pass a 0-length Array of the
121 * correct type into the API call. This way we <i>know</i>
122 * that the Array returned is of exactly the correct length.
124 * @return this collection as an Array
126 public jalview.schemabinding.version2.DBRef[] getDBRef(
128 jalview.schemabinding.version2.DBRef[] array = new jalview.schemabinding.version2.DBRef[0];
129 return (jalview.schemabinding.version2.DBRef[]) this._DBRefList.toArray(array);
133 * Method getDBRefCount.
135 * @return the size of this collection
137 public int getDBRefCount(
139 return this._DBRefList.size();
143 * Returns the value of field 'dsseqid'. The field 'dsseqid'
144 * has the following description: dataset sequence id for this
145 * sequence. Will be created as union of sequences.
148 * @return the value of field 'Dsseqid'.
150 public java.lang.String getDsseqid(
152 return this._dsseqid;
158 * @return true if this object is valid according to the schema
160 public boolean isValid(
164 } catch (org.exolab.castor.xml.ValidationException vex) {
174 * @throws org.exolab.castor.xml.MarshalException if object is
175 * null or if any SAXException is thrown during marshaling
176 * @throws org.exolab.castor.xml.ValidationException if this
177 * object is an invalid instance according to the schema
180 final java.io.Writer out)
181 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
182 Marshaller.marshal(this, out);
189 * @throws java.io.IOException if an IOException occurs during
191 * @throws org.exolab.castor.xml.ValidationException if this
192 * object is an invalid instance according to the schema
193 * @throws org.exolab.castor.xml.MarshalException if object is
194 * null or if any SAXException is thrown during marshaling
197 final org.xml.sax.ContentHandler handler)
198 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
199 Marshaller.marshal(this, handler);
204 public void removeAllDBRef(
206 this._DBRefList.clear();
210 * Method removeDBRef.
213 * @return true if the object was removed from the collection.
215 public boolean removeDBRef(
216 final jalview.schemabinding.version2.DBRef vDBRef) {
217 boolean removed = _DBRefList.remove(vDBRef);
222 * Method removeDBRefAt.
225 * @return the element removed from the collection
227 public jalview.schemabinding.version2.DBRef removeDBRefAt(
229 java.lang.Object obj = this._DBRefList.remove(index);
230 return (jalview.schemabinding.version2.DBRef) obj;
238 * @throws java.lang.IndexOutOfBoundsException if the index
239 * given is outside the bounds of the collection
241 public void setDBRef(
243 final jalview.schemabinding.version2.DBRef vDBRef)
244 throws java.lang.IndexOutOfBoundsException {
245 // check bounds for index
246 if (index < 0 || index >= this._DBRefList.size()) {
247 throw new IndexOutOfBoundsException("setDBRef: Index value '" + index + "' not in range [0.." + (this._DBRefList.size() - 1) + "]");
250 this._DBRefList.set(index, vDBRef);
258 public void setDBRef(
259 final jalview.schemabinding.version2.DBRef[] vDBRefArray) {
263 for (int i = 0; i < vDBRefArray.length; i++) {
264 this._DBRefList.add(vDBRefArray[i]);
269 * Sets the value of field 'dsseqid'. The field 'dsseqid' has
270 * the following description: dataset sequence id for this
271 * sequence. Will be created as union of sequences.
274 * @param dsseqid the value of field 'dsseqid'.
276 public void setDsseqid(
277 final java.lang.String dsseqid) {
278 this._dsseqid = dsseqid;
285 * @throws org.exolab.castor.xml.MarshalException if object is
286 * null or if any SAXException is thrown during marshaling
287 * @throws org.exolab.castor.xml.ValidationException if this
288 * object is an invalid instance according to the schema
289 * @return the unmarshaled
290 * jalview.schemabinding.version2.SequenceType
292 public static jalview.schemabinding.version2.SequenceType unmarshal(
293 final java.io.Reader reader)
294 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
295 return (jalview.schemabinding.version2.SequenceType) Unmarshaller.unmarshal(jalview.schemabinding.version2.Sequence.class, reader);
301 * @throws org.exolab.castor.xml.ValidationException if this
302 * object is an invalid instance according to the schema
304 public void validate(
306 throws org.exolab.castor.xml.ValidationException {
307 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
308 validator.validate(this);