/* * This class was automatically generated with * Castor 0.9.6, using an XML * Schema. * $Id$ */ package jalview.binding; //---------------------------------/ //- Imported classes and packages -/ //---------------------------------/ import java.io.IOException; import java.io.Reader; import java.io.Serializable; import java.io.Writer; import java.util.Date; import java.util.Enumeration; import java.util.Vector; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; import org.exolab.castor.xml.ValidationException; import org.xml.sax.ContentHandler; /** * Class JalviewState. * * @version $Revision$ $Date$ */ public class JalviewState implements java.io.Serializable { //--------------------------/ //- Class/Member Variables -/ //--------------------------/ /** * Field _creationDate */ private java.util.Date _creationDate; /** * Field _fileList */ private java.util.Vector _fileList; //----------------/ //- Constructors -/ //----------------/ public JalviewState() { super(); _fileList = new Vector(); } //-- jalview.binding.JalviewState() //-----------/ //- Methods -/ //-----------/ /** * Method addFile * * * * @param vFile */ public void addFile(java.lang.String vFile) throws java.lang.IndexOutOfBoundsException { _fileList.addElement(vFile); } //-- void addFile(java.lang.String) /** * Method addFile * * * * @param index * @param vFile */ public void addFile(int index, java.lang.String vFile) throws java.lang.IndexOutOfBoundsException { _fileList.insertElementAt(vFile, index); } //-- void addFile(int, java.lang.String) /** * Method enumerateFile * * * * @return Enumeration */ public java.util.Enumeration enumerateFile() { return _fileList.elements(); } //-- java.util.Enumeration enumerateFile() /** * Returns the value of field 'creationDate'. * * @return Date * @return the value of field 'creationDate'. */ public java.util.Date getCreationDate() { return this._creationDate; } //-- java.util.Date getCreationDate() /** * Method getFile * * * * @param index * @return String */ public java.lang.String getFile(int index) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _fileList.size())) { throw new IndexOutOfBoundsException(); } return (String)_fileList.elementAt(index); } //-- java.lang.String getFile(int) /** * Method getFile * * * * @return String */ public java.lang.String[] getFile() { int size = _fileList.size(); java.lang.String[] mArray = new java.lang.String[size]; for (int index = 0; index < size; index++) { mArray[index] = (String)_fileList.elementAt(index); } return mArray; } //-- java.lang.String[] getFile() /** * Method getFileCount * * * * @return int */ public int getFileCount() { return _fileList.size(); } //-- int getFileCount() /** * Method isValid * * * * @return boolean */ public boolean isValid() { try { validate(); } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; } //-- boolean isValid() /** * Method marshal * * * * @param out */ public void marshal(java.io.Writer out) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); } //-- void marshal(java.io.Writer) /** * Method marshal * * * * @param handler */ public void marshal(org.xml.sax.ContentHandler handler) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, handler); } //-- void marshal(org.xml.sax.ContentHandler) /** * Method removeAllFile * */ public void removeAllFile() { _fileList.removeAllElements(); } //-- void removeAllFile() /** * Method removeFile * * * * @param index * @return String */ public java.lang.String removeFile(int index) { java.lang.Object obj = _fileList.elementAt(index); _fileList.removeElementAt(index); return (String)obj; } //-- java.lang.String removeFile(int) /** * Sets the value of field 'creationDate'. * * @param creationDate the value of field 'creationDate'. */ public void setCreationDate(java.util.Date creationDate) { this._creationDate = creationDate; } //-- void setCreationDate(java.util.Date) /** * Method setFile * * * * @param index * @param vFile */ public void setFile(int index, java.lang.String vFile) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _fileList.size())) { throw new IndexOutOfBoundsException(); } _fileList.setElementAt(vFile, index); } //-- void setFile(int, java.lang.String) /** * Method setFile * * * * @param fileArray */ public void setFile(java.lang.String[] fileArray) { //-- copy array _fileList.removeAllElements(); for (int i = 0; i < fileArray.length; i++) { _fileList.addElement(fileArray[i]); } } //-- void setFile(java.lang.String) /** * Method unmarshal * * * * @param reader * @return Object */ public static java.lang.Object unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (jalview.binding.JalviewState) Unmarshaller.unmarshal(jalview.binding.JalviewState.class, reader); } //-- java.lang.Object unmarshal(java.io.Reader) /** * Method validate * */ public void validate() throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); } //-- void validate() }