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