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
26 // --------------------------/
27 // - Class/Member Variables -/
28 // --------------------------/
31 * dataset sequence id for this sequence. Will be created as union of
35 private java.lang.String _dsseqid;
40 private java.util.Vector _DBRefList;
49 this._DBRefList = new java.util.Vector();
60 * @throws java.lang.IndexOutOfBoundsException
61 * if the index given is outside the bounds of the collection
63 public void addDBRef(final jalview.schemabinding.version2.DBRef vDBRef)
64 throws java.lang.IndexOutOfBoundsException
66 this._DBRefList.addElement(vDBRef);
74 * @throws java.lang.IndexOutOfBoundsException
75 * if the index given is outside the bounds of the collection
77 public void addDBRef(final int index,
78 final jalview.schemabinding.version2.DBRef vDBRef)
79 throws java.lang.IndexOutOfBoundsException
81 this._DBRefList.add(index, vDBRef);
85 * Method enumerateDBRef.
87 * @return an Enumeration over all jalview.schemabinding.version2.DBRef
90 public java.util.Enumeration enumerateDBRef()
92 return this._DBRefList.elements();
99 * @throws java.lang.IndexOutOfBoundsException
100 * if the index given is outside the bounds of the collection
101 * @return the value of the jalview.schemabinding.version2.DBRef at the given
104 public jalview.schemabinding.version2.DBRef getDBRef(final int index)
105 throws java.lang.IndexOutOfBoundsException
107 // check bounds for index
108 if (index < 0 || index >= this._DBRefList.size())
110 throw new IndexOutOfBoundsException("getDBRef: Index value '" + index
111 + "' 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 Array.
120 * Note: Just in case the collection contents are changing in another thread,
121 * we pass a 0-length Array of the correct type into the API call. This way we
122 * <i>know</i> 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
134 * Method getDBRefCount.
136 * @return the size of this collection
138 public int getDBRefCount()
140 return this._DBRefList.size();
144 * Returns the value of field 'dsseqid'. The field 'dsseqid' has the following
145 * description: dataset sequence id for this sequence. Will be created as
146 * union of sequences.
149 * @return the value of field 'Dsseqid'.
151 public java.lang.String getDsseqid()
153 return this._dsseqid;
159 * @return true if this object is valid according to the schema
161 public boolean isValid()
166 } catch (org.exolab.castor.xml.ValidationException vex)
177 * @throws org.exolab.castor.xml.MarshalException
178 * if object is null or if any SAXException is thrown during
180 * @throws org.exolab.castor.xml.ValidationException
181 * if this object is an invalid instance according to the schema
183 public void marshal(final java.io.Writer out)
184 throws org.exolab.castor.xml.MarshalException,
185 org.exolab.castor.xml.ValidationException
187 Marshaller.marshal(this, out);
194 * @throws java.io.IOException
195 * if an IOException occurs during marshaling
196 * @throws org.exolab.castor.xml.ValidationException
197 * if this object is an invalid instance according to the schema
198 * @throws org.exolab.castor.xml.MarshalException
199 * if object is null or if any SAXException is thrown during
202 public void marshal(final org.xml.sax.ContentHandler handler)
203 throws java.io.IOException,
204 org.exolab.castor.xml.MarshalException,
205 org.exolab.castor.xml.ValidationException
207 Marshaller.marshal(this, handler);
212 public void removeAllDBRef()
214 this._DBRefList.clear();
218 * Method removeDBRef.
221 * @return true if the object was removed from the collection.
223 public boolean removeDBRef(
224 final jalview.schemabinding.version2.DBRef vDBRef)
226 boolean removed = _DBRefList.remove(vDBRef);
231 * Method removeDBRefAt.
234 * @return the element removed from the collection
236 public jalview.schemabinding.version2.DBRef removeDBRefAt(final int index)
238 java.lang.Object obj = this._DBRefList.remove(index);
239 return (jalview.schemabinding.version2.DBRef) obj;
247 * @throws java.lang.IndexOutOfBoundsException
248 * if the index given is outside the bounds of the collection
250 public void setDBRef(final int index,
251 final jalview.schemabinding.version2.DBRef vDBRef)
252 throws java.lang.IndexOutOfBoundsException
254 // check bounds for index
255 if (index < 0 || index >= this._DBRefList.size())
257 throw new IndexOutOfBoundsException("setDBRef: Index value '" + index
258 + "' not in range [0.." + (this._DBRefList.size() - 1) + "]");
261 this._DBRefList.set(index, vDBRef);
269 public void setDBRef(
270 final jalview.schemabinding.version2.DBRef[] vDBRefArray)
275 for (int i = 0; i < vDBRefArray.length; i++)
277 this._DBRefList.add(vDBRefArray[i]);
282 * Sets the value of field 'dsseqid'. The field 'dsseqid' has the following
283 * description: dataset sequence id for this sequence. Will be created as
284 * union of sequences.
288 * the value of field 'dsseqid'.
290 public void setDsseqid(final java.lang.String dsseqid)
292 this._dsseqid = dsseqid;
299 * @throws org.exolab.castor.xml.MarshalException
300 * if object is null or if any SAXException is thrown during
302 * @throws org.exolab.castor.xml.ValidationException
303 * if this object is an invalid instance according to the schema
304 * @return the unmarshaled jalview.schemabinding.version2.SequenceType
306 public static jalview.schemabinding.version2.SequenceType unmarshal(
307 final java.io.Reader reader)
308 throws org.exolab.castor.xml.MarshalException,
309 org.exolab.castor.xml.ValidationException
311 return (jalview.schemabinding.version2.SequenceType) Unmarshaller
312 .unmarshal(jalview.schemabinding.version2.Sequence.class,
319 * @throws org.exolab.castor.xml.ValidationException
320 * if this object is an invalid instance according to the schema
322 public void validate() throws org.exolab.castor.xml.ValidationException
324 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
325 validator.validate(this);