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 Pdbids extends jalview.schemabinding.version2.Pdbentry
23 implements java.io.Serializable
27 //--------------------------/
28 //- Class/Member Variables -/
29 //--------------------------/
32 * Field _structureStateList.
34 private java.util.Vector _structureStateList;
43 this._structureStateList = new java.util.Vector();
54 * @param vStructureState
55 * @throws java.lang.IndexOutOfBoundsException if the index
56 * given is outside the bounds of the collection
58 public void addStructureState(
59 final jalview.schemabinding.version2.StructureState vStructureState)
60 throws java.lang.IndexOutOfBoundsException {
61 this._structureStateList.addElement(vStructureState);
68 * @param vStructureState
69 * @throws java.lang.IndexOutOfBoundsException if the index
70 * given is outside the bounds of the collection
72 public void addStructureState(
74 final jalview.schemabinding.version2.StructureState vStructureState)
75 throws java.lang.IndexOutOfBoundsException {
76 this._structureStateList.add(index, vStructureState);
80 * Method enumerateStructureState.
82 * @return an Enumeration over all
83 * jalview.schemabinding.version2.StructureState elements
85 public java.util.Enumeration enumerateStructureState(
87 return this._structureStateList.elements();
91 * Method getStructureState.
94 * @throws java.lang.IndexOutOfBoundsException if the index
95 * given is outside the bounds of the collection
96 * @return the value of the
97 * jalview.schemabinding.version2.StructureState at the given
100 public jalview.schemabinding.version2.StructureState getStructureState(
102 throws java.lang.IndexOutOfBoundsException {
103 // check bounds for index
104 if (index < 0 || index >= this._structureStateList.size()) {
105 throw new IndexOutOfBoundsException("getStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]");
108 return (jalview.schemabinding.version2.StructureState) _structureStateList.get(index);
112 * Method getStructureState.Returns the contents of the
113 * collection in an Array. <p>Note: Just in case the
114 * collection contents are changing in another thread, we pass
115 * a 0-length Array of the correct type into the API call.
116 * This way we <i>know</i> that the Array returned is of
117 * exactly the correct length.
119 * @return this collection as an Array
121 public jalview.schemabinding.version2.StructureState[] getStructureState(
123 jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0];
124 return (jalview.schemabinding.version2.StructureState[]) this._structureStateList.toArray(array);
128 * Method getStructureStateCount.
130 * @return the size of this collection
132 public int getStructureStateCount(
134 return this._structureStateList.size();
140 * @return true if this object is valid according to the schema
142 public boolean isValid(
146 } catch (org.exolab.castor.xml.ValidationException vex) {
156 * @throws org.exolab.castor.xml.MarshalException if object is
157 * null or if any SAXException is thrown during marshaling
158 * @throws org.exolab.castor.xml.ValidationException if this
159 * object is an invalid instance according to the schema
162 final java.io.Writer out)
163 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
164 Marshaller.marshal(this, out);
171 * @throws java.io.IOException if an IOException occurs during
173 * @throws org.exolab.castor.xml.ValidationException if this
174 * object is an invalid instance according to the schema
175 * @throws org.exolab.castor.xml.MarshalException if object is
176 * null or if any SAXException is thrown during marshaling
179 final org.xml.sax.ContentHandler handler)
180 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
181 Marshaller.marshal(this, handler);
186 public void removeAllStructureState(
188 this._structureStateList.clear();
192 * Method removeStructureState.
194 * @param vStructureState
195 * @return true if the object was removed from the collection.
197 public boolean removeStructureState(
198 final jalview.schemabinding.version2.StructureState vStructureState) {
199 boolean removed = _structureStateList.remove(vStructureState);
204 * Method removeStructureStateAt.
207 * @return the element removed from the collection
209 public jalview.schemabinding.version2.StructureState removeStructureStateAt(
211 java.lang.Object obj = this._structureStateList.remove(index);
212 return (jalview.schemabinding.version2.StructureState) obj;
219 * @param vStructureState
220 * @throws java.lang.IndexOutOfBoundsException if the index
221 * given is outside the bounds of the collection
223 public void setStructureState(
225 final jalview.schemabinding.version2.StructureState vStructureState)
226 throws java.lang.IndexOutOfBoundsException {
227 // check bounds for index
228 if (index < 0 || index >= this._structureStateList.size()) {
229 throw new IndexOutOfBoundsException("setStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]");
232 this._structureStateList.set(index, vStructureState);
238 * @param vStructureStateArray
240 public void setStructureState(
241 final jalview.schemabinding.version2.StructureState[] vStructureStateArray) {
243 _structureStateList.clear();
245 for (int i = 0; i < vStructureStateArray.length; i++) {
246 this._structureStateList.add(vStructureStateArray[i]);
254 * @throws org.exolab.castor.xml.MarshalException if object is
255 * null or if any SAXException is thrown during marshaling
256 * @throws org.exolab.castor.xml.ValidationException if this
257 * object is an invalid instance according to the schema
258 * @return the unmarshaled
259 * jalview.schemabinding.version2.Pdbentry
261 public static jalview.schemabinding.version2.Pdbentry unmarshal(
262 final java.io.Reader reader)
263 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
264 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbids.class, reader);
270 * @throws org.exolab.castor.xml.ValidationException if this
271 * object is an invalid instance according to the schema
273 public void validate(
275 throws org.exolab.castor.xml.ValidationException {
276 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
277 validator.validate(this);