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();
62 * @param vPdbentryItem
63 * @throws java.lang.IndexOutOfBoundsException if the index
64 * given is outside the bounds of the collection
66 public void addPdbentryItem(
67 final jalview.binding.PdbentryItem vPdbentryItem)
68 throws java.lang.IndexOutOfBoundsException {
69 this._items.addElement(vPdbentryItem);
76 * @param vPdbentryItem
77 * @throws java.lang.IndexOutOfBoundsException if the index
78 * given is outside the bounds of the collection
80 public void addPdbentryItem(
82 final jalview.binding.PdbentryItem vPdbentryItem)
83 throws java.lang.IndexOutOfBoundsException {
84 this._items.add(index, vPdbentryItem);
88 * Method enumeratePdbentryItem.
90 * @return an Enumeration over all jalview.binding.PdbentryItem
93 public java.util.Enumeration enumeratePdbentryItem(
95 return this._items.elements();
99 * Returns the value of field 'id'.
101 * @return the value of field 'Id'.
103 public java.lang.String getId(
109 * Method getPdbentryItem.
112 * @throws java.lang.IndexOutOfBoundsException if the index
113 * given is outside the bounds of the collection
114 * @return the value of the jalview.binding.PdbentryItem at the
117 public jalview.binding.PdbentryItem getPdbentryItem(
119 throws java.lang.IndexOutOfBoundsException {
120 // check bounds for index
121 if (index < 0 || index >= this._items.size()) {
122 throw new IndexOutOfBoundsException("getPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]");
125 return (jalview.binding.PdbentryItem) _items.get(index);
129 * Method getPdbentryItem.Returns the contents of the
130 * collection in an Array. <p>Note: Just in case the
131 * collection contents are changing in another thread, we pass
132 * a 0-length Array of the correct type into the API call.
133 * This way we <i>know</i> that the Array returned is of
134 * 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(
173 } catch (org.exolab.castor.xml.ValidationException vex) {
183 * @throws org.exolab.castor.xml.MarshalException if object is
184 * null or if any SAXException is thrown during marshaling
185 * @throws org.exolab.castor.xml.ValidationException if this
186 * object is an invalid instance according to the schema
189 final java.io.Writer out)
190 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
191 Marshaller.marshal(this, out);
198 * @throws java.io.IOException if an IOException occurs during
200 * @throws org.exolab.castor.xml.ValidationException if this
201 * object is an invalid instance according to the schema
202 * @throws org.exolab.castor.xml.MarshalException if object is
203 * null or if any SAXException is thrown during marshaling
206 final org.xml.sax.ContentHandler handler)
207 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
208 Marshaller.marshal(this, handler);
213 public void removeAllPdbentryItem(
219 * Method removePdbentryItem.
221 * @param vPdbentryItem
222 * @return true if the object was removed from the collection.
224 public boolean removePdbentryItem(
225 final jalview.binding.PdbentryItem vPdbentryItem) {
226 boolean removed = _items.remove(vPdbentryItem);
231 * Method removePdbentryItemAt.
234 * @return the element removed from the collection
236 public jalview.binding.PdbentryItem removePdbentryItemAt(
238 java.lang.Object obj = this._items.remove(index);
239 return (jalview.binding.PdbentryItem) obj;
243 * Sets the value of field 'id'.
245 * @param id the value of field 'id'.
248 final java.lang.String id) {
256 * @param vPdbentryItem
257 * @throws java.lang.IndexOutOfBoundsException if the index
258 * given is outside the bounds of the collection
260 public void setPdbentryItem(
262 final jalview.binding.PdbentryItem vPdbentryItem)
263 throws java.lang.IndexOutOfBoundsException {
264 // check bounds for index
265 if (index < 0 || index >= this._items.size()) {
266 throw new IndexOutOfBoundsException("setPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]");
269 this._items.set(index, vPdbentryItem);
275 * @param vPdbentryItemArray
277 public void setPdbentryItem(
278 final jalview.binding.PdbentryItem[] vPdbentryItemArray) {
282 for (int i = 0; i < vPdbentryItemArray.length; i++) {
283 this._items.add(vPdbentryItemArray[i]);
288 * Sets the value of field 'type'.
290 * @param type the value of field 'type'.
293 final java.lang.String type) {
301 * @throws org.exolab.castor.xml.MarshalException if object is
302 * null or if any SAXException is thrown during marshaling
303 * @throws org.exolab.castor.xml.ValidationException if this
304 * object is an invalid instance according to the schema
305 * @return the unmarshaled jalview.binding.Pdbentry
307 public static jalview.binding.Pdbentry unmarshal(
308 final java.io.Reader reader)
309 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
310 return (jalview.binding.Pdbentry) Unmarshaller.unmarshal(jalview.binding.Pdbentry.class, reader);
316 * @throws org.exolab.castor.xml.ValidationException if this
317 * object is an invalid instance according to the schema
319 public void validate(
321 throws org.exolab.castor.xml.ValidationException {
322 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
323 validator.validate(this);