usercolourscheme changed
[jalview.git] / src / jalview / binding / JalviewState.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package jalview.binding;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import java.io.IOException;\r
15 import java.io.Reader;\r
16 import java.io.Serializable;\r
17 import java.io.Writer;\r
18 import java.util.Date;\r
19 import java.util.Enumeration;\r
20 import java.util.Vector;\r
21 import org.exolab.castor.xml.MarshalException;\r
22 import org.exolab.castor.xml.Marshaller;\r
23 import org.exolab.castor.xml.Unmarshaller;\r
24 import org.exolab.castor.xml.ValidationException;\r
25 import org.xml.sax.ContentHandler;\r
26 \r
27 /**\r
28  * Class JalviewState.\r
29  * \r
30  * @version $Revision$ $Date$\r
31  */\r
32 public class JalviewState implements java.io.Serializable {\r
33 \r
34 \r
35       //--------------------------/\r
36      //- Class/Member Variables -/\r
37     //--------------------------/\r
38 \r
39     /**\r
40      * Field _creationDate\r
41      */\r
42     private java.util.Date _creationDate;\r
43 \r
44     /**\r
45      * Field _fileList\r
46      */\r
47     private java.util.Vector _fileList;\r
48 \r
49 \r
50       //----------------/\r
51      //- Constructors -/\r
52     //----------------/\r
53 \r
54     public JalviewState() {\r
55         super();\r
56         _fileList = new Vector();\r
57     } //-- jalview.binding.JalviewState()\r
58 \r
59 \r
60       //-----------/\r
61      //- Methods -/\r
62     //-----------/\r
63 \r
64     /**\r
65      * Method addFile\r
66      * \r
67      * \r
68      * \r
69      * @param vFile\r
70      */\r
71     public void addFile(java.lang.String vFile)\r
72         throws java.lang.IndexOutOfBoundsException\r
73     {\r
74         _fileList.addElement(vFile);\r
75     } //-- void addFile(java.lang.String) \r
76 \r
77     /**\r
78      * Method addFile\r
79      * \r
80      * \r
81      * \r
82      * @param index\r
83      * @param vFile\r
84      */\r
85     public void addFile(int index, java.lang.String vFile)\r
86         throws java.lang.IndexOutOfBoundsException\r
87     {\r
88         _fileList.insertElementAt(vFile, index);\r
89     } //-- void addFile(int, java.lang.String) \r
90 \r
91     /**\r
92      * Method enumerateFile\r
93      * \r
94      * \r
95      * \r
96      * @return Enumeration\r
97      */\r
98     public java.util.Enumeration enumerateFile()\r
99     {\r
100         return _fileList.elements();\r
101     } //-- java.util.Enumeration enumerateFile() \r
102 \r
103     /**\r
104      * Returns the value of field 'creationDate'.\r
105      * \r
106      * @return Date\r
107      * @return the value of field 'creationDate'.\r
108      */\r
109     public java.util.Date getCreationDate()\r
110     {\r
111         return this._creationDate;\r
112     } //-- java.util.Date getCreationDate() \r
113 \r
114     /**\r
115      * Method getFile\r
116      * \r
117      * \r
118      * \r
119      * @param index\r
120      * @return String\r
121      */\r
122     public java.lang.String getFile(int index)\r
123         throws java.lang.IndexOutOfBoundsException\r
124     {\r
125         //-- check bounds for index\r
126         if ((index < 0) || (index > _fileList.size())) {\r
127             throw new IndexOutOfBoundsException();\r
128         }\r
129         \r
130         return (String)_fileList.elementAt(index);\r
131     } //-- java.lang.String getFile(int) \r
132 \r
133     /**\r
134      * Method getFile\r
135      * \r
136      * \r
137      * \r
138      * @return String\r
139      */\r
140     public java.lang.String[] getFile()\r
141     {\r
142         int size = _fileList.size();\r
143         java.lang.String[] mArray = new java.lang.String[size];\r
144         for (int index = 0; index < size; index++) {\r
145             mArray[index] = (String)_fileList.elementAt(index);\r
146         }\r
147         return mArray;\r
148     } //-- java.lang.String[] getFile() \r
149 \r
150     /**\r
151      * Method getFileCount\r
152      * \r
153      * \r
154      * \r
155      * @return int\r
156      */\r
157     public int getFileCount()\r
158     {\r
159         return _fileList.size();\r
160     } //-- int getFileCount() \r
161 \r
162     /**\r
163      * Method isValid\r
164      * \r
165      * \r
166      * \r
167      * @return boolean\r
168      */\r
169     public boolean isValid()\r
170     {\r
171         try {\r
172             validate();\r
173         }\r
174         catch (org.exolab.castor.xml.ValidationException vex) {\r
175             return false;\r
176         }\r
177         return true;\r
178     } //-- boolean isValid() \r
179 \r
180     /**\r
181      * Method marshal\r
182      * \r
183      * \r
184      * \r
185      * @param out\r
186      */\r
187     public void marshal(java.io.Writer out)\r
188         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
189     {\r
190         \r
191         Marshaller.marshal(this, out);\r
192     } //-- void marshal(java.io.Writer) \r
193 \r
194     /**\r
195      * Method marshal\r
196      * \r
197      * \r
198      * \r
199      * @param handler\r
200      */\r
201     public void marshal(org.xml.sax.ContentHandler handler)\r
202         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
203     {\r
204         \r
205         Marshaller.marshal(this, handler);\r
206     } //-- void marshal(org.xml.sax.ContentHandler) \r
207 \r
208     /**\r
209      * Method removeAllFile\r
210      * \r
211      */\r
212     public void removeAllFile()\r
213     {\r
214         _fileList.removeAllElements();\r
215     } //-- void removeAllFile() \r
216 \r
217     /**\r
218      * Method removeFile\r
219      * \r
220      * \r
221      * \r
222      * @param index\r
223      * @return String\r
224      */\r
225     public java.lang.String removeFile(int index)\r
226     {\r
227         java.lang.Object obj = _fileList.elementAt(index);\r
228         _fileList.removeElementAt(index);\r
229         return (String)obj;\r
230     } //-- java.lang.String removeFile(int) \r
231 \r
232     /**\r
233      * Sets the value of field 'creationDate'.\r
234      * \r
235      * @param creationDate the value of field 'creationDate'.\r
236      */\r
237     public void setCreationDate(java.util.Date creationDate)\r
238     {\r
239         this._creationDate = creationDate;\r
240     } //-- void setCreationDate(java.util.Date) \r
241 \r
242     /**\r
243      * Method setFile\r
244      * \r
245      * \r
246      * \r
247      * @param index\r
248      * @param vFile\r
249      */\r
250     public void setFile(int index, java.lang.String vFile)\r
251         throws java.lang.IndexOutOfBoundsException\r
252     {\r
253         //-- check bounds for index\r
254         if ((index < 0) || (index > _fileList.size())) {\r
255             throw new IndexOutOfBoundsException();\r
256         }\r
257         _fileList.setElementAt(vFile, index);\r
258     } //-- void setFile(int, java.lang.String) \r
259 \r
260     /**\r
261      * Method setFile\r
262      * \r
263      * \r
264      * \r
265      * @param fileArray\r
266      */\r
267     public void setFile(java.lang.String[] fileArray)\r
268     {\r
269         //-- copy array\r
270         _fileList.removeAllElements();\r
271         for (int i = 0; i < fileArray.length; i++) {\r
272             _fileList.addElement(fileArray[i]);\r
273         }\r
274     } //-- void setFile(java.lang.String) \r
275 \r
276     /**\r
277      * Method unmarshal\r
278      * \r
279      * \r
280      * \r
281      * @param reader\r
282      * @return Object\r
283      */\r
284     public static java.lang.Object unmarshal(java.io.Reader reader)\r
285         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
286     {\r
287         return (jalview.binding.JalviewState) Unmarshaller.unmarshal(jalview.binding.JalviewState.class, reader);\r
288     } //-- java.lang.Object unmarshal(java.io.Reader) \r
289 \r
290     /**\r
291      * Method validate\r
292      * \r
293      */\r
294     public void validate()\r
295         throws org.exolab.castor.xml.ValidationException\r
296     {\r
297         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
298         validator.validate(this);\r
299     } //-- void validate() \r
300 \r
301 }\r