2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.binding;
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.util.Vector _items;
51 this._items = new java.util.Vector();
61 * @param vPdbentryItem
62 * @throws java.lang.IndexOutOfBoundsException
63 * if the index given is outside the bounds of the collection
65 public void addPdbentryItem(
66 final jalview.binding.PdbentryItem vPdbentryItem)
67 throws java.lang.IndexOutOfBoundsException
69 this._items.addElement(vPdbentryItem);
76 * @param vPdbentryItem
77 * @throws java.lang.IndexOutOfBoundsException
78 * if the index given is outside the bounds of the collection
80 public void addPdbentryItem(final int index,
81 final jalview.binding.PdbentryItem vPdbentryItem)
82 throws java.lang.IndexOutOfBoundsException
84 this._items.add(index, vPdbentryItem);
88 * Method enumeratePdbentryItem.
90 * @return an Enumeration over all jalview.binding.PdbentryItem elements
92 public java.util.Enumeration enumeratePdbentryItem()
94 return this._items.elements();
98 * Returns the value of field 'id'.
100 * @return the value of field 'Id'.
102 public java.lang.String getId()
108 * Method getPdbentryItem.
111 * @throws java.lang.IndexOutOfBoundsException
112 * if the index given is outside the bounds of the collection
113 * @return the value of the jalview.binding.PdbentryItem at the given index
115 public jalview.binding.PdbentryItem getPdbentryItem(final int index)
116 throws java.lang.IndexOutOfBoundsException
118 // check bounds for index
119 if (index < 0 || index >= this._items.size())
121 throw new IndexOutOfBoundsException("getPdbentryItem: Index value '"
122 + index + "' not in range [0.." + (this._items.size() - 1)
126 return (jalview.binding.PdbentryItem) _items.get(index);
130 * Method getPdbentryItem.Returns the contents of the collection in an Array.
132 * Note: Just in case the collection contents are changing in another thread,
133 * we pass a 0-length Array of the correct type into the API call. This way we
134 * <i>know</i> that the Array returned is of exactly the correct length.
136 * @return this collection as an Array
138 public jalview.binding.PdbentryItem[] getPdbentryItem()
140 jalview.binding.PdbentryItem[] array = new jalview.binding.PdbentryItem[0];
141 return (jalview.binding.PdbentryItem[]) this._items.toArray(array);
145 * Method getPdbentryItemCount.
147 * @return the size of this collection
149 public int getPdbentryItemCount()
151 return this._items.size();
155 * Returns the value of field 'type'.
157 * @return the value of field 'Type'.
159 public java.lang.String getType()
167 * @return true if this object is valid according to the schema
169 public boolean isValid()
174 } catch (org.exolab.castor.xml.ValidationException vex)
185 * @throws org.exolab.castor.xml.MarshalException
186 * if object is null or if any SAXException is thrown during
188 * @throws org.exolab.castor.xml.ValidationException
189 * if this object is an invalid instance according to the schema
191 public void marshal(final java.io.Writer out)
192 throws org.exolab.castor.xml.MarshalException,
193 org.exolab.castor.xml.ValidationException
195 Marshaller.marshal(this, out);
202 * @throws java.io.IOException
203 * if an IOException occurs during marshaling
204 * @throws org.exolab.castor.xml.ValidationException
205 * if this object is an invalid instance according to the schema
206 * @throws org.exolab.castor.xml.MarshalException
207 * if object is null or if any SAXException is thrown during
210 public void marshal(final org.xml.sax.ContentHandler handler)
211 throws java.io.IOException,
212 org.exolab.castor.xml.MarshalException,
213 org.exolab.castor.xml.ValidationException
215 Marshaller.marshal(this, handler);
220 public void removeAllPdbentryItem()
226 * Method removePdbentryItem.
228 * @param vPdbentryItem
229 * @return true if the object was removed from the collection.
231 public boolean removePdbentryItem(
232 final jalview.binding.PdbentryItem vPdbentryItem)
234 boolean removed = _items.remove(vPdbentryItem);
239 * Method removePdbentryItemAt.
242 * @return the element removed from the collection
244 public jalview.binding.PdbentryItem removePdbentryItemAt(final int index)
246 java.lang.Object obj = this._items.remove(index);
247 return (jalview.binding.PdbentryItem) obj;
251 * Sets the value of field 'id'.
254 * the value of field 'id'.
256 public void setId(final java.lang.String id)
265 * @param vPdbentryItem
266 * @throws java.lang.IndexOutOfBoundsException
267 * if the index given is outside the bounds of the collection
269 public void setPdbentryItem(final int index,
270 final jalview.binding.PdbentryItem vPdbentryItem)
271 throws java.lang.IndexOutOfBoundsException
273 // check bounds for index
274 if (index < 0 || index >= this._items.size())
276 throw new IndexOutOfBoundsException("setPdbentryItem: Index value '"
277 + index + "' not in range [0.." + (this._items.size() - 1)
281 this._items.set(index, vPdbentryItem);
287 * @param vPdbentryItemArray
289 public void setPdbentryItem(
290 final jalview.binding.PdbentryItem[] vPdbentryItemArray)
295 for (int i = 0; i < vPdbentryItemArray.length; i++)
297 this._items.add(vPdbentryItemArray[i]);
302 * Sets the value of field 'type'.
305 * the value of field 'type'.
307 public void setType(final java.lang.String type)
316 * @throws org.exolab.castor.xml.MarshalException
317 * if object is null or if any SAXException is thrown during
319 * @throws org.exolab.castor.xml.ValidationException
320 * if this object is an invalid instance according to the schema
321 * @return the unmarshaled jalview.binding.Pdbentry
323 public static jalview.binding.Pdbentry unmarshal(
324 final java.io.Reader reader)
325 throws org.exolab.castor.xml.MarshalException,
326 org.exolab.castor.xml.ValidationException
328 return (jalview.binding.Pdbentry) Unmarshaller.unmarshal(
329 jalview.binding.Pdbentry.class, reader);
335 * @throws org.exolab.castor.xml.ValidationException
336 * if this object is an invalid instance according to the schema
338 public void validate() throws org.exolab.castor.xml.ValidationException
340 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
341 validator.validate(this);