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
26 // --------------------------/
27 // - Class/Member Variables -/
28 // --------------------------/
31 * Field _structureStateList.
33 private java.util.Vector _structureStateList;
42 this._structureStateList = new java.util.Vector();
52 * @param vStructureState
53 * @throws java.lang.IndexOutOfBoundsException
54 * if the index given is outside the bounds of the collection
56 public void addStructureState(
57 final jalview.schemabinding.version2.StructureState vStructureState)
58 throws java.lang.IndexOutOfBoundsException
60 this._structureStateList.addElement(vStructureState);
67 * @param vStructureState
68 * @throws java.lang.IndexOutOfBoundsException
69 * if the index given is outside the bounds of the collection
71 public void addStructureState(
73 final jalview.schemabinding.version2.StructureState vStructureState)
74 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
95 * if the index given is outside the bounds of the collection
96 * @return the value of the jalview.schemabinding.version2.StructureState at
99 public jalview.schemabinding.version2.StructureState getStructureState(
100 final int index) throws java.lang.IndexOutOfBoundsException
102 // check bounds for index
103 if (index < 0 || index >= this._structureStateList.size())
105 throw new IndexOutOfBoundsException(
106 "getStructureState: Index value '" + index
107 + "' not in range [0.."
108 + (this._structureStateList.size() - 1) + "]");
111 return (jalview.schemabinding.version2.StructureState) _structureStateList
116 * Method getStructureState.Returns the contents of the collection in an
119 * Note: Just in case the collection contents are changing in another thread,
120 * we pass a 0-length Array of the correct type into the API call. This way we
121 * <i>know</i> that the Array returned is of exactly the correct length.
123 * @return this collection as an Array
125 public jalview.schemabinding.version2.StructureState[] getStructureState()
127 jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0];
128 return (jalview.schemabinding.version2.StructureState[]) this._structureStateList
133 * Method getStructureStateCount.
135 * @return the size of this collection
137 public int getStructureStateCount()
139 return this._structureStateList.size();
145 * @return true if this object is valid according to the schema
147 public boolean isValid()
152 } catch (org.exolab.castor.xml.ValidationException vex)
163 * @throws org.exolab.castor.xml.MarshalException
164 * if object is null or if any SAXException is thrown during
166 * @throws org.exolab.castor.xml.ValidationException
167 * if this object is an invalid instance according to the schema
169 public void marshal(final java.io.Writer out)
170 throws org.exolab.castor.xml.MarshalException,
171 org.exolab.castor.xml.ValidationException
173 Marshaller.marshal(this, out);
180 * @throws java.io.IOException
181 * if an IOException occurs during marshaling
182 * @throws org.exolab.castor.xml.ValidationException
183 * if this object is an invalid instance according to the schema
184 * @throws org.exolab.castor.xml.MarshalException
185 * if object is null or if any SAXException is thrown during
188 public void marshal(final org.xml.sax.ContentHandler handler)
189 throws java.io.IOException,
190 org.exolab.castor.xml.MarshalException,
191 org.exolab.castor.xml.ValidationException
193 Marshaller.marshal(this, handler);
198 public void removeAllStructureState()
200 this._structureStateList.clear();
204 * Method removeStructureState.
206 * @param vStructureState
207 * @return true if the object was removed from the collection.
209 public boolean removeStructureState(
210 final jalview.schemabinding.version2.StructureState vStructureState)
212 boolean removed = _structureStateList.remove(vStructureState);
217 * Method removeStructureStateAt.
220 * @return the element removed from the collection
222 public jalview.schemabinding.version2.StructureState removeStructureStateAt(
225 java.lang.Object obj = this._structureStateList.remove(index);
226 return (jalview.schemabinding.version2.StructureState) obj;
233 * @param vStructureState
234 * @throws java.lang.IndexOutOfBoundsException
235 * if the index given is outside the bounds of the collection
237 public void setStructureState(
239 final jalview.schemabinding.version2.StructureState vStructureState)
240 throws java.lang.IndexOutOfBoundsException
242 // check bounds for index
243 if (index < 0 || index >= this._structureStateList.size())
245 throw new IndexOutOfBoundsException(
246 "setStructureState: Index value '" + index
247 + "' not in range [0.."
248 + (this._structureStateList.size() - 1) + "]");
251 this._structureStateList.set(index, vStructureState);
257 * @param vStructureStateArray
259 public void setStructureState(
260 final jalview.schemabinding.version2.StructureState[] vStructureStateArray)
263 _structureStateList.clear();
265 for (int i = 0; i < vStructureStateArray.length; i++)
267 this._structureStateList.add(vStructureStateArray[i]);
275 * @throws org.exolab.castor.xml.MarshalException
276 * if object is null or if any SAXException is thrown during
278 * @throws org.exolab.castor.xml.ValidationException
279 * if this object is an invalid instance according to the schema
280 * @return the unmarshaled jalview.schemabinding.version2.Pdbentry
282 public static jalview.schemabinding.version2.Pdbentry unmarshal(
283 final java.io.Reader reader)
284 throws org.exolab.castor.xml.MarshalException,
285 org.exolab.castor.xml.ValidationException
287 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller
288 .unmarshal(jalview.schemabinding.version2.Pdbids.class, reader);
294 * @throws org.exolab.castor.xml.ValidationException
295 * if this object is an invalid instance according to the schema
297 public void validate() throws org.exolab.castor.xml.ValidationException
299 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
300 validator.validate(this);