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