1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, 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.schemabinding.version2;
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.lang.String _file;
64 private java.util.Vector _items;
73 this._items = new java.util.Vector();
84 * @param vPdbentryItem
85 * @throws java.lang.IndexOutOfBoundsException if the index
86 * given is outside the bounds of the collection
88 public void addPdbentryItem(
89 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
90 throws java.lang.IndexOutOfBoundsException {
91 this._items.addElement(vPdbentryItem);
98 * @param vPdbentryItem
99 * @throws java.lang.IndexOutOfBoundsException if the index
100 * given is outside the bounds of the collection
102 public void addPdbentryItem(
104 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
105 throws java.lang.IndexOutOfBoundsException {
106 this._items.add(index, vPdbentryItem);
110 * Method enumeratePdbentryItem.
112 * @return an Enumeration over all
113 * jalview.schemabinding.version2.PdbentryItem elements
115 public java.util.Enumeration enumeratePdbentryItem(
117 return this._items.elements();
121 * Returns the value of field 'file'.
123 * @return the value of field 'File'.
125 public java.lang.String getFile(
131 * Returns the value of field 'id'.
133 * @return the value of field 'Id'.
135 public java.lang.String getId(
141 * Method getPdbentryItem.
144 * @throws java.lang.IndexOutOfBoundsException if the index
145 * given is outside the bounds of the collection
146 * @return the value of the
147 * jalview.schemabinding.version2.PdbentryItem at the given inde
149 public jalview.schemabinding.version2.PdbentryItem getPdbentryItem(
151 throws java.lang.IndexOutOfBoundsException {
152 // check bounds for index
153 if (index < 0 || index >= this._items.size()) {
154 throw new IndexOutOfBoundsException("getPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]");
157 return (jalview.schemabinding.version2.PdbentryItem) _items.get(index);
161 * Method getPdbentryItem.Returns the contents of the
162 * collection in an Array. <p>Note: Just in case the
163 * collection contents are changing in another thread, we pass
164 * a 0-length Array of the correct type into the API call.
165 * This way we <i>know</i> that the Array returned is of
166 * exactly the correct length.
168 * @return this collection as an Array
170 public jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem(
172 jalview.schemabinding.version2.PdbentryItem[] array = new jalview.schemabinding.version2.PdbentryItem[0];
173 return (jalview.schemabinding.version2.PdbentryItem[]) this._items.toArray(array);
177 * Method getPdbentryItemCount.
179 * @return the size of this collection
181 public int getPdbentryItemCount(
183 return this._items.size();
187 * Returns the value of field 'type'.
189 * @return the value of field 'Type'.
191 public java.lang.String getType(
199 * @return true if this object is valid according to the schema
201 public boolean isValid(
205 } catch (org.exolab.castor.xml.ValidationException vex) {
215 * @throws org.exolab.castor.xml.MarshalException if object is
216 * null or if any SAXException is thrown during marshaling
217 * @throws org.exolab.castor.xml.ValidationException if this
218 * object is an invalid instance according to the schema
221 final java.io.Writer out)
222 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
223 Marshaller.marshal(this, out);
230 * @throws java.io.IOException if an IOException occurs during
232 * @throws org.exolab.castor.xml.ValidationException if this
233 * object is an invalid instance according to the schema
234 * @throws org.exolab.castor.xml.MarshalException if object is
235 * null or if any SAXException is thrown during marshaling
238 final org.xml.sax.ContentHandler handler)
239 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
240 Marshaller.marshal(this, handler);
245 public void removeAllPdbentryItem(
251 * Method removePdbentryItem.
253 * @param vPdbentryItem
254 * @return true if the object was removed from the collection.
256 public boolean removePdbentryItem(
257 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) {
258 boolean removed = _items.remove(vPdbentryItem);
263 * Method removePdbentryItemAt.
266 * @return the element removed from the collection
268 public jalview.schemabinding.version2.PdbentryItem removePdbentryItemAt(
270 java.lang.Object obj = this._items.remove(index);
271 return (jalview.schemabinding.version2.PdbentryItem) obj;
275 * Sets the value of field 'file'.
277 * @param file the value of field 'file'.
280 final java.lang.String file) {
285 * Sets the value of field 'id'.
287 * @param id the value of field 'id'.
290 final java.lang.String id) {
298 * @param vPdbentryItem
299 * @throws java.lang.IndexOutOfBoundsException if the index
300 * given is outside the bounds of the collection
302 public void setPdbentryItem(
304 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
305 throws java.lang.IndexOutOfBoundsException {
306 // check bounds for index
307 if (index < 0 || index >= this._items.size()) {
308 throw new IndexOutOfBoundsException("setPdbentryItem: Index value '" + 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) {
324 for (int i = 0; i < vPdbentryItemArray.length; i++) {
325 this._items.add(vPdbentryItemArray[i]);
330 * Sets the value of field 'type'.
332 * @param type the value of field 'type'.
335 final java.lang.String type) {
343 * @throws org.exolab.castor.xml.MarshalException if object is
344 * null or if any SAXException is thrown during marshaling
345 * @throws org.exolab.castor.xml.ValidationException if this
346 * object is an invalid instance according to the schema
347 * @return the unmarshaled
348 * jalview.schemabinding.version2.Pdbentry
350 public static jalview.schemabinding.version2.Pdbentry unmarshal(
351 final java.io.Reader reader)
352 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
353 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbentry.class, reader);
359 * @throws org.exolab.castor.xml.ValidationException if this
360 * object is an invalid instance according to the schema
362 public void validate(
364 throws org.exolab.castor.xml.ValidationException {
365 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
366 validator.validate(this);