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