1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 The Jalview Authors
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.
17 * If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import org.exolab.castor.xml.Marshaller;
34 import org.exolab.castor.xml.Unmarshaller;
39 * @version $Revision$ $Date$
41 public class Pdbentry implements java.io.Serializable
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
51 private java.lang.String _id;
56 private java.lang.String _type;
61 private java.lang.String _file;
66 private java.util.Vector _items;
75 this._items = new java.util.Vector();
85 * @param vPdbentryItem
86 * @throws java.lang.IndexOutOfBoundsException
87 * if the index given is outside the bounds of the collection
89 public void addPdbentryItem(
90 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
91 throws java.lang.IndexOutOfBoundsException
93 this._items.addElement(vPdbentryItem);
100 * @param vPdbentryItem
101 * @throws java.lang.IndexOutOfBoundsException
102 * if the index given is outside the bounds of the collection
104 public void addPdbentryItem(final int index,
105 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
106 throws java.lang.IndexOutOfBoundsException
108 this._items.add(index, vPdbentryItem);
112 * Method enumeratePdbentryItem.
114 * @return an Enumeration over all jalview.schemabinding.version2.PdbentryItem
117 public java.util.Enumeration enumeratePdbentryItem()
119 return this._items.elements();
123 * Returns the value of field 'file'.
125 * @return the value of field 'File'.
127 public java.lang.String getFile()
133 * Returns the value of field 'id'.
135 * @return the value of field 'Id'.
137 public java.lang.String getId()
143 * Method getPdbentryItem.
146 * @throws java.lang.IndexOutOfBoundsException
147 * if the index given is outside the bounds of the collection
148 * @return the value of the jalview.schemabinding.version2.PdbentryItem at the
151 public jalview.schemabinding.version2.PdbentryItem getPdbentryItem(
152 final int index) throws java.lang.IndexOutOfBoundsException
154 // check bounds for index
155 if (index < 0 || index >= this._items.size())
157 throw new IndexOutOfBoundsException("getPdbentryItem: Index value '"
158 + index + "' not in range [0.." + (this._items.size() - 1)
162 return (jalview.schemabinding.version2.PdbentryItem) _items.get(index);
166 * Method getPdbentryItem.Returns the contents of the collection in an Array.
168 * Note: Just in case the collection contents are changing in another thread,
169 * we pass a 0-length Array of the correct type into the API call. This way we
170 * <i>know</i> that the Array returned is of exactly the correct length.
172 * @return this collection as an Array
174 public jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem()
176 jalview.schemabinding.version2.PdbentryItem[] array = new jalview.schemabinding.version2.PdbentryItem[0];
177 return (jalview.schemabinding.version2.PdbentryItem[]) this._items
182 * Method getPdbentryItemCount.
184 * @return the size of this collection
186 public int getPdbentryItemCount()
188 return this._items.size();
192 * Returns the value of field 'type'.
194 * @return the value of field 'Type'.
196 public java.lang.String getType()
204 * @return true if this object is valid according to the schema
206 public boolean isValid()
211 } catch (org.exolab.castor.xml.ValidationException vex)
222 * @throws org.exolab.castor.xml.MarshalException
223 * if object is null or if any SAXException is thrown during
225 * @throws org.exolab.castor.xml.ValidationException
226 * if this object is an invalid instance according to the schema
228 public void marshal(final java.io.Writer out)
229 throws org.exolab.castor.xml.MarshalException,
230 org.exolab.castor.xml.ValidationException
232 Marshaller.marshal(this, out);
239 * @throws java.io.IOException
240 * if an IOException occurs during marshaling
241 * @throws org.exolab.castor.xml.ValidationException
242 * if this object is an invalid instance according to the schema
243 * @throws org.exolab.castor.xml.MarshalException
244 * if object is null or if any SAXException is thrown during
247 public void marshal(final org.xml.sax.ContentHandler handler)
248 throws java.io.IOException,
249 org.exolab.castor.xml.MarshalException,
250 org.exolab.castor.xml.ValidationException
252 Marshaller.marshal(this, handler);
257 public void removeAllPdbentryItem()
263 * Method removePdbentryItem.
265 * @param vPdbentryItem
266 * @return true if the object was removed from the collection.
268 public boolean removePdbentryItem(
269 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
271 boolean removed = _items.remove(vPdbentryItem);
276 * Method removePdbentryItemAt.
279 * @return the element removed from the collection
281 public jalview.schemabinding.version2.PdbentryItem removePdbentryItemAt(
284 java.lang.Object obj = this._items.remove(index);
285 return (jalview.schemabinding.version2.PdbentryItem) obj;
289 * Sets the value of field 'file'.
292 * the value of field 'file'.
294 public void setFile(final java.lang.String file)
300 * Sets the value of field 'id'.
303 * the value of field 'id'.
305 public void setId(final java.lang.String id)
314 * @param vPdbentryItem
315 * @throws java.lang.IndexOutOfBoundsException
316 * if the index given is outside the bounds of the collection
318 public void setPdbentryItem(final int index,
319 final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)
320 throws java.lang.IndexOutOfBoundsException
322 // check bounds for index
323 if (index < 0 || index >= this._items.size())
325 throw new IndexOutOfBoundsException("setPdbentryItem: Index value '"
326 + index + "' not in range [0.." + (this._items.size() - 1)
330 this._items.set(index, vPdbentryItem);
336 * @param vPdbentryItemArray
338 public void setPdbentryItem(
339 final jalview.schemabinding.version2.PdbentryItem[] vPdbentryItemArray)
344 for (int i = 0; i < vPdbentryItemArray.length; i++)
346 this._items.add(vPdbentryItemArray[i]);
351 * Sets the value of field 'type'.
354 * the value of field 'type'.
356 public void setType(final java.lang.String type)
365 * @throws org.exolab.castor.xml.MarshalException
366 * if object is null or if any SAXException is thrown during
368 * @throws org.exolab.castor.xml.ValidationException
369 * if this object is an invalid instance according to the schema
370 * @return the unmarshaled jalview.schemabinding.version2.Pdbentry
372 public static jalview.schemabinding.version2.Pdbentry unmarshal(
373 final java.io.Reader reader)
374 throws org.exolab.castor.xml.MarshalException,
375 org.exolab.castor.xml.ValidationException
377 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller
378 .unmarshal(jalview.schemabinding.version2.Pdbentry.class,
385 * @throws org.exolab.castor.xml.ValidationException
386 * if this object is an invalid instance according to the schema
388 public void validate() throws org.exolab.castor.xml.ValidationException
390 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
391 validator.validate(this);