04685b9fe3536bdb7728a248f74d114a2fac4a98
[jalview.git] / src / jalview / schemabinding / version2 / Pdbids.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package jalview.schemabinding.version2;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import org.exolab.castor.xml.Marshaller;\r
15 import org.exolab.castor.xml.Unmarshaller;\r
16 \r
17 /**\r
18  * Class Pdbids.\r
19  * \r
20  * @version $Revision$ $Date$\r
21  */\r
22 public class Pdbids extends jalview.schemabinding.version2.Pdbentry \r
23 implements java.io.Serializable\r
24 {\r
25 \r
26 \r
27       //--------------------------/\r
28      //- Class/Member Variables -/\r
29     //--------------------------/\r
30 \r
31     /**\r
32      * Field _structureStateList.\r
33      */\r
34     private java.util.Vector _structureStateList;\r
35 \r
36 \r
37       //----------------/\r
38      //- Constructors -/\r
39     //----------------/\r
40 \r
41     public Pdbids() {\r
42         super();\r
43         this._structureStateList = new java.util.Vector();\r
44     }\r
45 \r
46 \r
47       //-----------/\r
48      //- Methods -/\r
49     //-----------/\r
50 \r
51     /**\r
52      * \r
53      * \r
54      * @param vStructureState\r
55      * @throws java.lang.IndexOutOfBoundsException if the index\r
56      * given is outside the bounds of the collection\r
57      */\r
58     public void addStructureState(\r
59             final jalview.schemabinding.version2.StructureState vStructureState)\r
60     throws java.lang.IndexOutOfBoundsException {\r
61         this._structureStateList.addElement(vStructureState);\r
62     }\r
63 \r
64     /**\r
65      * \r
66      * \r
67      * @param index\r
68      * @param vStructureState\r
69      * @throws java.lang.IndexOutOfBoundsException if the index\r
70      * given is outside the bounds of the collection\r
71      */\r
72     public void addStructureState(\r
73             final int index,\r
74             final jalview.schemabinding.version2.StructureState vStructureState)\r
75     throws java.lang.IndexOutOfBoundsException {\r
76         this._structureStateList.add(index, vStructureState);\r
77     }\r
78 \r
79     /**\r
80      * Method enumerateStructureState.\r
81      * \r
82      * @return an Enumeration over all\r
83      * jalview.schemabinding.version2.StructureState elements\r
84      */\r
85     public java.util.Enumeration enumerateStructureState(\r
86     ) {\r
87         return this._structureStateList.elements();\r
88     }\r
89 \r
90     /**\r
91      * Method getStructureState.\r
92      * \r
93      * @param index\r
94      * @throws java.lang.IndexOutOfBoundsException if the index\r
95      * given is outside the bounds of the collection\r
96      * @return the value of the\r
97      * jalview.schemabinding.version2.StructureState at the given\r
98      * index\r
99      */\r
100     public jalview.schemabinding.version2.StructureState getStructureState(\r
101             final int index)\r
102     throws java.lang.IndexOutOfBoundsException {\r
103         // check bounds for index\r
104         if (index < 0 || index >= this._structureStateList.size()) {\r
105             throw new IndexOutOfBoundsException("getStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]");\r
106         }\r
107         \r
108         return (jalview.schemabinding.version2.StructureState) _structureStateList.get(index);\r
109     }\r
110 \r
111     /**\r
112      * Method getStructureState.Returns the contents of the\r
113      * collection in an Array.  <p>Note:  Just in case the\r
114      * collection contents are changing in another thread, we pass\r
115      * a 0-length Array of the correct type into the API call. \r
116      * This way we <i>know</i> that the Array returned is of\r
117      * exactly the correct length.\r
118      * \r
119      * @return this collection as an Array\r
120      */\r
121     public jalview.schemabinding.version2.StructureState[] getStructureState(\r
122     ) {\r
123         jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0];\r
124         return (jalview.schemabinding.version2.StructureState[]) this._structureStateList.toArray(array);\r
125     }\r
126 \r
127     /**\r
128      * Method getStructureStateCount.\r
129      * \r
130      * @return the size of this collection\r
131      */\r
132     public int getStructureStateCount(\r
133     ) {\r
134         return this._structureStateList.size();\r
135     }\r
136 \r
137     /**\r
138      * Method isValid.\r
139      * \r
140      * @return true if this object is valid according to the schema\r
141      */\r
142     public boolean isValid(\r
143     ) {\r
144         try {\r
145             validate();\r
146         } catch (org.exolab.castor.xml.ValidationException vex) {\r
147             return false;\r
148         }\r
149         return true;\r
150     }\r
151 \r
152     /**\r
153      * \r
154      * \r
155      * @param out\r
156      * @throws org.exolab.castor.xml.MarshalException if object is\r
157      * null or if any SAXException is thrown during marshaling\r
158      * @throws org.exolab.castor.xml.ValidationException if this\r
159      * object is an invalid instance according to the schema\r
160      */\r
161     public void marshal(\r
162             final java.io.Writer out)\r
163     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
164         Marshaller.marshal(this, out);\r
165     }\r
166 \r
167     /**\r
168      * \r
169      * \r
170      * @param handler\r
171      * @throws java.io.IOException if an IOException occurs during\r
172      * marshaling\r
173      * @throws org.exolab.castor.xml.ValidationException if this\r
174      * object is an invalid instance according to the schema\r
175      * @throws org.exolab.castor.xml.MarshalException if object is\r
176      * null or if any SAXException is thrown during marshaling\r
177      */\r
178     public void marshal(\r
179             final org.xml.sax.ContentHandler handler)\r
180     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
181         Marshaller.marshal(this, handler);\r
182     }\r
183 \r
184     /**\r
185      */\r
186     public void removeAllStructureState(\r
187     ) {\r
188         this._structureStateList.clear();\r
189     }\r
190 \r
191     /**\r
192      * Method removeStructureState.\r
193      * \r
194      * @param vStructureState\r
195      * @return true if the object was removed from the collection.\r
196      */\r
197     public boolean removeStructureState(\r
198             final jalview.schemabinding.version2.StructureState vStructureState) {\r
199         boolean removed = _structureStateList.remove(vStructureState);\r
200         return removed;\r
201     }\r
202 \r
203     /**\r
204      * Method removeStructureStateAt.\r
205      * \r
206      * @param index\r
207      * @return the element removed from the collection\r
208      */\r
209     public jalview.schemabinding.version2.StructureState removeStructureStateAt(\r
210             final int index) {\r
211         java.lang.Object obj = this._structureStateList.remove(index);\r
212         return (jalview.schemabinding.version2.StructureState) obj;\r
213     }\r
214 \r
215     /**\r
216      * \r
217      * \r
218      * @param index\r
219      * @param vStructureState\r
220      * @throws java.lang.IndexOutOfBoundsException if the index\r
221      * given is outside the bounds of the collection\r
222      */\r
223     public void setStructureState(\r
224             final int index,\r
225             final jalview.schemabinding.version2.StructureState vStructureState)\r
226     throws java.lang.IndexOutOfBoundsException {\r
227         // check bounds for index\r
228         if (index < 0 || index >= this._structureStateList.size()) {\r
229             throw new IndexOutOfBoundsException("setStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]");\r
230         }\r
231         \r
232         this._structureStateList.set(index, vStructureState);\r
233     }\r
234 \r
235     /**\r
236      * \r
237      * \r
238      * @param vStructureStateArray\r
239      */\r
240     public void setStructureState(\r
241             final jalview.schemabinding.version2.StructureState[] vStructureStateArray) {\r
242         //-- copy array\r
243         _structureStateList.clear();\r
244         \r
245         for (int i = 0; i < vStructureStateArray.length; i++) {\r
246                 this._structureStateList.add(vStructureStateArray[i]);\r
247         }\r
248     }\r
249 \r
250     /**\r
251      * Method unmarshal.\r
252      * \r
253      * @param reader\r
254      * @throws org.exolab.castor.xml.MarshalException if object is\r
255      * null or if any SAXException is thrown during marshaling\r
256      * @throws org.exolab.castor.xml.ValidationException if this\r
257      * object is an invalid instance according to the schema\r
258      * @return the unmarshaled\r
259      * jalview.schemabinding.version2.Pdbentry\r
260      */\r
261     public static jalview.schemabinding.version2.Pdbentry unmarshal(\r
262             final java.io.Reader reader)\r
263     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
264         return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbids.class, reader);\r
265     }\r
266 \r
267     /**\r
268      * \r
269      * \r
270      * @throws org.exolab.castor.xml.ValidationException if this\r
271      * object is an invalid instance according to the schema\r
272      */\r
273     public void validate(\r
274     )\r
275     throws org.exolab.castor.xml.ValidationException {\r
276         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
277         validator.validate(this);\r
278     }\r
279 \r
280 }\r