update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / Pdbids.java
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
4  *
5  * This file is part of Jalview.
6  *
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.
10  *
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.
15  *
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  *******************************************************************************/
18 /*
19  * This class was automatically generated with 
20  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
21  * Schema.
22  * $Id$
23  */
24
25 package jalview.schemabinding.version2;
26
27   //---------------------------------/
28  //- Imported classes and packages -/
29 //---------------------------------/
30
31 import org.exolab.castor.xml.Marshaller;
32 import org.exolab.castor.xml.Unmarshaller;
33
34 /**
35  * Class Pdbids.
36  * 
37  * @version $Revision$ $Date$
38  */
39 public class Pdbids extends jalview.schemabinding.version2.Pdbentry 
40 implements java.io.Serializable
41 {
42
43
44       //--------------------------/
45      //- Class/Member Variables -/
46     //--------------------------/
47
48     /**
49      * Field _structureStateList.
50      */
51     private java.util.Vector _structureStateList;
52
53
54       //----------------/
55      //- Constructors -/
56     //----------------/
57
58     public Pdbids() {
59         super();
60         this._structureStateList = new java.util.Vector();
61     }
62
63
64       //-----------/
65      //- Methods -/
66     //-----------/
67
68     /**
69      * 
70      * 
71      * @param vStructureState
72      * @throws java.lang.IndexOutOfBoundsException if the index
73      * given is outside the bounds of the collection
74      */
75     public void addStructureState(
76             final jalview.schemabinding.version2.StructureState vStructureState)
77     throws java.lang.IndexOutOfBoundsException {
78         this._structureStateList.addElement(vStructureState);
79     }
80
81     /**
82      * 
83      * 
84      * @param index
85      * @param vStructureState
86      * @throws java.lang.IndexOutOfBoundsException if the index
87      * given is outside the bounds of the collection
88      */
89     public void addStructureState(
90             final int index,
91             final jalview.schemabinding.version2.StructureState vStructureState)
92     throws java.lang.IndexOutOfBoundsException {
93         this._structureStateList.add(index, vStructureState);
94     }
95
96     /**
97      * Method enumerateStructureState.
98      * 
99      * @return an Enumeration over all
100      * jalview.schemabinding.version2.StructureState elements
101      */
102     public java.util.Enumeration enumerateStructureState(
103     ) {
104         return this._structureStateList.elements();
105     }
106
107     /**
108      * Method getStructureState.
109      * 
110      * @param index
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
115      * index
116      */
117     public jalview.schemabinding.version2.StructureState getStructureState(
118             final int index)
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) + "]");
123         }
124         
125         return (jalview.schemabinding.version2.StructureState) _structureStateList.get(index);
126     }
127
128     /**
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.
135      * 
136      * @return this collection as an Array
137      */
138     public jalview.schemabinding.version2.StructureState[] getStructureState(
139     ) {
140         jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0];
141         return (jalview.schemabinding.version2.StructureState[]) this._structureStateList.toArray(array);
142     }
143
144     /**
145      * Method getStructureStateCount.
146      * 
147      * @return the size of this collection
148      */
149     public int getStructureStateCount(
150     ) {
151         return this._structureStateList.size();
152     }
153
154     /**
155      * Method isValid.
156      * 
157      * @return true if this object is valid according to the schema
158      */
159     public boolean isValid(
160     ) {
161         try {
162             validate();
163         } catch (org.exolab.castor.xml.ValidationException vex) {
164             return false;
165         }
166         return true;
167     }
168
169     /**
170      * 
171      * 
172      * @param out
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
177      */
178     public void marshal(
179             final java.io.Writer out)
180     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
181         Marshaller.marshal(this, out);
182     }
183
184     /**
185      * 
186      * 
187      * @param handler
188      * @throws java.io.IOException if an IOException occurs during
189      * marshaling
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
194      */
195     public void marshal(
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);
199     }
200
201     /**
202      */
203     public void removeAllStructureState(
204     ) {
205         this._structureStateList.clear();
206     }
207
208     /**
209      * Method removeStructureState.
210      * 
211      * @param vStructureState
212      * @return true if the object was removed from the collection.
213      */
214     public boolean removeStructureState(
215             final jalview.schemabinding.version2.StructureState vStructureState) {
216         boolean removed = _structureStateList.remove(vStructureState);
217         return removed;
218     }
219
220     /**
221      * Method removeStructureStateAt.
222      * 
223      * @param index
224      * @return the element removed from the collection
225      */
226     public jalview.schemabinding.version2.StructureState removeStructureStateAt(
227             final int index) {
228         java.lang.Object obj = this._structureStateList.remove(index);
229         return (jalview.schemabinding.version2.StructureState) obj;
230     }
231
232     /**
233      * 
234      * 
235      * @param index
236      * @param vStructureState
237      * @throws java.lang.IndexOutOfBoundsException if the index
238      * given is outside the bounds of the collection
239      */
240     public void setStructureState(
241             final int index,
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) + "]");
247         }
248         
249         this._structureStateList.set(index, vStructureState);
250     }
251
252     /**
253      * 
254      * 
255      * @param vStructureStateArray
256      */
257     public void setStructureState(
258             final jalview.schemabinding.version2.StructureState[] vStructureStateArray) {
259         //-- copy array
260         _structureStateList.clear();
261         
262         for (int i = 0; i < vStructureStateArray.length; i++) {
263                 this._structureStateList.add(vStructureStateArray[i]);
264         }
265     }
266
267     /**
268      * Method unmarshal.
269      * 
270      * @param reader
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
277      */
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);
282     }
283
284     /**
285      * 
286      * 
287      * @throws org.exolab.castor.xml.ValidationException if this
288      * object is an invalid instance according to the schema
289      */
290     public void validate(
291     )
292     throws org.exolab.castor.xml.ValidationException {
293         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
294         validator.validate(this);
295     }
296
297 }