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 Pdbids extends jalview.schemabinding.version2.Pdbentry
42 implements java.io.Serializable
45 // --------------------------/
46 // - Class/Member Variables -/
47 // --------------------------/
50 * Field _structureStateList.
52 private java.util.Vector _structureStateList;
61 this._structureStateList = new java.util.Vector();
71 * @param vStructureState
72 * @throws java.lang.IndexOutOfBoundsException
73 * if the index given is outside the bounds of the collection
75 public void addStructureState(
76 final jalview.schemabinding.version2.StructureState vStructureState)
77 throws java.lang.IndexOutOfBoundsException
79 this._structureStateList.addElement(vStructureState);
86 * @param vStructureState
87 * @throws java.lang.IndexOutOfBoundsException
88 * if the index given is outside the bounds of the collection
90 public void addStructureState(
92 final jalview.schemabinding.version2.StructureState vStructureState)
93 throws java.lang.IndexOutOfBoundsException
95 this._structureStateList.add(index, vStructureState);
99 * Method enumerateStructureState.
101 * @return an Enumeration over all
102 * jalview.schemabinding.version2.StructureState elements
104 public java.util.Enumeration enumerateStructureState()
106 return this._structureStateList.elements();
110 * Method getStructureState.
113 * @throws java.lang.IndexOutOfBoundsException
114 * if the index given is outside the bounds of the collection
115 * @return the value of the jalview.schemabinding.version2.StructureState at
118 public jalview.schemabinding.version2.StructureState getStructureState(
119 final int index) throws java.lang.IndexOutOfBoundsException
121 // check bounds for index
122 if (index < 0 || index >= this._structureStateList.size())
124 throw new IndexOutOfBoundsException(
125 "getStructureState: Index value '" + index
126 + "' not in range [0.."
127 + (this._structureStateList.size() - 1) + "]");
130 return (jalview.schemabinding.version2.StructureState) _structureStateList
135 * Method getStructureState.Returns the contents of the collection in an
138 * Note: Just in case the collection contents are changing in another thread,
139 * we pass a 0-length Array of the correct type into the API call. This way we
140 * <i>know</i> that the Array returned is of exactly the correct length.
142 * @return this collection as an Array
144 public jalview.schemabinding.version2.StructureState[] getStructureState()
146 jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0];
147 return (jalview.schemabinding.version2.StructureState[]) this._structureStateList
152 * Method getStructureStateCount.
154 * @return the size of this collection
156 public int getStructureStateCount()
158 return this._structureStateList.size();
164 * @return true if this object is valid according to the schema
166 public boolean isValid()
171 } catch (org.exolab.castor.xml.ValidationException vex)
182 * @throws org.exolab.castor.xml.MarshalException
183 * if object is null or if any SAXException is thrown during
185 * @throws org.exolab.castor.xml.ValidationException
186 * if this object is an invalid instance according to the schema
188 public void marshal(final java.io.Writer out)
189 throws org.exolab.castor.xml.MarshalException,
190 org.exolab.castor.xml.ValidationException
192 Marshaller.marshal(this, out);
199 * @throws java.io.IOException
200 * if an IOException occurs during marshaling
201 * @throws org.exolab.castor.xml.ValidationException
202 * if this object is an invalid instance according to the schema
203 * @throws org.exolab.castor.xml.MarshalException
204 * if object is null or if any SAXException is thrown during
207 public void marshal(final org.xml.sax.ContentHandler handler)
208 throws java.io.IOException,
209 org.exolab.castor.xml.MarshalException,
210 org.exolab.castor.xml.ValidationException
212 Marshaller.marshal(this, handler);
217 public void removeAllStructureState()
219 this._structureStateList.clear();
223 * Method removeStructureState.
225 * @param vStructureState
226 * @return true if the object was removed from the collection.
228 public boolean removeStructureState(
229 final jalview.schemabinding.version2.StructureState vStructureState)
231 boolean removed = _structureStateList.remove(vStructureState);
236 * Method removeStructureStateAt.
239 * @return the element removed from the collection
241 public jalview.schemabinding.version2.StructureState removeStructureStateAt(
244 java.lang.Object obj = this._structureStateList.remove(index);
245 return (jalview.schemabinding.version2.StructureState) obj;
252 * @param vStructureState
253 * @throws java.lang.IndexOutOfBoundsException
254 * if the index given is outside the bounds of the collection
256 public void setStructureState(
258 final jalview.schemabinding.version2.StructureState vStructureState)
259 throws java.lang.IndexOutOfBoundsException
261 // check bounds for index
262 if (index < 0 || index >= this._structureStateList.size())
264 throw new IndexOutOfBoundsException(
265 "setStructureState: Index value '" + index
266 + "' not in range [0.."
267 + (this._structureStateList.size() - 1) + "]");
270 this._structureStateList.set(index, vStructureState);
276 * @param vStructureStateArray
278 public void setStructureState(
279 final jalview.schemabinding.version2.StructureState[] vStructureStateArray)
282 _structureStateList.clear();
284 for (int i = 0; i < vStructureStateArray.length; i++)
286 this._structureStateList.add(vStructureStateArray[i]);
294 * @throws org.exolab.castor.xml.MarshalException
295 * if object is null or if any SAXException is thrown during
297 * @throws org.exolab.castor.xml.ValidationException
298 * if this object is an invalid instance according to the schema
299 * @return the unmarshaled jalview.schemabinding.version2.Pdbentry
301 public static jalview.schemabinding.version2.Pdbentry unmarshal(
302 final java.io.Reader reader)
303 throws org.exolab.castor.xml.MarshalException,
304 org.exolab.castor.xml.ValidationException
306 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller
307 .unmarshal(jalview.schemabinding.version2.Pdbids.class, reader);
313 * @throws org.exolab.castor.xml.ValidationException
314 * if this object is an invalid instance according to the schema
316 public void validate() throws org.exolab.castor.xml.ValidationException
318 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
319 validator.validate(this);