jalview XML schema update for 2.4.1 (or 2.5?) introducing IDs for views and treepanel...
[jalview.git] / src / jalview / schemabinding / version2 / Pdbentry.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 Pdbentry.\r
19  * \r
20  * @version $Revision$ $Date$\r
21  */\r
22 public class Pdbentry implements java.io.Serializable {\r
23 \r
24 \r
25       //--------------------------/\r
26      //- Class/Member Variables -/\r
27     //--------------------------/\r
28 \r
29     /**\r
30      * Field _id.\r
31      */\r
32     private java.lang.String _id;\r
33 \r
34     /**\r
35      * Field _type.\r
36      */\r
37     private java.lang.String _type;\r
38 \r
39     /**\r
40      * Field _file.\r
41      */\r
42     private java.lang.String _file;\r
43 \r
44     /**\r
45      * Field _items.\r
46      */\r
47     private java.util.Vector _items;\r
48 \r
49 \r
50       //----------------/\r
51      //- Constructors -/\r
52     //----------------/\r
53 \r
54     public Pdbentry() {\r
55         super();\r
56         this._items = new java.util.Vector();\r
57     }\r
58 \r
59 \r
60       //-----------/\r
61      //- Methods -/\r
62     //-----------/\r
63 \r
64     /**\r
65      * \r
66      * \r
67      * @param vPdbentryItem\r
68      * @throws java.lang.IndexOutOfBoundsException if the index\r
69      * given is outside the bounds of the collection\r
70      */\r
71     public void addPdbentryItem(\r
72             final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)\r
73     throws java.lang.IndexOutOfBoundsException {\r
74         this._items.addElement(vPdbentryItem);\r
75     }\r
76 \r
77     /**\r
78      * \r
79      * \r
80      * @param index\r
81      * @param vPdbentryItem\r
82      * @throws java.lang.IndexOutOfBoundsException if the index\r
83      * given is outside the bounds of the collection\r
84      */\r
85     public void addPdbentryItem(\r
86             final int index,\r
87             final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)\r
88     throws java.lang.IndexOutOfBoundsException {\r
89         this._items.add(index, vPdbentryItem);\r
90     }\r
91 \r
92     /**\r
93      * Method enumeratePdbentryItem.\r
94      * \r
95      * @return an Enumeration over all\r
96      * jalview.schemabinding.version2.PdbentryItem elements\r
97      */\r
98     public java.util.Enumeration enumeratePdbentryItem(\r
99     ) {\r
100         return this._items.elements();\r
101     }\r
102 \r
103     /**\r
104      * Returns the value of field 'file'.\r
105      * \r
106      * @return the value of field 'File'.\r
107      */\r
108     public java.lang.String getFile(\r
109     ) {\r
110         return this._file;\r
111     }\r
112 \r
113     /**\r
114      * Returns the value of field 'id'.\r
115      * \r
116      * @return the value of field 'Id'.\r
117      */\r
118     public java.lang.String getId(\r
119     ) {\r
120         return this._id;\r
121     }\r
122 \r
123     /**\r
124      * Method getPdbentryItem.\r
125      * \r
126      * @param index\r
127      * @throws java.lang.IndexOutOfBoundsException if the index\r
128      * given is outside the bounds of the collection\r
129      * @return the value of the\r
130      * jalview.schemabinding.version2.PdbentryItem at the given inde\r
131      */\r
132     public jalview.schemabinding.version2.PdbentryItem getPdbentryItem(\r
133             final int index)\r
134     throws java.lang.IndexOutOfBoundsException {\r
135         // check bounds for index\r
136         if (index < 0 || index >= this._items.size()) {\r
137             throw new IndexOutOfBoundsException("getPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]");\r
138         }\r
139         \r
140         return (jalview.schemabinding.version2.PdbentryItem) _items.get(index);\r
141     }\r
142 \r
143     /**\r
144      * Method getPdbentryItem.Returns the contents of the\r
145      * collection in an Array.  <p>Note:  Just in case the\r
146      * collection contents are changing in another thread, we pass\r
147      * a 0-length Array of the correct type into the API call. \r
148      * This way we <i>know</i> that the Array returned is of\r
149      * exactly the correct length.\r
150      * \r
151      * @return this collection as an Array\r
152      */\r
153     public jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem(\r
154     ) {\r
155         jalview.schemabinding.version2.PdbentryItem[] array = new jalview.schemabinding.version2.PdbentryItem[0];\r
156         return (jalview.schemabinding.version2.PdbentryItem[]) this._items.toArray(array);\r
157     }\r
158 \r
159     /**\r
160      * Method getPdbentryItemCount.\r
161      * \r
162      * @return the size of this collection\r
163      */\r
164     public int getPdbentryItemCount(\r
165     ) {\r
166         return this._items.size();\r
167     }\r
168 \r
169     /**\r
170      * Returns the value of field 'type'.\r
171      * \r
172      * @return the value of field 'Type'.\r
173      */\r
174     public java.lang.String getType(\r
175     ) {\r
176         return this._type;\r
177     }\r
178 \r
179     /**\r
180      * Method isValid.\r
181      * \r
182      * @return true if this object is valid according to the schema\r
183      */\r
184     public boolean isValid(\r
185     ) {\r
186         try {\r
187             validate();\r
188         } catch (org.exolab.castor.xml.ValidationException vex) {\r
189             return false;\r
190         }\r
191         return true;\r
192     }\r
193 \r
194     /**\r
195      * \r
196      * \r
197      * @param out\r
198      * @throws org.exolab.castor.xml.MarshalException if object is\r
199      * null or if any SAXException is thrown during marshaling\r
200      * @throws org.exolab.castor.xml.ValidationException if this\r
201      * object is an invalid instance according to the schema\r
202      */\r
203     public void marshal(\r
204             final java.io.Writer out)\r
205     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
206         Marshaller.marshal(this, out);\r
207     }\r
208 \r
209     /**\r
210      * \r
211      * \r
212      * @param handler\r
213      * @throws java.io.IOException if an IOException occurs during\r
214      * marshaling\r
215      * @throws org.exolab.castor.xml.ValidationException if this\r
216      * object is an invalid instance according to the schema\r
217      * @throws org.exolab.castor.xml.MarshalException if object is\r
218      * null or if any SAXException is thrown during marshaling\r
219      */\r
220     public void marshal(\r
221             final org.xml.sax.ContentHandler handler)\r
222     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
223         Marshaller.marshal(this, handler);\r
224     }\r
225 \r
226     /**\r
227      */\r
228     public void removeAllPdbentryItem(\r
229     ) {\r
230         this._items.clear();\r
231     }\r
232 \r
233     /**\r
234      * Method removePdbentryItem.\r
235      * \r
236      * @param vPdbentryItem\r
237      * @return true if the object was removed from the collection.\r
238      */\r
239     public boolean removePdbentryItem(\r
240             final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) {\r
241         boolean removed = _items.remove(vPdbentryItem);\r
242         return removed;\r
243     }\r
244 \r
245     /**\r
246      * Method removePdbentryItemAt.\r
247      * \r
248      * @param index\r
249      * @return the element removed from the collection\r
250      */\r
251     public jalview.schemabinding.version2.PdbentryItem removePdbentryItemAt(\r
252             final int index) {\r
253         java.lang.Object obj = this._items.remove(index);\r
254         return (jalview.schemabinding.version2.PdbentryItem) obj;\r
255     }\r
256 \r
257     /**\r
258      * Sets the value of field 'file'.\r
259      * \r
260      * @param file the value of field 'file'.\r
261      */\r
262     public void setFile(\r
263             final java.lang.String file) {\r
264         this._file = file;\r
265     }\r
266 \r
267     /**\r
268      * Sets the value of field 'id'.\r
269      * \r
270      * @param id the value of field 'id'.\r
271      */\r
272     public void setId(\r
273             final java.lang.String id) {\r
274         this._id = id;\r
275     }\r
276 \r
277     /**\r
278      * \r
279      * \r
280      * @param index\r
281      * @param vPdbentryItem\r
282      * @throws java.lang.IndexOutOfBoundsException if the index\r
283      * given is outside the bounds of the collection\r
284      */\r
285     public void setPdbentryItem(\r
286             final int index,\r
287             final jalview.schemabinding.version2.PdbentryItem vPdbentryItem)\r
288     throws java.lang.IndexOutOfBoundsException {\r
289         // check bounds for index\r
290         if (index < 0 || index >= this._items.size()) {\r
291             throw new IndexOutOfBoundsException("setPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]");\r
292         }\r
293         \r
294         this._items.set(index, vPdbentryItem);\r
295     }\r
296 \r
297     /**\r
298      * \r
299      * \r
300      * @param vPdbentryItemArray\r
301      */\r
302     public void setPdbentryItem(\r
303             final jalview.schemabinding.version2.PdbentryItem[] vPdbentryItemArray) {\r
304         //-- copy array\r
305         _items.clear();\r
306         \r
307         for (int i = 0; i < vPdbentryItemArray.length; i++) {\r
308                 this._items.add(vPdbentryItemArray[i]);\r
309         }\r
310     }\r
311 \r
312     /**\r
313      * Sets the value of field 'type'.\r
314      * \r
315      * @param type the value of field 'type'.\r
316      */\r
317     public void setType(\r
318             final java.lang.String type) {\r
319         this._type = type;\r
320     }\r
321 \r
322     /**\r
323      * Method unmarshal.\r
324      * \r
325      * @param reader\r
326      * @throws org.exolab.castor.xml.MarshalException if object is\r
327      * null or if any SAXException is thrown during marshaling\r
328      * @throws org.exolab.castor.xml.ValidationException if this\r
329      * object is an invalid instance according to the schema\r
330      * @return the unmarshaled\r
331      * jalview.schemabinding.version2.Pdbentry\r
332      */\r
333     public static jalview.schemabinding.version2.Pdbentry unmarshal(\r
334             final java.io.Reader reader)\r
335     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
336         return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbentry.class, reader);\r
337     }\r
338 \r
339     /**\r
340      * \r
341      * \r
342      * @throws org.exolab.castor.xml.ValidationException if this\r
343      * object is an invalid instance according to the schema\r
344      */\r
345     public void validate(\r
346     )\r
347     throws org.exolab.castor.xml.ValidationException {\r
348         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
349         validator.validate(this);\r
350     }\r
351 \r
352 }\r