5266b990ca9ed8b861f9ba74e6858be445c9b6fa
[jalview.git] / src / jalview / schemabinding / version2 / Pdbids.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 Pdbids.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class Pdbids extends jalview.schemabinding.version2.Pdbentry 
23 implements java.io.Serializable
24 {
25
26
27       //--------------------------/
28      //- Class/Member Variables -/
29     //--------------------------/
30
31     /**
32      * Field _structureStateList.
33      */
34     private java.util.Vector _structureStateList;
35
36
37       //----------------/
38      //- Constructors -/
39     //----------------/
40
41     public Pdbids() {
42         super();
43         this._structureStateList = new java.util.Vector();
44     }
45
46
47       //-----------/
48      //- Methods -/
49     //-----------/
50
51     /**
52      * 
53      * 
54      * @param vStructureState
55      * @throws java.lang.IndexOutOfBoundsException if the index
56      * given is outside the bounds of the collection
57      */
58     public void addStructureState(
59             final jalview.schemabinding.version2.StructureState vStructureState)
60     throws java.lang.IndexOutOfBoundsException {
61         this._structureStateList.addElement(vStructureState);
62     }
63
64     /**
65      * 
66      * 
67      * @param index
68      * @param vStructureState
69      * @throws java.lang.IndexOutOfBoundsException if the index
70      * given is outside the bounds of the collection
71      */
72     public void addStructureState(
73             final int index,
74             final jalview.schemabinding.version2.StructureState vStructureState)
75     throws java.lang.IndexOutOfBoundsException {
76         this._structureStateList.add(index, vStructureState);
77     }
78
79     /**
80      * Method enumerateStructureState.
81      * 
82      * @return an Enumeration over all
83      * jalview.schemabinding.version2.StructureState elements
84      */
85     public java.util.Enumeration enumerateStructureState(
86     ) {
87         return this._structureStateList.elements();
88     }
89
90     /**
91      * Method getStructureState.
92      * 
93      * @param index
94      * @throws java.lang.IndexOutOfBoundsException if the index
95      * given is outside the bounds of the collection
96      * @return the value of the
97      * jalview.schemabinding.version2.StructureState at the given
98      * index
99      */
100     public jalview.schemabinding.version2.StructureState getStructureState(
101             final int index)
102     throws java.lang.IndexOutOfBoundsException {
103         // check bounds for index
104         if (index < 0 || index >= this._structureStateList.size()) {
105             throw new IndexOutOfBoundsException("getStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]");
106         }
107         
108         return (jalview.schemabinding.version2.StructureState) _structureStateList.get(index);
109     }
110
111     /**
112      * Method getStructureState.Returns the contents of the
113      * collection in an Array.  <p>Note:  Just in case the
114      * collection contents are changing in another thread, we pass
115      * a 0-length Array of the correct type into the API call. 
116      * This way we <i>know</i> that the Array returned is of
117      * exactly the correct length.
118      * 
119      * @return this collection as an Array
120      */
121     public jalview.schemabinding.version2.StructureState[] getStructureState(
122     ) {
123         jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0];
124         return (jalview.schemabinding.version2.StructureState[]) this._structureStateList.toArray(array);
125     }
126
127     /**
128      * Method getStructureStateCount.
129      * 
130      * @return the size of this collection
131      */
132     public int getStructureStateCount(
133     ) {
134         return this._structureStateList.size();
135     }
136
137     /**
138      * Method isValid.
139      * 
140      * @return true if this object is valid according to the schema
141      */
142     public boolean isValid(
143     ) {
144         try {
145             validate();
146         } catch (org.exolab.castor.xml.ValidationException vex) {
147             return false;
148         }
149         return true;
150     }
151
152     /**
153      * 
154      * 
155      * @param out
156      * @throws org.exolab.castor.xml.MarshalException if object is
157      * null or if any SAXException is thrown during marshaling
158      * @throws org.exolab.castor.xml.ValidationException if this
159      * object is an invalid instance according to the schema
160      */
161     public void marshal(
162             final java.io.Writer out)
163     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
164         Marshaller.marshal(this, out);
165     }
166
167     /**
168      * 
169      * 
170      * @param handler
171      * @throws java.io.IOException if an IOException occurs during
172      * marshaling
173      * @throws org.exolab.castor.xml.ValidationException if this
174      * object is an invalid instance according to the schema
175      * @throws org.exolab.castor.xml.MarshalException if object is
176      * null or if any SAXException is thrown during marshaling
177      */
178     public void marshal(
179             final org.xml.sax.ContentHandler handler)
180     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
181         Marshaller.marshal(this, handler);
182     }
183
184     /**
185      */
186     public void removeAllStructureState(
187     ) {
188         this._structureStateList.clear();
189     }
190
191     /**
192      * Method removeStructureState.
193      * 
194      * @param vStructureState
195      * @return true if the object was removed from the collection.
196      */
197     public boolean removeStructureState(
198             final jalview.schemabinding.version2.StructureState vStructureState) {
199         boolean removed = _structureStateList.remove(vStructureState);
200         return removed;
201     }
202
203     /**
204      * Method removeStructureStateAt.
205      * 
206      * @param index
207      * @return the element removed from the collection
208      */
209     public jalview.schemabinding.version2.StructureState removeStructureStateAt(
210             final int index) {
211         java.lang.Object obj = this._structureStateList.remove(index);
212         return (jalview.schemabinding.version2.StructureState) obj;
213     }
214
215     /**
216      * 
217      * 
218      * @param index
219      * @param vStructureState
220      * @throws java.lang.IndexOutOfBoundsException if the index
221      * given is outside the bounds of the collection
222      */
223     public void setStructureState(
224             final int index,
225             final jalview.schemabinding.version2.StructureState vStructureState)
226     throws java.lang.IndexOutOfBoundsException {
227         // check bounds for index
228         if (index < 0 || index >= this._structureStateList.size()) {
229             throw new IndexOutOfBoundsException("setStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]");
230         }
231         
232         this._structureStateList.set(index, vStructureState);
233     }
234
235     /**
236      * 
237      * 
238      * @param vStructureStateArray
239      */
240     public void setStructureState(
241             final jalview.schemabinding.version2.StructureState[] vStructureStateArray) {
242         //-- copy array
243         _structureStateList.clear();
244         
245         for (int i = 0; i < vStructureStateArray.length; i++) {
246                 this._structureStateList.add(vStructureStateArray[i]);
247         }
248     }
249
250     /**
251      * Method unmarshal.
252      * 
253      * @param reader
254      * @throws org.exolab.castor.xml.MarshalException if object is
255      * null or if any SAXException is thrown during marshaling
256      * @throws org.exolab.castor.xml.ValidationException if this
257      * object is an invalid instance according to the schema
258      * @return the unmarshaled
259      * jalview.schemabinding.version2.Pdbentry
260      */
261     public static jalview.schemabinding.version2.Pdbentry unmarshal(
262             final java.io.Reader reader)
263     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
264         return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbids.class, reader);
265     }
266
267     /**
268      * 
269      * 
270      * @throws org.exolab.castor.xml.ValidationException if this
271      * object is an invalid instance according to the schema
272      */
273     public void validate(
274     )
275     throws org.exolab.castor.xml.ValidationException {
276         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
277         validator.validate(this);
278     }
279
280 }