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