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