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();
66 * @param vPdbentryItem
67 * @throws java.lang.IndexOutOfBoundsException
68 * if the index given is outside the bounds of the collection
70 public void addPdbentryItem(
71 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
72 throws java.lang.IndexOutOfBoundsException
74 this._items.addElement(vPdbentryItem);
81 * @param vPdbentryItem
82 * @throws java.lang.IndexOutOfBoundsException
83 * if the index given is outside the bounds of the collection
85 public void addPdbentryItem(final int index,
86 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
87 throws java.lang.IndexOutOfBoundsException
89 this._items.add(index, vPdbentryItem);
93 * Method enumeratePdbentryItem.
95 * @return an Enumeration over all jalview.schemabinding.version2.PdbentryItem
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
128 * if the index given is outside the bounds of the collection
129 * @return the value of the jalview.schemabinding.version2.PdbentryItem at the
132 public jalview.schemabinding.version2.PdbentryItem getPdbentryItem(
133 final int index) throws java.lang.IndexOutOfBoundsException
135 // check bounds for index
136 if (index < 0 || index >= this._items.size())
138 throw new IndexOutOfBoundsException("getPdbentryItem: Index value '"
139 + index + "' not in range [0.." + (this._items.size() - 1)
143 return (jalview.schemabinding.version2.PdbentryItem) _items.get(index);
147 * Method getPdbentryItem.Returns the contents of the collection in an Array.
149 * Note: Just in case the collection contents are changing in another thread,
150 * we pass a 0-length Array of the correct type into the API call. This way we
151 * <i>know</i> that the Array returned is of exactly the correct length.
153 * @return this collection as an Array
155 public jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem()
157 jalview.schemabinding.version2.PdbentryItem[] array = new jalview.schemabinding.version2.PdbentryItem[0];
158 return (jalview.schemabinding.version2.PdbentryItem[]) this._items
163 * Method getPdbentryItemCount.
165 * @return the size of this collection
167 public int getPdbentryItemCount()
169 return this._items.size();
173 * Returns the value of field 'type'.
175 * @return the value of field 'Type'.
177 public java.lang.String getType()
185 * @return true if this object is valid according to the schema
187 public boolean isValid()
192 } catch (org.exolab.castor.xml.ValidationException vex)
203 * @throws org.exolab.castor.xml.MarshalException
204 * if object is null or if any SAXException is thrown during
206 * @throws org.exolab.castor.xml.ValidationException
207 * if this object is an invalid instance according to the schema
209 public void marshal(final java.io.Writer out)
210 throws org.exolab.castor.xml.MarshalException,
211 org.exolab.castor.xml.ValidationException
213 Marshaller.marshal(this, out);
220 * @throws java.io.IOException
221 * if an IOException occurs during marshaling
222 * @throws org.exolab.castor.xml.ValidationException
223 * if this object is an invalid instance according to the schema
224 * @throws org.exolab.castor.xml.MarshalException
225 * if object is null or if any SAXException is thrown during
228 public void marshal(final org.xml.sax.ContentHandler handler)
229 throws java.io.IOException,
230 org.exolab.castor.xml.MarshalException,
231 org.exolab.castor.xml.ValidationException
233 Marshaller.marshal(this, handler);
238 public void removeAllPdbentryItem()
244 * Method removePdbentryItem.
246 * @param vPdbentryItem
247 * @return true if the object was removed from the collection.
249 public boolean removePdbentryItem(
250 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
252 boolean removed = _items.remove(vPdbentryItem);
257 * Method removePdbentryItemAt.
260 * @return the element removed from the collection
262 public jalview.schemabinding.version2.PdbentryItem removePdbentryItemAt(
265 java.lang.Object obj = this._items.remove(index);
266 return (jalview.schemabinding.version2.PdbentryItem) obj;
270 * Sets the value of field 'file'.
273 * the value of field 'file'.
275 public void setFile(final java.lang.String file)
281 * Sets the value of field 'id'.
284 * the value of field 'id'.
286 public void setId(final java.lang.String id)
295 * @param vPdbentryItem
296 * @throws java.lang.IndexOutOfBoundsException
297 * if the index given is outside the bounds of the collection
299 public void setPdbentryItem(final int index,
300 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
301 throws java.lang.IndexOutOfBoundsException
303 // check bounds for index
304 if (index < 0 || index >= this._items.size())
306 throw new IndexOutOfBoundsException("setPdbentryItem: Index value '"
307 + index + "' not in range [0.." + (this._items.size() - 1)
311 this._items.set(index, vPdbentryItem);
317 * @param vPdbentryItemArray
319 public void setPdbentryItem(
320 final jalview.schemabinding.version2.PdbentryItem[] vPdbentryItemArray)
325 for (int i = 0; i < vPdbentryItemArray.length; i++)
327 this._items.add(vPdbentryItemArray[i]);
332 * Sets the value of field 'type'.
335 * the value of field 'type'.
337 public void setType(final java.lang.String type)
346 * @throws org.exolab.castor.xml.MarshalException
347 * if object is null or if any SAXException is thrown during
349 * @throws org.exolab.castor.xml.ValidationException
350 * if this object is an invalid instance according to the schema
351 * @return the unmarshaled jalview.schemabinding.version2.Pdbentry
353 public static jalview.schemabinding.version2.Pdbentry unmarshal(
354 final java.io.Reader reader)
355 throws org.exolab.castor.xml.MarshalException,
356 org.exolab.castor.xml.ValidationException
358 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller
359 .unmarshal(jalview.schemabinding.version2.Pdbentry.class,
366 * @throws org.exolab.castor.xml.ValidationException
367 * if this object is an invalid instance according to the schema
369 public void validate() throws org.exolab.castor.xml.ValidationException
371 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
372 validator.validate(this);