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 Pdbentry implements java.io.Serializable {
25 //--------------------------/
26 //- Class/Member Variables -/
27 //--------------------------/
32 private java.lang.String _id;
37 private java.lang.String _type;
42 private java.lang.String _file;
47 private java.util.Vector _items;
56 this._items = new java.util.Vector();
67 * @param vPdbentryItem
68 * @throws java.lang.IndexOutOfBoundsException if the index
69 * given is outside the bounds of the collection
71 public void addPdbentryItem(
72 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
73 throws java.lang.IndexOutOfBoundsException {
74 this._items.addElement(vPdbentryItem);
81 * @param vPdbentryItem
82 * @throws java.lang.IndexOutOfBoundsException if the index
83 * given is outside the bounds of the collection
85 public void addPdbentryItem(
87 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
88 throws java.lang.IndexOutOfBoundsException {
89 this._items.add(index, vPdbentryItem);
93 * Method enumeratePdbentryItem.
95 * @return an Enumeration over all
96 * jalview.schemabinding.version2.PdbentryItem elements
98 public java.util.Enumeration enumeratePdbentryItem(
100 return this._items.elements();
104 * Returns the value of field 'file'.
106 * @return the value of field 'File'.
108 public java.lang.String getFile(
114 * Returns the value of field 'id'.
116 * @return the value of field 'Id'.
118 public java.lang.String getId(
124 * Method getPdbentryItem.
127 * @throws java.lang.IndexOutOfBoundsException if the index
128 * given is outside the bounds of the collection
129 * @return the value of the
130 * jalview.schemabinding.version2.PdbentryItem at the given inde
132 public jalview.schemabinding.version2.PdbentryItem getPdbentryItem(
134 throws java.lang.IndexOutOfBoundsException {
135 // check bounds for index
136 if (index < 0 || index >= this._items.size()) {
137 throw new IndexOutOfBoundsException("getPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]");
140 return (jalview.schemabinding.version2.PdbentryItem) _items.get(index);
144 * Method getPdbentryItem.Returns the contents of the
145 * collection in an Array. <p>Note: Just in case the
146 * collection contents are changing in another thread, we pass
147 * a 0-length Array of the correct type into the API call.
148 * This way we <i>know</i> that the Array returned is of
149 * exactly the correct length.
151 * @return this collection as an Array
153 public jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem(
155 jalview.schemabinding.version2.PdbentryItem[] array = new jalview.schemabinding.version2.PdbentryItem[0];
156 return (jalview.schemabinding.version2.PdbentryItem[]) this._items.toArray(array);
160 * Method getPdbentryItemCount.
162 * @return the size of this collection
164 public int getPdbentryItemCount(
166 return this._items.size();
170 * Returns the value of field 'type'.
172 * @return the value of field 'Type'.
174 public java.lang.String getType(
182 * @return true if this object is valid according to the schema
184 public boolean isValid(
188 } catch (org.exolab.castor.xml.ValidationException vex) {
198 * @throws org.exolab.castor.xml.MarshalException if object is
199 * null or if any SAXException is thrown during marshaling
200 * @throws org.exolab.castor.xml.ValidationException if this
201 * object is an invalid instance according to the schema
204 final java.io.Writer out)
205 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
206 Marshaller.marshal(this, out);
213 * @throws java.io.IOException if an IOException occurs during
215 * @throws org.exolab.castor.xml.ValidationException if this
216 * object is an invalid instance according to the schema
217 * @throws org.exolab.castor.xml.MarshalException if object is
218 * null or if any SAXException is thrown during marshaling
221 final org.xml.sax.ContentHandler handler)
222 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
223 Marshaller.marshal(this, handler);
228 public void removeAllPdbentryItem(
234 * Method removePdbentryItem.
236 * @param vPdbentryItem
237 * @return true if the object was removed from the collection.
239 public boolean removePdbentryItem(
240 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) {
241 boolean removed = _items.remove(vPdbentryItem);
246 * Method removePdbentryItemAt.
249 * @return the element removed from the collection
251 public jalview.schemabinding.version2.PdbentryItem removePdbentryItemAt(
253 java.lang.Object obj = this._items.remove(index);
254 return (jalview.schemabinding.version2.PdbentryItem) obj;
258 * Sets the value of field 'file'.
260 * @param file the value of field 'file'.
263 final java.lang.String file) {
268 * Sets the value of field 'id'.
270 * @param id the value of field 'id'.
273 final java.lang.String id) {
281 * @param vPdbentryItem
282 * @throws java.lang.IndexOutOfBoundsException if the index
283 * given is outside the bounds of the collection
285 public void setPdbentryItem(
287 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
288 throws java.lang.IndexOutOfBoundsException {
289 // check bounds for index
290 if (index < 0 || index >= this._items.size()) {
291 throw new IndexOutOfBoundsException("setPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]");
294 this._items.set(index, vPdbentryItem);
300 * @param vPdbentryItemArray
302 public void setPdbentryItem(
303 final jalview.schemabinding.version2.PdbentryItem[] vPdbentryItemArray) {
307 for (int i = 0; i < vPdbentryItemArray.length; i++) {
308 this._items.add(vPdbentryItemArray[i]);
313 * Sets the value of field 'type'.
315 * @param type the value of field 'type'.
318 final java.lang.String type) {
326 * @throws org.exolab.castor.xml.MarshalException if object is
327 * null or if any SAXException is thrown during marshaling
328 * @throws org.exolab.castor.xml.ValidationException if this
329 * object is an invalid instance according to the schema
330 * @return the unmarshaled
331 * jalview.schemabinding.version2.Pdbentry
333 public static jalview.schemabinding.version2.Pdbentry unmarshal(
334 final java.io.Reader reader)
335 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
336 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbentry.class, reader);
342 * @throws org.exolab.castor.xml.ValidationException if this
343 * object is an invalid instance according to the schema
345 public void validate(
347 throws org.exolab.castor.xml.ValidationException {
348 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
349 validator.validate(this);