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 Pdbids extends jalview.schemabinding.version2.Pdbentry
40 implements java.io.Serializable
44 //--------------------------/
45 //- Class/Member Variables -/
46 //--------------------------/
49 * Field _structureStateList.
51 private java.util.Vector _structureStateList;
60 this._structureStateList = new java.util.Vector();
71 * @param vStructureState
72 * @throws java.lang.IndexOutOfBoundsException if the index
73 * given is outside the bounds of the collection
75 public void addStructureState(
76 final jalview.schemabinding.version2.StructureState vStructureState)
77 throws java.lang.IndexOutOfBoundsException {
78 this._structureStateList.addElement(vStructureState);
85 * @param vStructureState
86 * @throws java.lang.IndexOutOfBoundsException if the index
87 * given is outside the bounds of the collection
89 public void addStructureState(
91 final jalview.schemabinding.version2.StructureState vStructureState)
92 throws java.lang.IndexOutOfBoundsException {
93 this._structureStateList.add(index, vStructureState);
97 * Method enumerateStructureState.
99 * @return an Enumeration over all
100 * jalview.schemabinding.version2.StructureState elements
102 public java.util.Enumeration enumerateStructureState(
104 return this._structureStateList.elements();
108 * Method getStructureState.
111 * @throws java.lang.IndexOutOfBoundsException if the index
112 * given is outside the bounds of the collection
113 * @return the value of the
114 * jalview.schemabinding.version2.StructureState at the given
117 public jalview.schemabinding.version2.StructureState getStructureState(
119 throws java.lang.IndexOutOfBoundsException {
120 // check bounds for index
121 if (index < 0 || index >= this._structureStateList.size()) {
122 throw new IndexOutOfBoundsException("getStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]");
125 return (jalview.schemabinding.version2.StructureState) _structureStateList.get(index);
129 * Method getStructureState.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.schemabinding.version2.StructureState[] getStructureState(
140 jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0];
141 return (jalview.schemabinding.version2.StructureState[]) this._structureStateList.toArray(array);
145 * Method getStructureStateCount.
147 * @return the size of this collection
149 public int getStructureStateCount(
151 return this._structureStateList.size();
157 * @return true if this object is valid according to the schema
159 public boolean isValid(
163 } catch (org.exolab.castor.xml.ValidationException vex) {
173 * @throws org.exolab.castor.xml.MarshalException if object is
174 * null or if any SAXException is thrown during marshaling
175 * @throws org.exolab.castor.xml.ValidationException if this
176 * object is an invalid instance according to the schema
179 final java.io.Writer out)
180 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
181 Marshaller.marshal(this, out);
188 * @throws java.io.IOException if an IOException occurs during
190 * @throws org.exolab.castor.xml.ValidationException if this
191 * object is an invalid instance according to the schema
192 * @throws org.exolab.castor.xml.MarshalException if object is
193 * null or if any SAXException is thrown during marshaling
196 final org.xml.sax.ContentHandler handler)
197 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
198 Marshaller.marshal(this, handler);
203 public void removeAllStructureState(
205 this._structureStateList.clear();
209 * Method removeStructureState.
211 * @param vStructureState
212 * @return true if the object was removed from the collection.
214 public boolean removeStructureState(
215 final jalview.schemabinding.version2.StructureState vStructureState) {
216 boolean removed = _structureStateList.remove(vStructureState);
221 * Method removeStructureStateAt.
224 * @return the element removed from the collection
226 public jalview.schemabinding.version2.StructureState removeStructureStateAt(
228 java.lang.Object obj = this._structureStateList.remove(index);
229 return (jalview.schemabinding.version2.StructureState) obj;
236 * @param vStructureState
237 * @throws java.lang.IndexOutOfBoundsException if the index
238 * given is outside the bounds of the collection
240 public void setStructureState(
242 final jalview.schemabinding.version2.StructureState vStructureState)
243 throws java.lang.IndexOutOfBoundsException {
244 // check bounds for index
245 if (index < 0 || index >= this._structureStateList.size()) {
246 throw new IndexOutOfBoundsException("setStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]");
249 this._structureStateList.set(index, vStructureState);
255 * @param vStructureStateArray
257 public void setStructureState(
258 final jalview.schemabinding.version2.StructureState[] vStructureStateArray) {
260 _structureStateList.clear();
262 for (int i = 0; i < vStructureStateArray.length; i++) {
263 this._structureStateList.add(vStructureStateArray[i]);
271 * @throws org.exolab.castor.xml.MarshalException if object is
272 * null or if any SAXException is thrown during marshaling
273 * @throws org.exolab.castor.xml.ValidationException if this
274 * object is an invalid instance according to the schema
275 * @return the unmarshaled
276 * jalview.schemabinding.version2.Pdbentry
278 public static jalview.schemabinding.version2.Pdbentry unmarshal(
279 final java.io.Reader reader)
280 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
281 return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbids.class, reader);
287 * @throws org.exolab.castor.xml.ValidationException if this
288 * object is an invalid instance according to the schema
290 public void validate(
292 throws org.exolab.castor.xml.ValidationException {
293 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
294 validator.validate(this);