From: jprocter Date: Fri, 23 Sep 2005 17:43:17 +0000 (+0000) Subject: refactored schema (SequenceSet to DataSet and SequenceSetAnnotation to DataSetAnnotat... X-Git-Tag: Release_0.2~468 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=31a237800ee9c6a324426645d395ae32db885a8e;p=vamsas.git refactored schema (SequenceSet to DataSet and SequenceSetAnnotation to DataSetAnnotation). More client implementation. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@52 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/schemas/coreObject.xml b/schemas/coreObject.xml index 63d2180..52e0f9f 100755 --- a/schemas/coreObject.xml +++ b/schemas/coreObject.xml @@ -1,7 +1,7 @@ - + KTAIITGGSRGIGKSIAIKLGKLGASIVLNYRNNTDALKNTIRELEDLNINVIAVQGDISNYKECEKIIKAALDKFNGIDILVNNAGITADNLILRMKEEEFDKVIETNLKGTFNCVKHCIPMIKRRYGKIINISSVVGVAGNVGQCNYAAAKAGVIGFTKSLAKEL Q899P0 @@ -90,5 +90,5 @@ http://www.vamsas.ac.uk/build/VamsasClient/schemas/vamsas.xsd"> 2005-11-21 - + diff --git a/schemas/document.xml b/schemas/document.xml index ef21892..633b63b 100644 --- a/schemas/document.xml +++ b/schemas/document.xml @@ -8,7 +8,7 @@ - + KTAIITGGSRGIGKSIAIKLGKLGASIVLNYRNNTDALKNTIRELEDLNINVIAVQGDISNYKECEKIIKAALDKFNGIDILVNNAGITADNLILRMKEEEFDKVIETNLKGTFNCVKHCIPMIKRRYGKIINISSVVGVAGNVGQCNYAAAKAGVIGFTKSLAKEL Q899P0 @@ -97,7 +97,7 @@ 2005-11-21 - + diff --git a/schemas/vamsas.xsd b/schemas/vamsas.xsd index 19b2a4b..d259b25 100644 --- a/schemas/vamsas.xsd +++ b/schemas/vamsas.xsd @@ -6,7 +6,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -69,7 +69,7 @@ - + diff --git a/src/org/vamsas/client/simpleclient/Lock.java b/src/org/vamsas/client/simpleclient/Lock.java new file mode 100644 index 0000000..c4351d6 --- /dev/null +++ b/src/org/vamsas/client/simpleclient/Lock.java @@ -0,0 +1,61 @@ +package org.vamsas.client.simpleclient; + +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.channels.FileLock; + +/** + * transient object representing a file lock + * + * + * @author jimp + * + */ + +public class Lock { + FileLock lock = null; + /** + * creates a valid Lock (test with isLocked) + * if a lock could be obtained for lockfile + * @param lockfile + */ + public Lock(java.io.File lockfile) { + // try and get a lock. + lock = null; + + try { + if (!lockfile.exists()) + if (!lockfile.createNewFile()) { + return; + } + + lock = new FileOutputStream(lockfile).getChannel().tryLock(); + } catch (FileNotFoundException e) { + System.err.println("Error! Couldn't create a lockfile at " + + lockfile.getAbsolutePath()); + e.printStackTrace(); + } catch (IOException e) { + System.err.println("Error! Problems with IO when creating a lock on " + + lockfile.getAbsolutePath()); + e.printStackTrace(); + } + } + + boolean isLocked() { + if (lock != null && lock.isValid()) { + return true; + } + return false; + } + + /* Explicitly release lock (probably don't need to do this!) + * @see java.lang.Object#finalize() + */ + protected void finalize() throws Throwable { + if (lock!=null) + lock.release(); + super.finalize(); + } + +} diff --git a/src/org/vamsas/client/simpleclient/LockTimeoutException.java b/src/org/vamsas/client/simpleclient/LockTimeoutException.java new file mode 100644 index 0000000..8dc1317 --- /dev/null +++ b/src/org/vamsas/client/simpleclient/LockTimeoutException.java @@ -0,0 +1,29 @@ +/** + * + */ +package org.vamsas.client.simpleclient; + +/** + * @author jimp + * + */ +public class LockTimeoutException extends Exception { + static final long serialVersionUID=1; + static final String defaultMessage = "Timeout whilst waiting for lock on VamsasDocument"; + public LockTimeoutException() { + super(defaultMessage); + } + public LockTimeoutException(String arg0, Throwable arg1) { + super(arg0+" (timeout whilst waiting for lock)", arg1); + // TODO Auto-generated constructor stub + } + public LockTimeoutException(String arg0) { + super(arg0+" (timeout whilst waiting for lock)"); + // TODO Auto-generated constructor stub + } + public LockTimeoutException(Throwable arg0) { + super(defaultMessage, arg0); + // TODO Auto-generated constructor stub + } + +} diff --git a/src/org/vamsas/client/simpleclient/documentHandler.java b/src/org/vamsas/client/simpleclient/documentHandler.java new file mode 100644 index 0000000..fd6e016 --- /dev/null +++ b/src/org/vamsas/client/simpleclient/documentHandler.java @@ -0,0 +1,107 @@ + +package org.vamsas.client.simpleclient; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.util.Timer; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarInputStream; +import java.util.jar.JarOutputStream; + +import org.vamsas.objects.core.LockFileDescriptor; + +/** + * low level vamsas document management routines + * This class is not thread safe. + * @author jimp + * + */ +public class documentHandler { + /** + * Zip file entries + * - vamsasdocument.xml : core info + * one or more: + * - .version.sessionnumber.raw (string given in vamsasdocument.xml applicationData entry) + * Lockfile + * - filename given in the vamsasdocument.xml. Should be checked for validity by any client and rewritten if necessary. + * The lockfile can point to the jar itself. + * Mode of operation. + * Initially - documentHandler either: + * - creates a zip for a new session for the client + * - connect to an existing session zip + * 1. reads session urn file + * 2. waits for lock + * 3. examines session - decide whether to create new application data slice or connect to one stored in session. + * 4. writes info into session file + * 5. releases lock and generates local client events. + * 6. Creates Watcher thread to generate events. + * + * During the session + * - Update watcher checks for file change - + * + */ + private File vamsasJar; + private Lock newVamsasJarLock; + private File newVamsasJar; // file which client application is writing to. + private File lockfile; + private Lock lock; + private File newSessionDir; // where new sessions (or copies of existing sessions) can be safely created + private long timeout=1000; // time in milliseconds before we give up getting a lock + private long interval=100; // time between attempts to lock + private PrintWriter vamsasWriterStream; // non null if there is a write to a new Document in progress. + public documentHandler(File sessionDir) throws java.io.IOException { + newSessionDir = File.createTempFile("vamsasSimple", "session", sessionDir); + } + + public documentHandler(File lockfile, File vamsasJar) { + this.lockfile = lockfile; + this.vamsasJar = vamsasJar; + } + /** + * gets an unlocked stream from the vamsas document. + * @return reader for vamsasdocument.xml enrty + */ + public java.io.Reader getDocumentReader() { + + try { + JarFile session = new JarFile(vamsasJar); + JarEntry vamsasDocument = session.getJarEntry("vamsasDocument.xml"); + return new InputStreamReader(session.getInputStream(vamsasDocument)); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + /** + * opens a locked UTF-8 stream to the vamsas document. + * @return reader for vamsasdocument.xml enrty + */ + public java.io.PrintWriter getDocumentWriter() { + if (vamsasWriterStream!=null && vamsasWriterStream.checkError()) { + return vamsasWriterStream; + } + + try { + + newVamsasJarLock = new Lock(lockfile); + if (newVamsasJarLock = !=null) { + JarOutputStream session = new JarOutputStream(new FileOutputStream(vamsasJar)); + JarEntry vamsasDocument = session.getJarEntry("vamsasDocument.xml"); + if (vamsasDocument!=null) + return new java.io.PrintWriter(OutputStreamWriter(session.Stream(vamsasDocument)), "UTF-8"); + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + +} diff --git a/src/org/vamsas/objects/core/SequenceSet.java b/src/org/vamsas/objects/core/DataSet.java similarity index 81% rename from src/org/vamsas/objects/core/SequenceSet.java rename to src/org/vamsas/objects/core/DataSet.java index b60edf9..176ebc5 100644 --- a/src/org/vamsas/objects/core/SequenceSet.java +++ b/src/org/vamsas/objects/core/DataSet.java @@ -24,11 +24,11 @@ import org.exolab.castor.xml.ValidationException; import org.xml.sax.ContentHandler; /** - * Class SequenceSet. + * Class DataSet. * * @version $Revision$ $Date$ */ -public class SequenceSet extends org.vamsas.client.object +public class DataSet extends org.vamsas.client.object implements java.io.Serializable { @@ -48,9 +48,9 @@ implements java.io.Serializable private java.util.Vector _sequenceList; /** - * Field _sequenceSetAnnotationsList + * Field _dataSetAnnotationsList */ - private java.util.Vector _sequenceSetAnnotationsList; + private java.util.Vector _dataSetAnnotationsList; /** * Field _alignmentList @@ -72,15 +72,15 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public SequenceSet() + public DataSet() { super(); _sequenceList = new Vector(); - _sequenceSetAnnotationsList = new Vector(); + _dataSetAnnotationsList = new Vector(); _alignmentList = new Vector(); _treeList = new Vector(); _provenanceList = new Vector(); - } //-- org.vamsas.objects.core.SequenceSet() + } //-- org.vamsas.objects.core.DataSet() //-----------/ @@ -115,6 +115,33 @@ implements java.io.Serializable } //-- void addAlignment(int, org.vamsas.objects.core.Alignment) /** + * Method addDataSetAnnotations + * + * + * + * @param vDataSetAnnotations + */ + public void addDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException + { + _dataSetAnnotationsList.addElement(vDataSetAnnotations); + } //-- void addDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations) + + /** + * Method addDataSetAnnotations + * + * + * + * @param index + * @param vDataSetAnnotations + */ + public void addDataSetAnnotations(int index, org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException + { + _dataSetAnnotationsList.insertElementAt(vDataSetAnnotations, index); + } //-- void addDataSetAnnotations(int, org.vamsas.objects.core.DataSetAnnotations) + + /** * Method addProvenance * * @@ -169,33 +196,6 @@ implements java.io.Serializable } //-- void addSequence(int, org.vamsas.objects.core.Sequence) /** - * Method addSequenceSetAnnotations - * - * - * - * @param vSequenceSetAnnotations - */ - public void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations) - throws java.lang.IndexOutOfBoundsException - { - _sequenceSetAnnotationsList.addElement(vSequenceSetAnnotations); - } //-- void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations) - - /** - * Method addSequenceSetAnnotations - * - * - * - * @param index - * @param vSequenceSetAnnotations - */ - public void addSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations) - throws java.lang.IndexOutOfBoundsException - { - _sequenceSetAnnotationsList.insertElementAt(vSequenceSetAnnotations, index); - } //-- void addSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations) - - /** * Method addTree * * @@ -235,40 +235,40 @@ implements java.io.Serializable } //-- java.util.Enumeration enumerateAlignment() /** - * Method enumerateProvenance + * Method enumerateDataSetAnnotations * * * * @return Enumeration */ - public java.util.Enumeration enumerateProvenance() + public java.util.Enumeration enumerateDataSetAnnotations() { - return _provenanceList.elements(); - } //-- java.util.Enumeration enumerateProvenance() + return _dataSetAnnotationsList.elements(); + } //-- java.util.Enumeration enumerateDataSetAnnotations() /** - * Method enumerateSequence + * Method enumerateProvenance * * * * @return Enumeration */ - public java.util.Enumeration enumerateSequence() + public java.util.Enumeration enumerateProvenance() { - return _sequenceList.elements(); - } //-- java.util.Enumeration enumerateSequence() + return _provenanceList.elements(); + } //-- java.util.Enumeration enumerateProvenance() /** - * Method enumerateSequenceSetAnnotations + * Method enumerateSequence * * * * @return Enumeration */ - public java.util.Enumeration enumerateSequenceSetAnnotations() + public java.util.Enumeration enumerateSequence() { - return _sequenceSetAnnotationsList.elements(); - } //-- java.util.Enumeration enumerateSequenceSetAnnotations() + return _sequenceList.elements(); + } //-- java.util.Enumeration enumerateSequence() /** * Method enumerateTree @@ -296,9 +296,9 @@ implements java.io.Serializable if (super.equals(obj)==false) return false; - if (obj instanceof SequenceSet) { + if (obj instanceof DataSet) { - SequenceSet temp = (SequenceSet)obj; + DataSet temp = (DataSet)obj; if (this._id != null) { if (temp._id == null) return false; else if (!(this._id.equals(temp._id))) @@ -313,12 +313,12 @@ implements java.io.Serializable } else if (temp._sequenceList != null) return false; - if (this._sequenceSetAnnotationsList != null) { - if (temp._sequenceSetAnnotationsList == null) return false; - else if (!(this._sequenceSetAnnotationsList.equals(temp._sequenceSetAnnotationsList))) + if (this._dataSetAnnotationsList != null) { + if (temp._dataSetAnnotationsList == null) return false; + else if (!(this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList))) return false; } - else if (temp._sequenceSetAnnotationsList != null) + else if (temp._dataSetAnnotationsList != null) return false; if (this._alignmentList != null) { if (temp._alignmentList == null) return false; @@ -395,6 +395,54 @@ implements java.io.Serializable } //-- int getAlignmentCount() /** + * Method getDataSetAnnotations + * + * + * + * @param index + * @return DataSetAnnotations + */ + public org.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _dataSetAnnotationsList.size())) { + throw new IndexOutOfBoundsException("getDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]"); + } + + return (org.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index); + } //-- org.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int) + + /** + * Method getDataSetAnnotations + * + * + * + * @return DataSetAnnotations + */ + public org.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations() + { + int size = _dataSetAnnotationsList.size(); + org.vamsas.objects.core.DataSetAnnotations[] mArray = new org.vamsas.objects.core.DataSetAnnotations[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations() + + /** + * Method getDataSetAnnotationsCount + * + * + * + * @return int + */ + public int getDataSetAnnotationsCount() + { + return _dataSetAnnotationsList.size(); + } //-- int getDataSetAnnotationsCount() + + /** * Returns the value of field 'id'. * * @return String @@ -502,54 +550,6 @@ implements java.io.Serializable } //-- int getSequenceCount() /** - * Method getSequenceSetAnnotations - * - * - * - * @param index - * @return SequenceSetAnnotations - */ - public org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) { - throw new IndexOutOfBoundsException("getSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]"); - } - - return (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index); - } //-- org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int) - - /** - * Method getSequenceSetAnnotations - * - * - * - * @return SequenceSetAnnotations - */ - public org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations() - { - int size = _sequenceSetAnnotationsList.size(); - org.vamsas.objects.core.SequenceSetAnnotations[] mArray = new org.vamsas.objects.core.SequenceSetAnnotations[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index); - } - return mArray; - } //-- org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations() - - /** - * Method getSequenceSetAnnotationsCount - * - * - * - * @return int - */ - public int getSequenceSetAnnotationsCount() - { - return _sequenceSetAnnotationsList.size(); - } //-- int getSequenceSetAnnotationsCount() - - /** * Method getTree * * @@ -668,6 +668,15 @@ implements java.io.Serializable } //-- void removeAllAlignment() /** + * Method removeAllDataSetAnnotations + * + */ + public void removeAllDataSetAnnotations() + { + _dataSetAnnotationsList.removeAllElements(); + } //-- void removeAllDataSetAnnotations() + + /** * Method removeAllProvenance * */ @@ -686,22 +695,28 @@ implements java.io.Serializable } //-- void removeAllSequence() /** - * Method removeAllSequenceSetAnnotations + * Method removeAllTree * */ - public void removeAllSequenceSetAnnotations() + public void removeAllTree() { - _sequenceSetAnnotationsList.removeAllElements(); - } //-- void removeAllSequenceSetAnnotations() + _treeList.removeAllElements(); + } //-- void removeAllTree() /** - * Method removeAllTree + * Method removeDataSetAnnotations * + * + * + * @param index + * @return DataSetAnnotations */ - public void removeAllTree() + public org.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int index) { - _treeList.removeAllElements(); - } //-- void removeAllTree() + java.lang.Object obj = _dataSetAnnotationsList.elementAt(index); + _dataSetAnnotationsList.removeElementAt(index); + return (org.vamsas.objects.core.DataSetAnnotations) obj; + } //-- org.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int) /** * Method removeProvenance @@ -734,21 +749,6 @@ implements java.io.Serializable } //-- org.vamsas.objects.core.Sequence removeSequence(int) /** - * Method removeSequenceSetAnnotations - * - * - * - * @param index - * @return SequenceSetAnnotations - */ - public org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int index) - { - java.lang.Object obj = _sequenceSetAnnotationsList.elementAt(index); - _sequenceSetAnnotationsList.removeElementAt(index); - return (org.vamsas.objects.core.SequenceSetAnnotations) obj; - } //-- org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int) - - /** * Method removeTree * * @@ -798,6 +798,40 @@ implements java.io.Serializable } //-- void setAlignment(org.vamsas.objects.core.Alignment) /** + * Method setDataSetAnnotations + * + * + * + * @param index + * @param vDataSetAnnotations + */ + public void setDataSetAnnotations(int index, org.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _dataSetAnnotationsList.size())) { + throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]"); + } + _dataSetAnnotationsList.setElementAt(vDataSetAnnotations, index); + } //-- void setDataSetAnnotations(int, org.vamsas.objects.core.DataSetAnnotations) + + /** + * Method setDataSetAnnotations + * + * + * + * @param dataSetAnnotationsArray + */ + public void setDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations[] dataSetAnnotationsArray) + { + //-- copy array + _dataSetAnnotationsList.removeAllElements(); + for (int i = 0; i < dataSetAnnotationsArray.length; i++) { + _dataSetAnnotationsList.addElement(dataSetAnnotationsArray[i]); + } + } //-- void setDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations) + + /** * Sets the value of field 'id'. * * @param id the value of field 'id'. @@ -876,40 +910,6 @@ implements java.io.Serializable } //-- void setSequence(org.vamsas.objects.core.Sequence) /** - * Method setSequenceSetAnnotations - * - * - * - * @param index - * @param vSequenceSetAnnotations - */ - public void setSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) { - throw new IndexOutOfBoundsException("setSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]"); - } - _sequenceSetAnnotationsList.setElementAt(vSequenceSetAnnotations, index); - } //-- void setSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations) - - /** - * Method setSequenceSetAnnotations - * - * - * - * @param sequenceSetAnnotationsArray - */ - public void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations[] sequenceSetAnnotationsArray) - { - //-- copy array - _sequenceSetAnnotationsList.removeAllElements(); - for (int i = 0; i < sequenceSetAnnotationsArray.length; i++) { - _sequenceSetAnnotationsList.addElement(sequenceSetAnnotationsArray[i]); - } - } //-- void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations) - - /** * Method setTree * * @@ -949,13 +949,13 @@ implements java.io.Serializable * * * @param reader - * @return SequenceSet + * @return DataSet */ - public static org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader reader) + public static org.vamsas.objects.core.DataSet unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (org.vamsas.objects.core.SequenceSet) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceSet.class, reader); - } //-- org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader) + return (org.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSet.class, reader); + } //-- org.vamsas.objects.core.DataSet unmarshal(java.io.Reader) /** * Method validate diff --git a/src/org/vamsas/objects/core/SequenceSetAnnotations.java b/src/org/vamsas/objects/core/DataSetAnnotations.java similarity index 96% rename from src/org/vamsas/objects/core/SequenceSetAnnotations.java rename to src/org/vamsas/objects/core/DataSetAnnotations.java index 04e249d..60f2d84 100644 --- a/src/org/vamsas/objects/core/SequenceSetAnnotations.java +++ b/src/org/vamsas/objects/core/DataSetAnnotations.java @@ -24,11 +24,11 @@ import org.exolab.castor.xml.ValidationException; import org.xml.sax.ContentHandler; /** - * Class SequenceSetAnnotations. + * Class DataSetAnnotations. * * @version $Revision$ $Date$ */ -public class SequenceSetAnnotations extends org.vamsas.client.object +public class DataSetAnnotations extends org.vamsas.client.object implements java.io.Serializable { @@ -87,12 +87,12 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public SequenceSetAnnotations() + public DataSetAnnotations() { super(); _annotationElementList = new Vector(); _provenanceList = new Vector(); - } //-- org.vamsas.objects.core.SequenceSetAnnotations() + } //-- org.vamsas.objects.core.DataSetAnnotations() //-----------/ @@ -191,9 +191,9 @@ implements java.io.Serializable if (super.equals(obj)==false) return false; - if (obj instanceof SequenceSetAnnotations) { + if (obj instanceof DataSetAnnotations) { - SequenceSetAnnotations temp = (SequenceSetAnnotations)obj; + DataSetAnnotations temp = (DataSetAnnotations)obj; if (this._type != null) { if (temp._type == null) return false; else if (!(this._type.equals(temp._type))) @@ -673,13 +673,13 @@ implements java.io.Serializable * * * @param reader - * @return SequenceSetAnnotations + * @return DataSetAnnotations */ - public static org.vamsas.objects.core.SequenceSetAnnotations unmarshal(java.io.Reader reader) + public static org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (org.vamsas.objects.core.SequenceSetAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceSetAnnotations.class, reader); - } //-- org.vamsas.objects.core.SequenceSetAnnotations unmarshal(java.io.Reader) + return (org.vamsas.objects.core.DataSetAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSetAnnotations.class, reader); + } //-- org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader) /** * Method validate diff --git a/src/org/vamsas/objects/core/SequenceSetAnnotationsDescriptor.java b/src/org/vamsas/objects/core/DataSetAnnotationsDescriptor.java similarity index 90% rename from src/org/vamsas/objects/core/SequenceSetAnnotationsDescriptor.java rename to src/org/vamsas/objects/core/DataSetAnnotationsDescriptor.java index 6fc4a18..09af6d9 100644 --- a/src/org/vamsas/objects/core/SequenceSetAnnotationsDescriptor.java +++ b/src/org/vamsas/objects/core/DataSetAnnotationsDescriptor.java @@ -17,11 +17,11 @@ import org.exolab.castor.xml.XMLFieldDescriptor; import org.exolab.castor.xml.validators.*; /** - * Class SequenceSetAnnotationsDescriptor. + * Class DataSetAnnotationsDescriptor. * * @version $Revision$ $Date$ */ -public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { +public class DataSetAnnotationsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { //--------------------------/ @@ -53,11 +53,11 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util //- Constructors -/ //----------------/ - public SequenceSetAnnotationsDescriptor() + public DataSetAnnotationsDescriptor() { super(); nsURI = "http://www.vamsas.org"; - xmlName = "SequenceSetAnnotations"; + xmlName = "DataSetAnnotations"; //-- set grouping compositor setCompositorAsSequence(); @@ -73,14 +73,14 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; return target.getType(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; target.setType( (java.lang.String) value); } catch (java.lang.Exception ex) { @@ -112,14 +112,14 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; return target.getEnd(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; target.setEnd( (java.lang.String) value); } catch (java.lang.Exception ex) { @@ -151,14 +151,14 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; return target.getBegin(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; target.setBegin( (java.lang.String) value); } catch (java.lang.Exception ex) { @@ -190,14 +190,14 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; return target.getSeqRef(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; target.setSeqRef( (java.lang.Object) value); } catch (java.lang.Exception ex) { @@ -226,14 +226,14 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; return target.getId(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; target.setId( (java.lang.String) value); } catch (java.lang.Exception ex) { @@ -262,14 +262,14 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; return target.getDescription(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; target.setDescription( (java.lang.String) value); } catch (java.lang.Exception ex) { @@ -300,14 +300,14 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; return target.getStatus(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; target.setStatus( (java.lang.String) value); } catch (java.lang.Exception ex) { @@ -337,14 +337,14 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; return target.getAnnotationElement(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; target.addAnnotationElement( (org.vamsas.objects.core.AnnotationElement) value); } catch (java.lang.Exception ex) { @@ -372,14 +372,14 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; return target.getProvenance(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSetAnnotations target = (SequenceSetAnnotations) object; + DataSetAnnotations target = (DataSetAnnotations) object; target.addProvenance( (org.vamsas.objects.core.Provenance) value); } catch (java.lang.Exception ex) { @@ -401,7 +401,7 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util { //-- local scope } desc.setValidator(fieldValidator); - } //-- org.vamsas.objects.core.SequenceSetAnnotationsDescriptor() + } //-- org.vamsas.objects.core.DataSetAnnotationsDescriptor() //-----------/ @@ -453,7 +453,7 @@ public class SequenceSetAnnotationsDescriptor extends org.exolab.castor.xml.util */ public java.lang.Class getJavaClass() { - return org.vamsas.objects.core.SequenceSetAnnotations.class; + return org.vamsas.objects.core.DataSetAnnotations.class; } //-- java.lang.Class getJavaClass() /** diff --git a/src/org/vamsas/objects/core/SequenceSetDescriptor.java b/src/org/vamsas/objects/core/DataSetDescriptor.java similarity index 88% rename from src/org/vamsas/objects/core/SequenceSetDescriptor.java rename to src/org/vamsas/objects/core/DataSetDescriptor.java index a95b001..05f9f20 100644 --- a/src/org/vamsas/objects/core/SequenceSetDescriptor.java +++ b/src/org/vamsas/objects/core/DataSetDescriptor.java @@ -17,11 +17,11 @@ import org.exolab.castor.xml.XMLFieldDescriptor; import org.exolab.castor.xml.validators.*; /** - * Class SequenceSetDescriptor. + * Class DataSetDescriptor. * * @version $Revision$ $Date$ */ -public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { +public class DataSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { //--------------------------/ @@ -53,11 +53,11 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe //- Constructors -/ //----------------/ - public SequenceSetDescriptor() + public DataSetDescriptor() { super(); nsURI = "http://www.vamsas.org"; - xmlName = "SequenceSet"; + xmlName = "DataSet"; //-- set grouping compositor setCompositorAsSequence(); @@ -73,14 +73,14 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; return target.getId(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; target.setId( (java.lang.String) value); } catch (java.lang.Exception ex) { @@ -108,14 +108,14 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; return target.getSequence(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; target.addSequence( (org.vamsas.objects.core.Sequence) value); } catch (java.lang.Exception ex) { @@ -138,28 +138,28 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe { //-- local scope } desc.setValidator(fieldValidator); - //-- _sequenceSetAnnotationsList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.SequenceSetAnnotations.class, "_sequenceSetAnnotationsList", "SequenceSetAnnotations", org.exolab.castor.xml.NodeType.Element); + //-- _dataSetAnnotationsList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.DataSetAnnotations.class, "_dataSetAnnotationsList", "DataSetAnnotations", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSet target = (SequenceSet) object; - return target.getSequenceSetAnnotations(); + DataSet target = (DataSet) object; + return target.getDataSetAnnotations(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSet target = (SequenceSet) object; - target.addSequenceSetAnnotations( (org.vamsas.objects.core.SequenceSetAnnotations) value); + DataSet target = (DataSet) object; + target.addDataSetAnnotations( (org.vamsas.objects.core.DataSetAnnotations) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } public java.lang.Object newInstance( java.lang.Object parent ) { - return new org.vamsas.objects.core.SequenceSetAnnotations(); + return new org.vamsas.objects.core.DataSetAnnotations(); } }; desc.setHandler(handler); @@ -167,7 +167,7 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe desc.setMultivalued(true); addFieldDescriptor(desc); - //-- validation code for: _sequenceSetAnnotationsList + //-- validation code for: _dataSetAnnotationsList fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(0); { //-- local scope @@ -179,14 +179,14 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; return target.getAlignment(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; target.addAlignment( (org.vamsas.objects.core.Alignment) value); } catch (java.lang.Exception ex) { @@ -214,14 +214,14 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; return target.getTree(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; target.addTree( (org.vamsas.objects.core.Tree) value); } catch (java.lang.Exception ex) { @@ -249,14 +249,14 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; return target.getProvenance(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { - SequenceSet target = (SequenceSet) object; + DataSet target = (DataSet) object; target.addProvenance( (org.vamsas.objects.core.Provenance) value); } catch (java.lang.Exception ex) { @@ -279,7 +279,7 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe { //-- local scope } desc.setValidator(fieldValidator); - } //-- org.vamsas.objects.core.SequenceSetDescriptor() + } //-- org.vamsas.objects.core.DataSetDescriptor() //-----------/ @@ -331,7 +331,7 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe */ public java.lang.Class getJavaClass() { - return org.vamsas.objects.core.SequenceSet.class; + return org.vamsas.objects.core.DataSet.class; } //-- java.lang.Class getJavaClass() /** diff --git a/src/org/vamsas/objects/core/VAMSAS.java b/src/org/vamsas/objects/core/VAMSAS.java index 0cd3f56..28ee859 100644 --- a/src/org/vamsas/objects/core/VAMSAS.java +++ b/src/org/vamsas/objects/core/VAMSAS.java @@ -48,9 +48,9 @@ implements java.io.Serializable private java.util.Vector _treeList; /** - * Field _sequenceSetList + * Field _dataSetList */ - private java.util.Vector _sequenceSetList; + private java.util.Vector _dataSetList; //----------------/ @@ -61,7 +61,7 @@ implements java.io.Serializable { super(); _treeList = new Vector(); - _sequenceSetList = new Vector(); + _dataSetList = new Vector(); } //-- org.vamsas.objects.core.VAMSAS() @@ -70,31 +70,31 @@ implements java.io.Serializable //-----------/ /** - * Method addSequenceSet + * Method addDataSet * * * - * @param vSequenceSet + * @param vDataSet */ - public void addSequenceSet(org.vamsas.objects.core.SequenceSet vSequenceSet) + public void addDataSet(org.vamsas.objects.core.DataSet vDataSet) throws java.lang.IndexOutOfBoundsException { - _sequenceSetList.addElement(vSequenceSet); - } //-- void addSequenceSet(org.vamsas.objects.core.SequenceSet) + _dataSetList.addElement(vDataSet); + } //-- void addDataSet(org.vamsas.objects.core.DataSet) /** - * Method addSequenceSet + * Method addDataSet * * * * @param index - * @param vSequenceSet + * @param vDataSet */ - public void addSequenceSet(int index, org.vamsas.objects.core.SequenceSet vSequenceSet) + public void addDataSet(int index, org.vamsas.objects.core.DataSet vDataSet) throws java.lang.IndexOutOfBoundsException { - _sequenceSetList.insertElementAt(vSequenceSet, index); - } //-- void addSequenceSet(int, org.vamsas.objects.core.SequenceSet) + _dataSetList.insertElementAt(vDataSet, index); + } //-- void addDataSet(int, org.vamsas.objects.core.DataSet) /** * Method addTree @@ -124,16 +124,16 @@ implements java.io.Serializable } //-- void addTree(int, org.vamsas.objects.core.Tree) /** - * Method enumerateSequenceSet + * Method enumerateDataSet * * * * @return Enumeration */ - public java.util.Enumeration enumerateSequenceSet() + public java.util.Enumeration enumerateDataSet() { - return _sequenceSetList.elements(); - } //-- java.util.Enumeration enumerateSequenceSet() + return _dataSetList.elements(); + } //-- java.util.Enumeration enumerateDataSet() /** * Method enumerateTree @@ -178,12 +178,12 @@ implements java.io.Serializable } else if (temp._treeList != null) return false; - if (this._sequenceSetList != null) { - if (temp._sequenceSetList == null) return false; - else if (!(this._sequenceSetList.equals(temp._sequenceSetList))) + if (this._dataSetList != null) { + if (temp._dataSetList == null) return false; + else if (!(this._dataSetList.equals(temp._dataSetList))) return false; } - else if (temp._sequenceSetList != null) + else if (temp._dataSetList != null) return false; return true; } @@ -191,63 +191,63 @@ implements java.io.Serializable } //-- boolean equals(java.lang.Object) /** - * Returns the value of field 'id'. - * - * @return String - * @return the value of field 'id'. - */ - public java.lang.String getId() - { - return this._id; - } //-- java.lang.String getId() - - /** - * Method getSequenceSet + * Method getDataSet * * * * @param index - * @return SequenceSet + * @return DataSet */ - public org.vamsas.objects.core.SequenceSet getSequenceSet(int index) + public org.vamsas.objects.core.DataSet getDataSet(int index) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _sequenceSetList.size())) { - throw new IndexOutOfBoundsException("getSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]"); + if ((index < 0) || (index > _dataSetList.size())) { + throw new IndexOutOfBoundsException("getDataSet: Index value '"+index+"' not in range [0.."+_dataSetList.size()+ "]"); } - return (org.vamsas.objects.core.SequenceSet) _sequenceSetList.elementAt(index); - } //-- org.vamsas.objects.core.SequenceSet getSequenceSet(int) + return (org.vamsas.objects.core.DataSet) _dataSetList.elementAt(index); + } //-- org.vamsas.objects.core.DataSet getDataSet(int) /** - * Method getSequenceSet + * Method getDataSet * * * - * @return SequenceSet + * @return DataSet */ - public org.vamsas.objects.core.SequenceSet[] getSequenceSet() + public org.vamsas.objects.core.DataSet[] getDataSet() { - int size = _sequenceSetList.size(); - org.vamsas.objects.core.SequenceSet[] mArray = new org.vamsas.objects.core.SequenceSet[size]; + int size = _dataSetList.size(); + org.vamsas.objects.core.DataSet[] mArray = new org.vamsas.objects.core.DataSet[size]; for (int index = 0; index < size; index++) { - mArray[index] = (org.vamsas.objects.core.SequenceSet) _sequenceSetList.elementAt(index); + mArray[index] = (org.vamsas.objects.core.DataSet) _dataSetList.elementAt(index); } return mArray; - } //-- org.vamsas.objects.core.SequenceSet[] getSequenceSet() + } //-- org.vamsas.objects.core.DataSet[] getDataSet() /** - * Method getSequenceSetCount + * Method getDataSetCount * * * * @return int */ - public int getSequenceSetCount() + public int getDataSetCount() { - return _sequenceSetList.size(); - } //-- int getSequenceSetCount() + return _dataSetList.size(); + } //-- int getDataSetCount() + + /** + * Returns the value of field 'id'. + * + * @return String + * @return the value of field 'id'. + */ + public java.lang.String getId() + { + return this._id; + } //-- java.lang.String getId() /** * Method getTree @@ -344,13 +344,13 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** - * Method removeAllSequenceSet + * Method removeAllDataSet * */ - public void removeAllSequenceSet() + public void removeAllDataSet() { - _sequenceSetList.removeAllElements(); - } //-- void removeAllSequenceSet() + _dataSetList.removeAllElements(); + } //-- void removeAllDataSet() /** * Method removeAllTree @@ -362,19 +362,19 @@ implements java.io.Serializable } //-- void removeAllTree() /** - * Method removeSequenceSet + * Method removeDataSet * * * * @param index - * @return SequenceSet + * @return DataSet */ - public org.vamsas.objects.core.SequenceSet removeSequenceSet(int index) + public org.vamsas.objects.core.DataSet removeDataSet(int index) { - java.lang.Object obj = _sequenceSetList.elementAt(index); - _sequenceSetList.removeElementAt(index); - return (org.vamsas.objects.core.SequenceSet) obj; - } //-- org.vamsas.objects.core.SequenceSet removeSequenceSet(int) + java.lang.Object obj = _dataSetList.elementAt(index); + _dataSetList.removeElementAt(index); + return (org.vamsas.objects.core.DataSet) obj; + } //-- org.vamsas.objects.core.DataSet removeDataSet(int) /** * Method removeTree @@ -392,48 +392,48 @@ implements java.io.Serializable } //-- org.vamsas.objects.core.Tree removeTree(int) /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId(java.lang.String id) - { - this._id = id; - } //-- void setId(java.lang.String) - - /** - * Method setSequenceSet + * Method setDataSet * * * * @param index - * @param vSequenceSet + * @param vDataSet */ - public void setSequenceSet(int index, org.vamsas.objects.core.SequenceSet vSequenceSet) + public void setDataSet(int index, org.vamsas.objects.core.DataSet vDataSet) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _sequenceSetList.size())) { - throw new IndexOutOfBoundsException("setSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]"); + if ((index < 0) || (index > _dataSetList.size())) { + throw new IndexOutOfBoundsException("setDataSet: Index value '"+index+"' not in range [0.."+_dataSetList.size()+ "]"); } - _sequenceSetList.setElementAt(vSequenceSet, index); - } //-- void setSequenceSet(int, org.vamsas.objects.core.SequenceSet) + _dataSetList.setElementAt(vDataSet, index); + } //-- void setDataSet(int, org.vamsas.objects.core.DataSet) /** - * Method setSequenceSet + * Method setDataSet * * * - * @param sequenceSetArray + * @param dataSetArray */ - public void setSequenceSet(org.vamsas.objects.core.SequenceSet[] sequenceSetArray) + public void setDataSet(org.vamsas.objects.core.DataSet[] dataSetArray) { //-- copy array - _sequenceSetList.removeAllElements(); - for (int i = 0; i < sequenceSetArray.length; i++) { - _sequenceSetList.addElement(sequenceSetArray[i]); + _dataSetList.removeAllElements(); + for (int i = 0; i < dataSetArray.length; i++) { + _dataSetList.addElement(dataSetArray[i]); } - } //-- void setSequenceSet(org.vamsas.objects.core.SequenceSet) + } //-- void setDataSet(org.vamsas.objects.core.DataSet) + + /** + * Sets the value of field 'id'. + * + * @param id the value of field 'id'. + */ + public void setId(java.lang.String id) + { + this._id = id; + } //-- void setId(java.lang.String) /** * Method setTree diff --git a/src/org/vamsas/objects/core/VAMSASDescriptor.java b/src/org/vamsas/objects/core/VAMSASDescriptor.java index a691eda..18f66c2 100644 --- a/src/org/vamsas/objects/core/VAMSASDescriptor.java +++ b/src/org/vamsas/objects/core/VAMSASDescriptor.java @@ -137,28 +137,28 @@ public class VAMSASDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip { //-- local scope } desc.setValidator(fieldValidator); - //-- _sequenceSetList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.SequenceSet.class, "_sequenceSetList", "SequenceSet", org.exolab.castor.xml.NodeType.Element); + //-- _dataSetList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.DataSet.class, "_dataSetList", "DataSet", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { VAMSAS target = (VAMSAS) object; - return target.getSequenceSet(); + return target.getDataSet(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { VAMSAS target = (VAMSAS) object; - target.addSequenceSet( (org.vamsas.objects.core.SequenceSet) value); + target.addDataSet( (org.vamsas.objects.core.DataSet) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } public java.lang.Object newInstance( java.lang.Object parent ) { - return new org.vamsas.objects.core.SequenceSet(); + return new org.vamsas.objects.core.DataSet(); } }; desc.setHandler(handler); @@ -166,7 +166,7 @@ public class VAMSASDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip desc.setMultivalued(true); addFieldDescriptor(desc); - //-- validation code for: _sequenceSetList + //-- validation code for: _dataSetList fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(0); { //-- local scope