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
34 private java.util.Vector _DBRefList;
\r
43 this._DBRefList = new java.util.Vector();
\r
55 * @throws java.lang.IndexOutOfBoundsException if the index
\r
56 * given is outside the bounds of the collection
\r
58 public void addDBRef(
\r
59 final jalview.schemabinding.version2.DBRef vDBRef)
\r
60 throws java.lang.IndexOutOfBoundsException {
\r
61 this._DBRefList.addElement(vDBRef);
\r
69 * @throws java.lang.IndexOutOfBoundsException if the index
\r
70 * given is outside the bounds of the collection
\r
72 public void addDBRef(
\r
74 final jalview.schemabinding.version2.DBRef vDBRef)
\r
75 throws java.lang.IndexOutOfBoundsException {
\r
76 this._DBRefList.add(index, vDBRef);
\r
80 * Method enumerateDBRef.
\r
82 * @return an Enumeration over all
\r
83 * jalview.schemabinding.version2.DBRef elements
\r
85 public java.util.Enumeration enumerateDBRef(
\r
87 return this._DBRefList.elements();
\r
94 * @throws java.lang.IndexOutOfBoundsException if the index
\r
95 * given is outside the bounds of the collection
\r
96 * @return the value of the
\r
97 * jalview.schemabinding.version2.DBRef at the given index
\r
99 public jalview.schemabinding.version2.DBRef getDBRef(
\r
101 throws java.lang.IndexOutOfBoundsException {
\r
102 // check bounds for index
\r
103 if (index < 0 || index >= this._DBRefList.size()) {
\r
104 throw new IndexOutOfBoundsException("getDBRef: Index value '" + index + "' not in range [0.." + (this._DBRefList.size() - 1) + "]");
\r
107 return (jalview.schemabinding.version2.DBRef) _DBRefList.get(index);
\r
111 * Method getDBRef.Returns the contents of the collection in an
\r
112 * Array. <p>Note: Just in case the collection contents are
\r
113 * changing in another thread, we pass a 0-length Array of the
\r
114 * correct type into the API call. This way we <i>know</i>
\r
115 * that the Array returned is of exactly the correct length.
\r
117 * @return this collection as an Array
\r
119 public jalview.schemabinding.version2.DBRef[] getDBRef(
\r
121 jalview.schemabinding.version2.DBRef[] array = new jalview.schemabinding.version2.DBRef[0];
\r
122 return (jalview.schemabinding.version2.DBRef[]) this._DBRefList.toArray(array);
\r
126 * Method getDBRefCount.
\r
128 * @return the size of this collection
\r
130 public int getDBRefCount(
\r
132 return this._DBRefList.size();
\r
138 * @return true if this object is valid according to the schema
\r
140 public boolean isValid(
\r
144 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
154 * @throws org.exolab.castor.xml.MarshalException if object is
\r
155 * null or if any SAXException is thrown during marshaling
\r
156 * @throws org.exolab.castor.xml.ValidationException if this
\r
157 * object is an invalid instance according to the schema
\r
159 public void marshal(
\r
160 final java.io.Writer out)
\r
161 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
162 Marshaller.marshal(this, out);
\r
169 * @throws java.io.IOException if an IOException occurs during
\r
171 * @throws org.exolab.castor.xml.ValidationException if this
\r
172 * object is an invalid instance according to the schema
\r
173 * @throws org.exolab.castor.xml.MarshalException if object is
\r
174 * null or if any SAXException is thrown during marshaling
\r
176 public void marshal(
\r
177 final org.xml.sax.ContentHandler handler)
\r
178 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
179 Marshaller.marshal(this, handler);
\r
184 public void removeAllDBRef(
\r
186 this._DBRefList.clear();
\r
190 * Method removeDBRef.
\r
193 * @return true if the object was removed from the collection.
\r
195 public boolean removeDBRef(
\r
196 final jalview.schemabinding.version2.DBRef vDBRef) {
\r
197 boolean removed = _DBRefList.remove(vDBRef);
\r
202 * Method removeDBRefAt.
\r
205 * @return the element removed from the collection
\r
207 public jalview.schemabinding.version2.DBRef removeDBRefAt(
\r
209 java.lang.Object obj = this._DBRefList.remove(index);
\r
210 return (jalview.schemabinding.version2.DBRef) obj;
\r
218 * @throws java.lang.IndexOutOfBoundsException if the index
\r
219 * given is outside the bounds of the collection
\r
221 public void setDBRef(
\r
223 final jalview.schemabinding.version2.DBRef vDBRef)
\r
224 throws java.lang.IndexOutOfBoundsException {
\r
225 // check bounds for index
\r
226 if (index < 0 || index >= this._DBRefList.size()) {
\r
227 throw new IndexOutOfBoundsException("setDBRef: Index value '" + index + "' not in range [0.." + (this._DBRefList.size() - 1) + "]");
\r
230 this._DBRefList.set(index, vDBRef);
\r
236 * @param vDBRefArray
\r
238 public void setDBRef(
\r
239 final jalview.schemabinding.version2.DBRef[] vDBRefArray) {
\r
241 _DBRefList.clear();
\r
243 for (int i = 0; i < vDBRefArray.length; i++) {
\r
244 this._DBRefList.add(vDBRefArray[i]);
\r
249 * Method unmarshal.
\r
252 * @throws org.exolab.castor.xml.MarshalException if object is
\r
253 * null or if any SAXException is thrown during marshaling
\r
254 * @throws org.exolab.castor.xml.ValidationException if this
\r
255 * object is an invalid instance according to the schema
\r
256 * @return the unmarshaled
\r
257 * jalview.schemabinding.version2.SequenceType
\r
259 public static jalview.schemabinding.version2.SequenceType unmarshal(
\r
260 final java.io.Reader reader)
\r
261 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
262 return (jalview.schemabinding.version2.SequenceType) Unmarshaller.unmarshal(jalview.schemabinding.version2.Sequence.class, reader);
\r
268 * @throws org.exolab.castor.xml.ValidationException if this
\r
269 * object is an invalid instance according to the schema
\r
271 public void validate(
\r
273 throws org.exolab.castor.xml.ValidationException {
\r
274 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
275 validator.validate(this);
\r