2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
8 package jalview.binding;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\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
28 * Class JalviewState.
\r
30 * @version $Revision$ $Date$
\r
32 public class JalviewState implements java.io.Serializable {
\r
35 //--------------------------/
\r
36 //- Class/Member Variables -/
\r
37 //--------------------------/
\r
40 * Field _creationDate
\r
42 private java.util.Date _creationDate;
\r
47 private java.util.Vector _fileList;
\r
54 public JalviewState() {
\r
56 _fileList = new Vector();
\r
57 } //-- jalview.binding.JalviewState()
\r
71 public void addFile(java.lang.String vFile)
\r
72 throws java.lang.IndexOutOfBoundsException
\r
74 _fileList.addElement(vFile);
\r
75 } //-- void addFile(java.lang.String)
\r
85 public void addFile(int index, java.lang.String vFile)
\r
86 throws java.lang.IndexOutOfBoundsException
\r
88 _fileList.insertElementAt(vFile, index);
\r
89 } //-- void addFile(int, java.lang.String)
\r
92 * Method enumerateFile
\r
96 * @return Enumeration
\r
98 public java.util.Enumeration enumerateFile()
\r
100 return _fileList.elements();
\r
101 } //-- java.util.Enumeration enumerateFile()
\r
104 * Returns the value of field 'creationDate'.
\r
107 * @return the value of field 'creationDate'.
\r
109 public java.util.Date getCreationDate()
\r
111 return this._creationDate;
\r
112 } //-- java.util.Date getCreationDate()
\r
122 public java.lang.String getFile(int index)
\r
123 throws java.lang.IndexOutOfBoundsException
\r
125 //-- check bounds for index
\r
126 if ((index < 0) || (index > _fileList.size())) {
\r
127 throw new IndexOutOfBoundsException();
\r
130 return (String)_fileList.elementAt(index);
\r
131 } //-- java.lang.String getFile(int)
\r
140 public java.lang.String[] getFile()
\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
148 } //-- java.lang.String[] getFile()
\r
151 * Method getFileCount
\r
157 public int getFileCount()
\r
159 return _fileList.size();
\r
160 } //-- int getFileCount()
\r
169 public boolean isValid()
\r
174 catch (org.exolab.castor.xml.ValidationException vex) {
\r
178 } //-- boolean isValid()
\r
187 public void marshal(java.io.Writer out)
\r
188 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
191 Marshaller.marshal(this, out);
\r
192 } //-- void marshal(java.io.Writer)
\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
205 Marshaller.marshal(this, handler);
\r
206 } //-- void marshal(org.xml.sax.ContentHandler)
\r
209 * Method removeAllFile
\r
212 public void removeAllFile()
\r
214 _fileList.removeAllElements();
\r
215 } //-- void removeAllFile()
\r
218 * Method removeFile
\r
225 public java.lang.String removeFile(int index)
\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
233 * Sets the value of field 'creationDate'.
\r
235 * @param creationDate the value of field 'creationDate'.
\r
237 public void setCreationDate(java.util.Date creationDate)
\r
239 this._creationDate = creationDate;
\r
240 } //-- void setCreationDate(java.util.Date)
\r
250 public void setFile(int index, java.lang.String vFile)
\r
251 throws java.lang.IndexOutOfBoundsException
\r
253 //-- check bounds for index
\r
254 if ((index < 0) || (index > _fileList.size())) {
\r
255 throw new IndexOutOfBoundsException();
\r
257 _fileList.setElementAt(vFile, index);
\r
258 } //-- void setFile(int, java.lang.String)
\r
267 public void setFile(java.lang.String[] fileArray)
\r
270 _fileList.removeAllElements();
\r
271 for (int i = 0; i < fileArray.length; i++) {
\r
272 _fileList.addElement(fileArray[i]);
\r
274 } //-- void setFile(java.lang.String)
\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
287 return (jalview.binding.JalviewState) Unmarshaller.unmarshal(jalview.binding.JalviewState.class, reader);
\r
288 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
294 public void validate()
\r
295 throws org.exolab.castor.xml.ValidationException
\r
297 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
298 validator.validate(this);
\r
299 } //-- void validate()
\r