1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.binding;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import org.exolab.castor.xml.Marshaller;
32 import org.exolab.castor.xml.Unmarshaller;
37 * @version $Revision$ $Date$
39 public class Pdbentry implements java.io.Serializable {
42 //--------------------------/
43 //- Class/Member Variables -/
44 //--------------------------/
49 private java.lang.String _id;
54 private java.lang.String _type;
59 private java.util.Vector _items;
68 this._items = new java.util.Vector();
79 * @param vPdbentryItem
80 * @throws java.lang.IndexOutOfBoundsException if the index
81 * given is outside the bounds of the collection
83 public void addPdbentryItem(
84 final jalview.binding.PdbentryItem vPdbentryItem)
85 throws java.lang.IndexOutOfBoundsException {
86 this._items.addElement(vPdbentryItem);
93 * @param vPdbentryItem
94 * @throws java.lang.IndexOutOfBoundsException if the index
95 * given is outside the bounds of the collection
97 public void addPdbentryItem(
99 final jalview.binding.PdbentryItem vPdbentryItem)
100 throws java.lang.IndexOutOfBoundsException {
101 this._items.add(index, vPdbentryItem);
105 * Method enumeratePdbentryItem.
107 * @return an Enumeration over all jalview.binding.PdbentryItem
110 public java.util.Enumeration enumeratePdbentryItem(
112 return this._items.elements();
116 * Returns the value of field 'id'.
118 * @return the value of field 'Id'.
120 public java.lang.String getId(
126 * Method getPdbentryItem.
129 * @throws java.lang.IndexOutOfBoundsException if the index
130 * given is outside the bounds of the collection
131 * @return the value of the jalview.binding.PdbentryItem at the
134 public jalview.binding.PdbentryItem getPdbentryItem(
136 throws java.lang.IndexOutOfBoundsException {
137 // check bounds for index
138 if (index < 0 || index >= this._items.size()) {
139 throw new IndexOutOfBoundsException("getPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]");
142 return (jalview.binding.PdbentryItem) _items.get(index);
146 * Method getPdbentryItem.Returns the contents of the
147 * collection in an Array. <p>Note: Just in case the
148 * collection contents are changing in another thread, we pass
149 * a 0-length Array of the correct type into the API call.
150 * This way we <i>know</i> that the Array returned is of
151 * exactly the correct length.
153 * @return this collection as an Array
155 public jalview.binding.PdbentryItem[] getPdbentryItem(
157 jalview.binding.PdbentryItem[] array = new jalview.binding.PdbentryItem[0];
158 return (jalview.binding.PdbentryItem[]) this._items.toArray(array);
162 * Method getPdbentryItemCount.
164 * @return the size of this collection
166 public int getPdbentryItemCount(
168 return this._items.size();
172 * Returns the value of field 'type'.
174 * @return the value of field 'Type'.
176 public java.lang.String getType(
184 * @return true if this object is valid according to the schema
186 public boolean isValid(
190 } catch (org.exolab.castor.xml.ValidationException vex) {
200 * @throws org.exolab.castor.xml.MarshalException if object is
201 * null or if any SAXException is thrown during marshaling
202 * @throws org.exolab.castor.xml.ValidationException if this
203 * object is an invalid instance according to the schema
206 final java.io.Writer out)
207 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
208 Marshaller.marshal(this, out);
215 * @throws java.io.IOException if an IOException occurs during
217 * @throws org.exolab.castor.xml.ValidationException if this
218 * object is an invalid instance according to the schema
219 * @throws org.exolab.castor.xml.MarshalException if object is
220 * null or if any SAXException is thrown during marshaling
223 final org.xml.sax.ContentHandler handler)
224 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
225 Marshaller.marshal(this, handler);
230 public void removeAllPdbentryItem(
236 * Method removePdbentryItem.
238 * @param vPdbentryItem
239 * @return true if the object was removed from the collection.
241 public boolean removePdbentryItem(
242 final jalview.binding.PdbentryItem vPdbentryItem) {
243 boolean removed = _items.remove(vPdbentryItem);
248 * Method removePdbentryItemAt.
251 * @return the element removed from the collection
253 public jalview.binding.PdbentryItem removePdbentryItemAt(
255 java.lang.Object obj = this._items.remove(index);
256 return (jalview.binding.PdbentryItem) obj;
260 * Sets the value of field 'id'.
262 * @param id the value of field 'id'.
265 final java.lang.String id) {
273 * @param vPdbentryItem
274 * @throws java.lang.IndexOutOfBoundsException if the index
275 * given is outside the bounds of the collection
277 public void setPdbentryItem(
279 final jalview.binding.PdbentryItem vPdbentryItem)
280 throws java.lang.IndexOutOfBoundsException {
281 // check bounds for index
282 if (index < 0 || index >= this._items.size()) {
283 throw new IndexOutOfBoundsException("setPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]");
286 this._items.set(index, vPdbentryItem);
292 * @param vPdbentryItemArray
294 public void setPdbentryItem(
295 final jalview.binding.PdbentryItem[] vPdbentryItemArray) {
299 for (int i = 0; i < vPdbentryItemArray.length; i++) {
300 this._items.add(vPdbentryItemArray[i]);
305 * Sets the value of field 'type'.
307 * @param type the value of field 'type'.
310 final java.lang.String type) {
318 * @throws org.exolab.castor.xml.MarshalException if object is
319 * null or if any SAXException is thrown during marshaling
320 * @throws org.exolab.castor.xml.ValidationException if this
321 * object is an invalid instance according to the schema
322 * @return the unmarshaled jalview.binding.Pdbentry
324 public static jalview.binding.Pdbentry unmarshal(
325 final java.io.Reader reader)
326 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
327 return (jalview.binding.Pdbentry) Unmarshaller.unmarshal(jalview.binding.Pdbentry.class, reader);
333 * @throws org.exolab.castor.xml.ValidationException if this
334 * object is an invalid instance according to the schema
336 public void validate(
338 throws org.exolab.castor.xml.ValidationException {
339 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
340 validator.validate(this);