From ac12127b5cf22bb34b6042e543d506894164a94c Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 24 Apr 2007 16:04:22 +0000 Subject: [PATCH] rebult for castor-1.1(vamsas version) git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@378 be28352e-c001-0410-b1a7-c7978e42abec --- src/uk/ac/vamsas/objects/core/.castor.cdr | 41 +- src/uk/ac/vamsas/objects/core/Alignment.java | 1153 +++++++++++-------- .../vamsas/objects/core/AlignmentAnnotation.java | 186 ++-- .../ac/vamsas/objects/core/AlignmentSequence.java | 386 ++++--- .../objects/core/AlignmentSequenceAnnotation.java | 189 ++-- .../ac/vamsas/objects/core/AnnotationElement.java | 692 +++++++----- src/uk/ac/vamsas/objects/core/AppData.java | 170 +-- src/uk/ac/vamsas/objects/core/ApplicationData.java | 636 ++++++----- src/uk/ac/vamsas/objects/core/Attachment.java | 219 ++-- src/uk/ac/vamsas/objects/core/Common.java | 125 ++- src/uk/ac/vamsas/objects/core/DataSet.java | 1056 ++++++++++-------- .../ac/vamsas/objects/core/DataSetAnnotations.java | 156 +-- src/uk/ac/vamsas/objects/core/DbRef.java | 874 +++++++++------ src/uk/ac/vamsas/objects/core/Entry.java | 888 +++++++++------ src/uk/ac/vamsas/objects/core/Glyph.java | 152 +-- src/uk/ac/vamsas/objects/core/Input.java | 156 +-- src/uk/ac/vamsas/objects/core/Instance.java | 138 +-- src/uk/ac/vamsas/objects/core/Link.java | 152 +-- src/uk/ac/vamsas/objects/core/LockFile.java | 134 ++- src/uk/ac/vamsas/objects/core/Map.java | 125 ++- src/uk/ac/vamsas/objects/core/MapList.java | 268 +++-- src/uk/ac/vamsas/objects/core/Mapping.java | 136 ++- src/uk/ac/vamsas/objects/core/Newick.java | 192 ++-- src/uk/ac/vamsas/objects/core/Param.java | 172 +-- src/uk/ac/vamsas/objects/core/Pos.java | 154 +-- src/uk/ac/vamsas/objects/core/Property.java | 172 +-- src/uk/ac/vamsas/objects/core/Provenance.java | 338 +++--- src/uk/ac/vamsas/objects/core/RangeAnnotation.java | 1157 ++++++++++++-------- src/uk/ac/vamsas/objects/core/RangeType.java | 530 +++++---- src/uk/ac/vamsas/objects/core/Score.java | 172 +-- src/uk/ac/vamsas/objects/core/Seg.java | 241 ++-- src/uk/ac/vamsas/objects/core/Sequence.java | 378 ++++--- src/uk/ac/vamsas/objects/core/SequenceType.java | 718 ++++++------ src/uk/ac/vamsas/objects/core/Tree.java | 656 ++++++----- src/uk/ac/vamsas/objects/core/User.java | 158 +-- src/uk/ac/vamsas/objects/core/VAMSAS.java | 614 ++++++----- src/uk/ac/vamsas/objects/core/VamsasDocument.java | 872 +++++++++------ .../descriptors/AlignmentAnnotationDescriptor.java | 245 +++++ .../core/descriptors/AlignmentDescriptor.java | 522 +++++++++ .../AlignmentSequenceAnnotationDescriptor.java | 245 +++++ .../descriptors/AlignmentSequenceDescriptor.java | 285 +++++ .../descriptors/AnnotationElementDescriptor.java | 413 +++++++ .../core/descriptors/AppDataDescriptor.java | 240 ++++ .../descriptors/ApplicationDataDescriptor.java | 364 ++++++ .../core/descriptors/AttachmentDescriptor.java | 320 ++++++ .../objects/core/descriptors/CommonDescriptor.java | 159 +++ .../descriptors/DataSetAnnotationsDescriptor.java | 242 ++++ .../core/descriptors/DataSetDescriptor.java | 405 +++++++ .../objects/core/descriptors/DbRefDescriptor.java | 444 ++++++++ .../objects/core/descriptors/EntryDescriptor.java | 485 ++++++++ .../objects/core/descriptors/GlyphDescriptor.java | 235 ++++ .../objects/core/descriptors/InputDescriptor.java | 241 ++++ .../core/descriptors/InstanceDescriptor.java | 205 ++++ .../objects/core/descriptors/LinkDescriptor.java | 230 ++++ .../core/descriptors/LockFileDescriptor.java | 198 ++++ .../objects/core/descriptors/MapDescriptor.java | 159 +++ .../core/descriptors/MapListDescriptor.java | 326 ++++++ .../core/descriptors/MappingDescriptor.java | 204 ++++ .../objects/core/descriptors/NewickDescriptor.java | 308 ++++++ .../objects/core/descriptors/ParamDescriptor.java | 276 +++++ .../objects/core/descriptors/PosDescriptor.java | 205 ++++ .../core/descriptors/PropertyDescriptor.java | 276 +++++ .../core/descriptors/ProvenanceDescriptor.java | 208 ++++ .../descriptors/RangeAnnotationDescriptor.java | 600 ++++++++++ .../core/descriptors/RangeTypeDescriptor.java | 251 +++++ .../objects/core/descriptors/ScoreDescriptor.java | 241 ++++ .../objects/core/descriptors/SegDescriptor.java | 289 +++++ .../core/descriptors/SequenceDescriptor.java | 286 +++++ .../core/descriptors/SequenceTypeDescriptor.java | 449 ++++++++ .../objects/core/descriptors/TreeDescriptor.java | 396 +++++++ .../objects/core/descriptors/UserDescriptor.java | 244 +++++ .../objects/core/descriptors/VAMSASDescriptor.java | 322 ++++++ .../core/descriptors/VamsasDocumentDescriptor.java | 398 +++++++ 73 files changed, 19360 insertions(+), 6112 deletions(-) create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/MapListDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/MappingDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java create mode 100644 src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java diff --git a/src/uk/ac/vamsas/objects/core/.castor.cdr b/src/uk/ac/vamsas/objects/core/.castor.cdr index 4bb6a9a..cde7b7a 100644 --- a/src/uk/ac/vamsas/objects/core/.castor.cdr +++ b/src/uk/ac/vamsas/objects/core/.castor.cdr @@ -1,3 +1,38 @@ --- listing properties -- -uk.ac.vamsas.objects.core.LockFile=uk.ac.vamsas.objects.core.LockFileDes... -uk.ac.vamsas.objects.core.VamsasDocument=uk.ac.vamsas.objects.core.VamsasDocum... +#Tue Apr 24 16:26:33 BST 2007 +uk.ac.vamsas.objects.core.SequenceType=uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor +uk.ac.vamsas.objects.core.DbRef=uk.ac.vamsas.objects.core.descriptors.DbRefDescriptor +uk.ac.vamsas.objects.core.Tree=uk.ac.vamsas.objects.core.descriptors.TreeDescriptor +uk.ac.vamsas.objects.core.VAMSAS=uk.ac.vamsas.objects.core.descriptors.VAMSASDescriptor +uk.ac.vamsas.objects.core.Mapping=uk.ac.vamsas.objects.core.descriptors.MappingDescriptor +uk.ac.vamsas.objects.core.Glyph=uk.ac.vamsas.objects.core.descriptors.GlyphDescriptor +uk.ac.vamsas.objects.core.DataSet=uk.ac.vamsas.objects.core.descriptors.DataSetDescriptor +uk.ac.vamsas.objects.core.AnnotationElement=uk.ac.vamsas.objects.core.descriptors.AnnotationElementDescriptor +uk.ac.vamsas.objects.core.Attachment=uk.ac.vamsas.objects.core.descriptors.AttachmentDescriptor +uk.ac.vamsas.objects.core.Entry=uk.ac.vamsas.objects.core.descriptors.EntryDescriptor +uk.ac.vamsas.objects.core.User=uk.ac.vamsas.objects.core.descriptors.UserDescriptor +uk.ac.vamsas.objects.core.Provenance=uk.ac.vamsas.objects.core.descriptors.ProvenanceDescriptor +uk.ac.vamsas.objects.core.RangeType=uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor +uk.ac.vamsas.objects.core.Newick=uk.ac.vamsas.objects.core.descriptors.NewickDescriptor +uk.ac.vamsas.objects.core.ApplicationData=uk.ac.vamsas.objects.core.descriptors.ApplicationDataDescriptor +uk.ac.vamsas.objects.core.Property=uk.ac.vamsas.objects.core.descriptors.PropertyDescriptor +uk.ac.vamsas.objects.core.Instance=uk.ac.vamsas.objects.core.descriptors.InstanceDescriptor +uk.ac.vamsas.objects.core.AlignmentAnnotation=uk.ac.vamsas.objects.core.descriptors.AlignmentAnnotationDescriptor +uk.ac.vamsas.objects.core.LockFile=uk.ac.vamsas.objects.core.descriptors.LockFileDescriptor +uk.ac.vamsas.objects.core.Common=uk.ac.vamsas.objects.core.descriptors.CommonDescriptor +uk.ac.vamsas.objects.core.Map=uk.ac.vamsas.objects.core.descriptors.MapDescriptor +uk.ac.vamsas.objects.core.RangeAnnotation=uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor +uk.ac.vamsas.objects.core.MapList=uk.ac.vamsas.objects.core.descriptors.MapListDescriptor +uk.ac.vamsas.objects.core.Sequence=uk.ac.vamsas.objects.core.descriptors.SequenceDescriptor +uk.ac.vamsas.objects.core.Pos=uk.ac.vamsas.objects.core.descriptors.PosDescriptor +uk.ac.vamsas.objects.core.Alignment=uk.ac.vamsas.objects.core.descriptors.AlignmentDescriptor +uk.ac.vamsas.objects.core.Seg=uk.ac.vamsas.objects.core.descriptors.SegDescriptor +uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation=uk.ac.vamsas.objects.core.descriptors.AlignmentSequenceAnnotationDescriptor +uk.ac.vamsas.objects.core.Score=uk.ac.vamsas.objects.core.descriptors.ScoreDescriptor +uk.ac.vamsas.objects.core.DataSetAnnotations=uk.ac.vamsas.objects.core.descriptors.DataSetAnnotationsDescriptor +uk.ac.vamsas.objects.core.Input=uk.ac.vamsas.objects.core.descriptors.InputDescriptor +uk.ac.vamsas.objects.core.VamsasDocument=uk.ac.vamsas.objects.core.descriptors.VamsasDocumentDescriptor +--=listing properties -- +uk.ac.vamsas.objects.core.AppData=uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor +uk.ac.vamsas.objects.core.Param=uk.ac.vamsas.objects.core.descriptors.ParamDescriptor +uk.ac.vamsas.objects.core.AlignmentSequence=uk.ac.vamsas.objects.core.descriptors.AlignmentSequenceDescriptor +uk.ac.vamsas.objects.core.Link=uk.ac.vamsas.objects.core.descriptors.LinkDescriptor diff --git a/src/uk/ac/vamsas/objects/core/Alignment.java b/src/uk/ac/vamsas/objects/core/Alignment.java index 2bb5ae7..277be27 100644 --- a/src/uk/ac/vamsas/objects/core/Alignment.java +++ b/src/uk/ac/vamsas/objects/core/Alignment.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Alignment. @@ -38,12 +29,12 @@ implements java.io.Serializable //--------------------------/ /** - * Field _gapChar + * Field _gapChar. */ private java.lang.String _gapChar; /** - * Field _aligned + * Field _aligned. */ private boolean _aligned; @@ -59,7 +50,7 @@ implements java.io.Serializable private java.lang.String _id; /** - * Field _modifiable + * Field _modifiable. */ private java.lang.String _modifiable; @@ -71,12 +62,12 @@ implements java.io.Serializable private java.util.Vector _alignmentAnnotationList; /** - * Field _treeList + * Field _treeList. */ private java.util.Vector _treeList; /** - * Field _alignmentSequenceList + * Field _alignmentSequenceList. */ private java.util.Vector _alignmentSequenceList; @@ -87,7 +78,7 @@ implements java.io.Serializable private java.util.Vector _propertyList; /** - * Field _provenance + * Field _provenance. */ private uk.ac.vamsas.objects.core.Provenance _provenance; @@ -96,14 +87,13 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Alignment() - { + public Alignment() { super(); - _alignmentAnnotationList = new Vector(); - _treeList = new Vector(); - _alignmentSequenceList = new Vector(); - _propertyList = new Vector(); - } //-- uk.ac.vamsas.objects.core.Alignment() + this._alignmentAnnotationList = new java.util.Vector(); + this._treeList = new java.util.Vector(); + this._alignmentSequenceList = new java.util.Vector(); + this._propertyList = new java.util.Vector(); + } //-----------/ @@ -111,178 +101,176 @@ implements java.io.Serializable //-----------/ /** - * Method addAlignmentAnnotation - * * * * @param vAlignmentAnnotation + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignmentAnnotation(uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) - throws java.lang.IndexOutOfBoundsException - { - _alignmentAnnotationList.addElement(vAlignmentAnnotation); - } //-- void addAlignmentAnnotation(uk.ac.vamsas.objects.core.AlignmentAnnotation) + public void addAlignmentAnnotation( + final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) + throws java.lang.IndexOutOfBoundsException { + this._alignmentAnnotationList.addElement(vAlignmentAnnotation); + } /** - * Method addAlignmentAnnotation - * * * * @param index * @param vAlignmentAnnotation + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignmentAnnotation(int index, uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) - throws java.lang.IndexOutOfBoundsException - { - _alignmentAnnotationList.insertElementAt(vAlignmentAnnotation, index); - } //-- void addAlignmentAnnotation(int, uk.ac.vamsas.objects.core.AlignmentAnnotation) + public void addAlignmentAnnotation( + final int index, + final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) + throws java.lang.IndexOutOfBoundsException { + this._alignmentAnnotationList.add(index, vAlignmentAnnotation); + } /** - * Method addAlignmentSequence - * * * * @param vAlignmentSequence + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignmentSequence(uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) - throws java.lang.IndexOutOfBoundsException - { - _alignmentSequenceList.addElement(vAlignmentSequence); - } //-- void addAlignmentSequence(uk.ac.vamsas.objects.core.AlignmentSequence) + public void addAlignmentSequence( + final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) + throws java.lang.IndexOutOfBoundsException { + this._alignmentSequenceList.addElement(vAlignmentSequence); + } /** - * Method addAlignmentSequence - * * * * @param index * @param vAlignmentSequence + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignmentSequence(int index, uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) - throws java.lang.IndexOutOfBoundsException - { - _alignmentSequenceList.insertElementAt(vAlignmentSequence, index); - } //-- void addAlignmentSequence(int, uk.ac.vamsas.objects.core.AlignmentSequence) + public void addAlignmentSequence( + final int index, + final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) + throws java.lang.IndexOutOfBoundsException { + this._alignmentSequenceList.add(index, vAlignmentSequence); + } /** - * Method addProperty - * * * * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.addElement(vProperty); - } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + public void addProperty( + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.addElement(vProperty); + } /** - * Method addProperty - * * * * @param index * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.insertElementAt(vProperty, index); - } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + public void addProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.add(index, vProperty); + } /** - * Method addTree - * * * * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.addElement(vTree); - } //-- void addTree(uk.ac.vamsas.objects.core.Tree) + public void addTree( + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.addElement(vTree); + } /** - * Method addTree - * * * * @param index * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(int index, uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.insertElementAt(vTree, index); - } //-- void addTree(int, uk.ac.vamsas.objects.core.Tree) + public void addTree( + final int index, + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.add(index, vTree); + } /** - * Method deleteAligned - * */ - public void deleteAligned() - { + public void deleteAligned( + ) { this._has_aligned= false; - } //-- void deleteAligned() + } /** - * Method enumerateAlignmentAnnotation - * + * Method enumerateAlignmentAnnotation. * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.AlignmentAnnotation elements */ - public java.util.Enumeration enumerateAlignmentAnnotation() - { - return _alignmentAnnotationList.elements(); - } //-- java.util.Enumeration enumerateAlignmentAnnotation() + public java.util.Enumeration enumerateAlignmentAnnotation( + ) { + return this._alignmentAnnotationList.elements(); + } /** - * Method enumerateAlignmentSequence - * - * + * Method enumerateAlignmentSequence. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.AlignmentSequence elements */ - public java.util.Enumeration enumerateAlignmentSequence() - { - return _alignmentSequenceList.elements(); - } //-- java.util.Enumeration enumerateAlignmentSequence() + public java.util.Enumeration enumerateAlignmentSequence( + ) { + return this._alignmentSequenceList.elements(); + } /** - * Method enumerateProperty - * - * + * Method enumerateProperty. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Property elements */ - public java.util.Enumeration enumerateProperty() - { - return _propertyList.elements(); - } //-- java.util.Enumeration enumerateProperty() + public java.util.Enumeration enumerateProperty( + ) { + return this._propertyList.elements(); + } /** - * Method enumerateTree + * Method enumerateTree. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Tree elements */ - public java.util.Enumeration enumerateTree() - { - return _treeList.elements(); - } //-- java.util.Enumeration enumerateTree() + public java.util.Enumeration enumerateTree( + ) { + return this._treeList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -355,125 +343,144 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'aligned'. * - * @return boolean - * @return the value of field 'aligned'. + * @return the value of field 'Aligned'. */ - public boolean getAligned() - { + public boolean getAligned( + ) { return this._aligned; - } //-- boolean getAligned() + } /** - * Method getAlignmentAnnotation - * - * + * Method getAlignmentAnnotation. * * @param index - * @return AlignmentAnnotation - */ - public uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentAnnotationList.size())) { - throw new IndexOutOfBoundsException("getAlignmentAnnotation: Index value '"+index+"' not in range [0.."+_alignmentAnnotationList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * uk.ac.vamsas.objects.core.AlignmentAnnotation at the given + * index + */ + public uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentAnnotationList.size()) { + throw new IndexOutOfBoundsException("getAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(int) + return (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.get(index); + } /** - * Method getAlignmentAnnotation - * + * Method getAlignmentAnnotation.Returns the contents of the + * collection in an Array.

Note: Just in case the + * collection contents are changing in another thread, we pass + * a 0-length Array of the correct type into the API call. + * This way we know that the Array returned is of + * exactly the correct length. * - * - * @return AlignmentAnnotation + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation() - { - int size = _alignmentAnnotationList.size(); - uk.ac.vamsas.objects.core.AlignmentAnnotation[] mArray = new uk.ac.vamsas.objects.core.AlignmentAnnotation[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation() + public uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation( + ) { + uk.ac.vamsas.objects.core.AlignmentAnnotation[] array = new uk.ac.vamsas.objects.core.AlignmentAnnotation[0]; + return (uk.ac.vamsas.objects.core.AlignmentAnnotation[]) this._alignmentAnnotationList.toArray(array); + } /** - * Method getAlignmentAnnotationCount - * + * Method getAlignmentAnnotationAsReference.Returns a reference + * to '_alignmentAnnotationList'. No type checking is performed + * on any modifications to the Vector. * - * - * @return int + * @return a reference to the Vector backing this class */ - public int getAlignmentAnnotationCount() - { - return _alignmentAnnotationList.size(); - } //-- int getAlignmentAnnotationCount() + public java.util.Vector getAlignmentAnnotationAsReference( + ) { + return this._alignmentAnnotationList; + } /** - * Method getAlignmentSequence - * + * Method getAlignmentAnnotationCount. * + * @return the size of this collection + */ + public int getAlignmentAnnotationCount( + ) { + return this._alignmentAnnotationList.size(); + } + + /** + * Method getAlignmentSequence. * * @param index - * @return AlignmentSequence - */ - public uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentSequenceList.size())) { - throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * uk.ac.vamsas.objects.core.AlignmentSequence at the given inde + */ + public uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentSequenceList.size()) { + throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int) + return (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.get(index); + } /** - * Method getAlignmentSequence - * - * + * Method getAlignmentSequence.Returns the contents of the + * collection in an Array.

Note: Just in case the + * collection contents are changing in another thread, we pass + * a 0-length Array of the correct type into the API call. + * This way we know that the Array returned is of + * exactly the correct length. * - * @return AlignmentSequence + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence() - { - int size = _alignmentSequenceList.size(); - uk.ac.vamsas.objects.core.AlignmentSequence[] mArray = new uk.ac.vamsas.objects.core.AlignmentSequence[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence() + public uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence( + ) { + uk.ac.vamsas.objects.core.AlignmentSequence[] array = new uk.ac.vamsas.objects.core.AlignmentSequence[0]; + return (uk.ac.vamsas.objects.core.AlignmentSequence[]) this._alignmentSequenceList.toArray(array); + } /** - * Method getAlignmentSequenceCount - * + * Method getAlignmentSequenceAsReference.Returns a reference + * to '_alignmentSequenceList'. No type checking is performed + * on any modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getAlignmentSequenceAsReference( + ) { + return this._alignmentSequenceList; + } + + /** + * Method getAlignmentSequenceCount. * - * @return int + * @return the size of this collection */ - public int getAlignmentSequenceCount() - { - return _alignmentSequenceList.size(); - } //-- int getAlignmentSequenceCount() + public int getAlignmentSequenceCount( + ) { + return this._alignmentSequenceList.size(); + } /** * Returns the value of field 'gapChar'. * - * @return String - * @return the value of field 'gapChar'. + * @return the value of field 'GapChar'. */ - public java.lang.String getGapChar() - { + public java.lang.String getGapChar( + ) { return this._gapChar; - } //-- java.lang.String getGapChar() + } /** * Returns the value of field 'id'. The field 'id' has the @@ -481,374 +488,522 @@ implements java.io.Serializable * referencing * * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** * Returns the value of field 'modifiable'. * - * @return String - * @return the value of field 'modifiable'. + * @return the value of field 'Modifiable'. */ - public java.lang.String getModifiable() - { + public java.lang.String getModifiable( + ) { return this._modifiable; - } //-- java.lang.String getModifiable() + } /** - * Method getProperty - * - * + * Method getProperty. * * @param index - * @return Property - */ - public uk.ac.vamsas.objects.core.Property getProperty(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Property + * at the given index + */ + public uk.ac.vamsas.objects.core.Property getProperty( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index); + } /** - * Method getProperty - * + * Method getProperty.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return Property + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Property[] getProperty() - { - int size = _propertyList.size(); - uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + public uk.ac.vamsas.objects.core.Property[] getProperty( + ) { + uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0]; + return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array); + } /** - * Method getPropertyCount - * + * Method getPropertyAsReference.Returns a reference to + * '_propertyList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getPropertyAsReference( + ) { + return this._propertyList; + } + + /** + * Method getPropertyCount. * - * @return int + * @return the size of this collection */ - public int getPropertyCount() - { - return _propertyList.size(); - } //-- int getPropertyCount() + public int getPropertyCount( + ) { + return this._propertyList.size(); + } /** * Returns the value of field 'provenance'. * - * @return Provenance - * @return the value of field 'provenance'. + * @return the value of field 'Provenance'. */ - public uk.ac.vamsas.objects.core.Provenance getProvenance() - { + public uk.ac.vamsas.objects.core.Provenance getProvenance( + ) { return this._provenance; - } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + } /** - * Method getTree - * - * + * Method getTree. * * @param index - * @return Tree - */ - public uk.ac.vamsas.objects.core.Tree getTree(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _treeList.size())) { - throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Tree at + * the given index + */ + public uk.ac.vamsas.objects.core.Tree getTree( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) { + throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Tree getTree(int) + return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index); + } /** - * Method getTree - * - * + * Method getTree.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * @return Tree + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Tree[] getTree() - { - int size = _treeList.size(); - uk.ac.vamsas.objects.core.Tree[] mArray = new uk.ac.vamsas.objects.core.Tree[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Tree[] getTree() + public uk.ac.vamsas.objects.core.Tree[] getTree( + ) { + uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0]; + return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array); + } /** - * Method getTreeCount - * + * Method getTreeAsReference.Returns a reference to + * '_treeList'. No type checking is performed on any + * modifications to the Vector. * - * - * @return int + * @return a reference to the Vector backing this class */ - public int getTreeCount() - { - return _treeList.size(); - } //-- int getTreeCount() + public java.util.Vector getTreeAsReference( + ) { + return this._treeList; + } /** - * Method hasAligned - * + * Method getTreeCount. * + * @return the size of this collection + */ + public int getTreeCount( + ) { + return this._treeList.size(); + } + + /** + * Method hasAligned. * - * @return boolean + * @return true if at least one Aligned has been added */ - public boolean hasAligned() - { + public boolean hasAligned( + ) { return this._has_aligned; - } //-- boolean hasAligned() + } /** - * Method isValid + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_gapChar != null) { + result = 37 * result + _gapChar.hashCode(); + } + result = 37 * result + (_aligned?0:1); + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_modifiable != null) { + result = 37 * result + _modifiable.hashCode(); + } + if (_alignmentAnnotationList != null) { + result = 37 * result + _alignmentAnnotationList.hashCode(); + } + if (_treeList != null) { + result = 37 * result + _treeList.hashCode(); + } + if (_alignmentSequenceList != null) { + result = 37 * result + _alignmentSequenceList.hashCode(); + } + if (_propertyList != null) { + result = 37 * result + _propertyList.hashCode(); + } + if (_provenance != null) { + result = 37 * result + _provenance.hashCode(); + } + + return result; + } + + /** + * Returns the value of field 'aligned'. * + * @return the value of field 'Aligned'. + */ + public boolean isAligned( + ) { + return this._aligned; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAlignmentAnnotation - * + * Method removeAlignmentAnnotation. * + * @param vAlignmentAnnotation + * @return true if the object was removed from the collection. + */ + public boolean removeAlignmentAnnotation( + final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) { + boolean removed = _alignmentAnnotationList.remove(vAlignmentAnnotation); + return removed; + } + + /** + * Method removeAlignmentAnnotationAt. * * @param index - * @return AlignmentAnnotation + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotation(int index) - { - java.lang.Object obj = _alignmentAnnotationList.elementAt(index); - _alignmentAnnotationList.removeElementAt(index); + public uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotationAt( + final int index) { + java.lang.Object obj = this._alignmentAnnotationList.remove(index); return (uk.ac.vamsas.objects.core.AlignmentAnnotation) obj; - } //-- uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotation(int) + } /** - * Method removeAlignmentSequence - * + * Method removeAlignmentSequence. * + * @param vAlignmentSequence + * @return true if the object was removed from the collection. + */ + public boolean removeAlignmentSequence( + final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) { + boolean removed = _alignmentSequenceList.remove(vAlignmentSequence); + return removed; + } + + /** + * Method removeAlignmentSequenceAt. * * @param index - * @return AlignmentSequence + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int index) - { - java.lang.Object obj = _alignmentSequenceList.elementAt(index); - _alignmentSequenceList.removeElementAt(index); + public uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequenceAt( + final int index) { + java.lang.Object obj = this._alignmentSequenceList.remove(index); return (uk.ac.vamsas.objects.core.AlignmentSequence) obj; - } //-- uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int) + } /** - * Method removeAllAlignmentAnnotation - * */ - public void removeAllAlignmentAnnotation() - { - _alignmentAnnotationList.removeAllElements(); - } //-- void removeAllAlignmentAnnotation() + public void removeAllAlignmentAnnotation( + ) { + this._alignmentAnnotationList.clear(); + } /** - * Method removeAllAlignmentSequence - * */ - public void removeAllAlignmentSequence() - { - _alignmentSequenceList.removeAllElements(); - } //-- void removeAllAlignmentSequence() + public void removeAllAlignmentSequence( + ) { + this._alignmentSequenceList.clear(); + } /** - * Method removeAllProperty - * */ - public void removeAllProperty() - { - _propertyList.removeAllElements(); - } //-- void removeAllProperty() + public void removeAllProperty( + ) { + this._propertyList.clear(); + } /** - * Method removeAllTree - * */ - public void removeAllTree() - { - _treeList.removeAllElements(); - } //-- void removeAllTree() + public void removeAllTree( + ) { + this._treeList.clear(); + } /** - * Method removeProperty - * + * Method removeProperty. * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final uk.ac.vamsas.objects.core.Property vProperty) { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. * * @param index - * @return Property + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Property removeProperty(int index) - { - java.lang.Object obj = _propertyList.elementAt(index); - _propertyList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Property removePropertyAt( + final int index) { + java.lang.Object obj = this._propertyList.remove(index); return (uk.ac.vamsas.objects.core.Property) obj; - } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + } /** - * Method removeTree - * + * Method removeTree. * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree( + final uk.ac.vamsas.objects.core.Tree vTree) { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. * * @param index - * @return Tree + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Tree removeTree(int index) - { - java.lang.Object obj = _treeList.elementAt(index); - _treeList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Tree removeTreeAt( + final int index) { + java.lang.Object obj = this._treeList.remove(index); return (uk.ac.vamsas.objects.core.Tree) obj; - } //-- uk.ac.vamsas.objects.core.Tree removeTree(int) + } /** * Sets the value of field 'aligned'. * * @param aligned the value of field 'aligned'. */ - public void setAligned(boolean aligned) - { + public void setAligned( + final boolean aligned) { this._aligned = aligned; this._has_aligned = true; - } //-- void setAligned(boolean) + } /** - * Method setAlignmentAnnotation - * * * * @param index * @param vAlignmentAnnotation - */ - public void setAlignmentAnnotation(int index, uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentAnnotationList.size())) { - throw new IndexOutOfBoundsException("setAlignmentAnnotation: Index value '"+index+"' not in range [0.."+_alignmentAnnotationList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setAlignmentAnnotation( + final int index, + final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentAnnotationList.size()) { + throw new IndexOutOfBoundsException("setAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]"); } - _alignmentAnnotationList.setElementAt(vAlignmentAnnotation, index); - } //-- void setAlignmentAnnotation(int, uk.ac.vamsas.objects.core.AlignmentAnnotation) + + this._alignmentAnnotationList.set(index, vAlignmentAnnotation); + } /** - * Method setAlignmentAnnotation * * - * - * @param alignmentAnnotationArray + * @param vAlignmentAnnotationArray */ - public void setAlignmentAnnotation(uk.ac.vamsas.objects.core.AlignmentAnnotation[] alignmentAnnotationArray) - { + public void setAlignmentAnnotation( + final uk.ac.vamsas.objects.core.AlignmentAnnotation[] vAlignmentAnnotationArray) { //-- copy array - _alignmentAnnotationList.removeAllElements(); - for (int i = 0; i < alignmentAnnotationArray.length; i++) { - _alignmentAnnotationList.addElement(alignmentAnnotationArray[i]); + _alignmentAnnotationList.clear(); + + for (int i = 0; i < vAlignmentAnnotationArray.length; i++) { + this._alignmentAnnotationList.add(vAlignmentAnnotationArray[i]); } - } //-- void setAlignmentAnnotation(uk.ac.vamsas.objects.core.AlignmentAnnotation) + } /** - * Method setAlignmentSequence + * Sets the value of '_alignmentAnnotationList' by copying the + * given Vector. All elements will be checked for type safety. * + * @param vAlignmentAnnotationList the Vector to copy. + */ + public void setAlignmentAnnotation( + final java.util.Vector vAlignmentAnnotationList) { + // copy vector + this._alignmentAnnotationList.clear(); + + this._alignmentAnnotationList.addAll(vAlignmentAnnotationList); + } + + /** + * Sets the value of '_alignmentAnnotationList' by setting it + * to the given Vector. No type checking is performed. + * @deprecated + * + * @param alignmentAnnotationVector the Vector to set. + */ + public void setAlignmentAnnotationAsReference( + final java.util.Vector alignmentAnnotationVector) { + this._alignmentAnnotationList = alignmentAnnotationVector; + } + + /** * * * @param index * @param vAlignmentSequence - */ - public void setAlignmentSequence(int index, uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentSequenceList.size())) { - throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setAlignmentSequence( + final int index, + final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentSequenceList.size()) { + throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]"); } - _alignmentSequenceList.setElementAt(vAlignmentSequence, index); - } //-- void setAlignmentSequence(int, uk.ac.vamsas.objects.core.AlignmentSequence) + + this._alignmentSequenceList.set(index, vAlignmentSequence); + } /** - * Method setAlignmentSequence * * - * - * @param alignmentSequenceArray + * @param vAlignmentSequenceArray */ - public void setAlignmentSequence(uk.ac.vamsas.objects.core.AlignmentSequence[] alignmentSequenceArray) - { + public void setAlignmentSequence( + final uk.ac.vamsas.objects.core.AlignmentSequence[] vAlignmentSequenceArray) { //-- copy array - _alignmentSequenceList.removeAllElements(); - for (int i = 0; i < alignmentSequenceArray.length; i++) { - _alignmentSequenceList.addElement(alignmentSequenceArray[i]); + _alignmentSequenceList.clear(); + + for (int i = 0; i < vAlignmentSequenceArray.length; i++) { + this._alignmentSequenceList.add(vAlignmentSequenceArray[i]); } - } //-- void setAlignmentSequence(uk.ac.vamsas.objects.core.AlignmentSequence) + } + + /** + * Sets the value of '_alignmentSequenceList' by copying the + * given Vector. All elements will be checked for type safety. + * + * @param vAlignmentSequenceList the Vector to copy. + */ + public void setAlignmentSequence( + final java.util.Vector vAlignmentSequenceList) { + // copy vector + this._alignmentSequenceList.clear(); + + this._alignmentSequenceList.addAll(vAlignmentSequenceList); + } + + /** + * Sets the value of '_alignmentSequenceList' by setting it to + * the given Vector. No type checking is performed. + * @deprecated + * + * @param alignmentSequenceVector the Vector to set. + */ + public void setAlignmentSequenceAsReference( + final java.util.Vector alignmentSequenceVector) { + this._alignmentSequenceList = alignmentSequenceVector; + } /** * Sets the value of field 'gapChar'. * * @param gapChar the value of field 'gapChar'. */ - public void setGapChar(java.lang.String gapChar) - { + public void setGapChar( + final java.lang.String gapChar) { this._gapChar = gapChar; - } //-- void setGapChar(java.lang.String) + } /** * Sets the value of field 'id'. The field 'id' has the @@ -858,122 +1013,180 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'modifiable'. * * @param modifiable the value of field 'modifiable'. */ - public void setModifiable(java.lang.String modifiable) - { + public void setModifiable( + final java.lang.String modifiable) { this._modifiable = modifiable; - } //-- void setModifiable(java.lang.String) + } /** - * Method setProperty - * * * * @param index * @param vProperty - */ - public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - _propertyList.setElementAt(vProperty, index); - } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + this._propertyList.set(index, vProperty); + } /** - * Method setProperty - * * * - * @param propertyArray + * @param vPropertyArray */ - public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) - { + public void setProperty( + final uk.ac.vamsas.objects.core.Property[] vPropertyArray) { //-- copy array - _propertyList.removeAllElements(); - for (int i = 0; i < propertyArray.length; i++) { - _propertyList.addElement(propertyArray[i]); + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) { + this._propertyList.add(vPropertyArray[i]); } - } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + } + + /** + * Sets the value of '_propertyList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vPropertyList the Vector to copy. + */ + public void setProperty( + final java.util.Vector vPropertyList) { + // copy vector + this._propertyList.clear(); + + this._propertyList.addAll(vPropertyList); + } + + /** + * Sets the value of '_propertyList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param propertyVector the Vector to set. + */ + public void setPropertyAsReference( + final java.util.Vector propertyVector) { + this._propertyList = propertyVector; + } /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. */ - public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) - { + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { this._provenance = provenance; - } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + } /** - * Method setTree - * * * * @param index * @param vTree - */ - public void setTree(int index, uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _treeList.size())) { - throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setTree( + final int index, + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) { + throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); } - _treeList.setElementAt(vTree, index); - } //-- void setTree(int, uk.ac.vamsas.objects.core.Tree) + + this._treeList.set(index, vTree); + } /** - * Method setTree * * - * - * @param treeArray + * @param vTreeArray */ - public void setTree(uk.ac.vamsas.objects.core.Tree[] treeArray) - { + public void setTree( + final uk.ac.vamsas.objects.core.Tree[] vTreeArray) { //-- copy array - _treeList.removeAllElements(); - for (int i = 0; i < treeArray.length; i++) { - _treeList.addElement(treeArray[i]); + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) { + this._treeList.add(vTreeArray[i]); } - } //-- void setTree(uk.ac.vamsas.objects.core.Tree) + } /** - * Method unmarshal + * Sets the value of '_treeList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vTreeList the Vector to copy. + */ + public void setTree( + final java.util.Vector vTreeList) { + // copy vector + this._treeList.clear(); + + this._treeList.addAll(vTreeList); + } + + /** + * Sets the value of '_treeList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated * + * @param treeVector the Vector to set. + */ + public void setTreeAsReference( + final java.util.Vector treeVector) { + this._treeList = treeVector; + } + + /** + * Method unmarshal. * * @param reader - * @return Alignment - */ - public static uk.ac.vamsas.objects.core.Alignment unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Alignment + */ + public static uk.ac.vamsas.objects.core.Alignment unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Alignment.class, reader); - } //-- uk.ac.vamsas.objects.core.Alignment unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java b/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java index 0177f31..17e7c78 100644 --- a/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java +++ b/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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; /** * This is annotation over the coordinate frame @@ -51,7 +44,7 @@ implements java.io.Serializable private boolean _has_graph; /** - * Field _provenance + * Field _provenance. */ private uk.ac.vamsas.objects.core.Provenance _provenance; @@ -60,10 +53,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public AlignmentAnnotation() - { + public AlignmentAnnotation() { super(); - } //-- uk.ac.vamsas.objects.core.AlignmentAnnotation() + } //-----------/ @@ -71,22 +63,20 @@ implements java.io.Serializable //-----------/ /** - * Method deleteGraph - * */ - public void deleteGraph() - { + public void deleteGraph( + ) { this._has_graph= false; - } //-- void deleteGraph() + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -110,7 +100,7 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'graph'. The field 'graph' has @@ -119,82 +109,114 @@ implements java.io.Serializable * the annotationElement values together form a * graph * - * @return boolean - * @return the value of field 'graph'. + * @return the value of field 'Graph'. */ - public boolean getGraph() - { + public boolean getGraph( + ) { return this._graph; - } //-- boolean getGraph() + } /** * Returns the value of field 'provenance'. * - * @return Provenance - * @return the value of field 'provenance'. + * @return the value of field 'Provenance'. */ - public uk.ac.vamsas.objects.core.Provenance getProvenance() - { + public uk.ac.vamsas.objects.core.Provenance getProvenance( + ) { return this._provenance; - } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + } /** - * Method hasGraph - * + * Method hasGraph. * - * - * @return boolean + * @return true if at least one Graph has been added */ - public boolean hasGraph() - { + public boolean hasGraph( + ) { return this._has_graph; - } //-- boolean hasGraph() + } /** - * Method isValid + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + (_graph?0:1); + if (_provenance != null) { + result = 37 * result + _provenance.hashCode(); + } + + return result; + } + + /** + * Returns the value of field 'graph'. The field 'graph' has + * the following description: TODO: decide if this flag is + * redundant - when true it would suggest that + * the annotationElement values together form a + * graph * + * @return the value of field 'Graph'. + */ + public boolean isGraph( + ) { + return this._graph; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'graph'. The field 'graph' has the @@ -205,45 +227,49 @@ implements java.io.Serializable * * @param graph the value of field 'graph'. */ - public void setGraph(boolean graph) - { + public void setGraph( + final boolean graph) { this._graph = graph; this._has_graph = true; - } //-- void setGraph(boolean) + } /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. */ - public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) - { + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { this._provenance = provenance; - } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return RangeType + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType */ - public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.AlignmentAnnotation) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentAnnotation.class, reader); - } //-- uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.RangeType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentAnnotation.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/AlignmentSequence.java b/src/uk/ac/vamsas/objects/core/AlignmentSequence.java index b1fdd53..a476961 100644 --- a/src/uk/ac/vamsas/objects/core/AlignmentSequence.java +++ b/src/uk/ac/vamsas/objects/core/AlignmentSequence.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 AlignmentSequence. @@ -51,7 +42,7 @@ implements java.io.Serializable private java.lang.Object _refid; /** - * Field _alignmentSequenceAnnotationList + * Field _alignmentSequenceAnnotationList. */ private java.util.Vector _alignmentSequenceAnnotationList; @@ -60,11 +51,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public AlignmentSequence() - { + public AlignmentSequence() { super(); - _alignmentSequenceAnnotationList = new Vector(); - } //-- uk.ac.vamsas.objects.core.AlignmentSequence() + this._alignmentSequenceAnnotationList = new java.util.Vector(); + } //-----------/ @@ -72,52 +62,52 @@ implements java.io.Serializable //-----------/ /** - * Method addAlignmentSequenceAnnotation - * * * * @param vAlignmentSequenceAnnotation + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignmentSequenceAnnotation(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) - throws java.lang.IndexOutOfBoundsException - { - _alignmentSequenceAnnotationList.addElement(vAlignmentSequenceAnnotation); - } //-- void addAlignmentSequenceAnnotation(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) + public void addAlignmentSequenceAnnotation( + final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) + throws java.lang.IndexOutOfBoundsException { + this._alignmentSequenceAnnotationList.addElement(vAlignmentSequenceAnnotation); + } /** - * Method addAlignmentSequenceAnnotation - * * * * @param index * @param vAlignmentSequenceAnnotation + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignmentSequenceAnnotation(int index, uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) - throws java.lang.IndexOutOfBoundsException - { - _alignmentSequenceAnnotationList.insertElementAt(vAlignmentSequenceAnnotation, index); - } //-- void addAlignmentSequenceAnnotation(int, uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) + public void addAlignmentSequenceAnnotation( + final int index, + final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) + throws java.lang.IndexOutOfBoundsException { + this._alignmentSequenceAnnotationList.add(index, vAlignmentSequenceAnnotation); + } /** - * Method enumerateAlignmentSequenceAnnotation - * - * + * Method enumerateAlignmentSequenceAnnotation. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation element */ - public java.util.Enumeration enumerateAlignmentSequenceAnnotation() - { - return _alignmentSequenceAnnotationList.elements(); - } //-- java.util.Enumeration enumerateAlignmentSequenceAnnotation() + public java.util.Enumeration enumerateAlignmentSequenceAnnotation( + ) { + return this._alignmentSequenceAnnotationList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -151,68 +141,78 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** - * Method getAlignmentSequenceAnnotation - * - * + * Method getAlignmentSequenceAnnotation. * * @param index - * @return AlignmentSequenceAnnotation + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation at the + * given index */ - public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentSequenceAnnotationList.size())) { - throw new IndexOutOfBoundsException("getAlignmentSequenceAnnotation: Index value '"+index+"' not in range [0.."+_alignmentSequenceAnnotationList.size()+ "]"); + public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentSequenceAnnotationList.size()) { + throw new IndexOutOfBoundsException("getAlignmentSequenceAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceAnnotationList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(int) + return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.get(index); + } /** - * Method getAlignmentSequenceAnnotation - * - * - * - * @return AlignmentSequenceAnnotation + * Method getAlignmentSequenceAnnotation.Returns the contents + * of the collection in an Array.

Note: Just in case the + * collection contents are changing in another thread, we pass + * a 0-length Array of the correct type into the API call. + * This way we know that the Array returned is of + * exactly the correct length. + * + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation() - { - int size = _alignmentSequenceAnnotationList.size(); - uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] mArray = new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation() + public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation( + ) { + uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] array = new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[0]; + return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[]) this._alignmentSequenceAnnotationList.toArray(array); + } /** - * Method getAlignmentSequenceAnnotationCount - * + * Method getAlignmentSequenceAnnotationAsReference.Returns a + * reference to '_alignmentSequenceAnnotationList'. No type + * checking is performed on any modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getAlignmentSequenceAnnotationAsReference( + ) { + return this._alignmentSequenceAnnotationList; + } + + /** + * Method getAlignmentSequenceAnnotationCount. * - * @return int + * @return the size of this collection */ - public int getAlignmentSequenceAnnotationCount() - { - return _alignmentSequenceAnnotationList.size(); - } //-- int getAlignmentSequenceAnnotationCount() + public int getAlignmentSequenceAnnotationCount( + ) { + return this._alignmentSequenceAnnotationList.size(); + } /** * Returns the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object * referencing * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** * Returns the value of field 'refid'. The field 'refid' has @@ -220,117 +220,179 @@ implements java.io.Serializable * this alignment sequence is taken from * * - * @return Object - * @return the value of field 'refid'. + * @return the value of field 'Refid'. */ - public java.lang.Object getRefid() - { + public java.lang.Object getRefid( + ) { return this._refid; - } //-- java.lang.Object getRefid() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_refid != null) { + result = 37 * result + _refid.hashCode(); + } + if (_alignmentSequenceAnnotationList != null) { + result = 37 * result + _alignmentSequenceAnnotationList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 removeAlignmentSequenceAnnotation - * + * Method removeAlignmentSequenceAnnotation. * + * @param vAlignmentSequenceAnnotation + * @return true if the object was removed from the collection. + */ + public boolean removeAlignmentSequenceAnnotation( + final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) { + boolean removed = _alignmentSequenceAnnotationList.remove(vAlignmentSequenceAnnotation); + return removed; + } + + /** + * Method removeAlignmentSequenceAnnotationAt. * * @param index - * @return AlignmentSequenceAnnotation + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotation(int index) - { - java.lang.Object obj = _alignmentSequenceAnnotationList.elementAt(index); - _alignmentSequenceAnnotationList.removeElementAt(index); + public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotationAt( + final int index) { + java.lang.Object obj = this._alignmentSequenceAnnotationList.remove(index); return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) obj; - } //-- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotation(int) + } /** - * Method removeAllAlignmentSequenceAnnotation - * */ - public void removeAllAlignmentSequenceAnnotation() - { - _alignmentSequenceAnnotationList.removeAllElements(); - } //-- void removeAllAlignmentSequenceAnnotation() + public void removeAllAlignmentSequenceAnnotation( + ) { + this._alignmentSequenceAnnotationList.clear(); + } /** - * Method setAlignmentSequenceAnnotation - * * * * @param index * @param vAlignmentSequenceAnnotation + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setAlignmentSequenceAnnotation(int index, uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentSequenceAnnotationList.size())) { - throw new IndexOutOfBoundsException("setAlignmentSequenceAnnotation: Index value '"+index+"' not in range [0.."+_alignmentSequenceAnnotationList.size()+ "]"); + public void setAlignmentSequenceAnnotation( + final int index, + final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentSequenceAnnotationList.size()) { + throw new IndexOutOfBoundsException("setAlignmentSequenceAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceAnnotationList.size() - 1) + "]"); } - _alignmentSequenceAnnotationList.setElementAt(vAlignmentSequenceAnnotation, index); - } //-- void setAlignmentSequenceAnnotation(int, uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) + + this._alignmentSequenceAnnotationList.set(index, vAlignmentSequenceAnnotation); + } /** - * Method setAlignmentSequenceAnnotation - * * * - * @param alignmentSequenceAnnotationArray + * @param vAlignmentSequenceAnnotationArray */ - public void setAlignmentSequenceAnnotation(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] alignmentSequenceAnnotationArray) - { + public void setAlignmentSequenceAnnotation( + final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] vAlignmentSequenceAnnotationArray) { //-- copy array - _alignmentSequenceAnnotationList.removeAllElements(); - for (int i = 0; i < alignmentSequenceAnnotationArray.length; i++) { - _alignmentSequenceAnnotationList.addElement(alignmentSequenceAnnotationArray[i]); + _alignmentSequenceAnnotationList.clear(); + + for (int i = 0; i < vAlignmentSequenceAnnotationArray.length; i++) { + this._alignmentSequenceAnnotationList.add(vAlignmentSequenceAnnotationArray[i]); } - } //-- void setAlignmentSequenceAnnotation(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) + } + + /** + * Sets the value of '_alignmentSequenceAnnotationList' by + * copying the given Vector. All elements will be checked for + * type safety. + * + * @param vAlignmentSequenceAnnotationList the Vector to copy. + */ + public void setAlignmentSequenceAnnotation( + final java.util.Vector vAlignmentSequenceAnnotationList) { + // copy vector + this._alignmentSequenceAnnotationList.clear(); + + this._alignmentSequenceAnnotationList.addAll(vAlignmentSequenceAnnotationList); + } + + /** + * Sets the value of '_alignmentSequenceAnnotationList' by + * setting it to the given Vector. No type checking is + * performed. + * @deprecated + * + * @param alignmentSequenceAnnotationVector the Vector to set. + */ + public void setAlignmentSequenceAnnotationAsReference( + final java.util.Vector alignmentSequenceAnnotationVector) { + this._alignmentSequenceAnnotationList = alignmentSequenceAnnotationVector; + } /** * Sets the value of field 'id'. The field 'id' has the @@ -339,10 +401,10 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'refid'. The field 'refid' has the @@ -352,34 +414,38 @@ implements java.io.Serializable * * @param refid the value of field 'refid'. */ - public void setRefid(java.lang.Object refid) - { + public void setRefid( + final java.lang.Object refid) { this._refid = refid; - } //-- void setRefid(java.lang.Object) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return SequenceType + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.SequenceTyp */ - public static uk.ac.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.AlignmentSequence) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequence.class, reader); - } //-- uk.ac.vamsas.objects.core.SequenceType unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.SequenceType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequence.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java index 4be2cf6..64417fe 100644 --- a/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java +++ b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 AlignmentSequenceAnnotation. @@ -52,7 +45,7 @@ implements java.io.Serializable private boolean _has_graph; /** - * Field _provenance + * Field _provenance. */ private uk.ac.vamsas.objects.core.Provenance _provenance; @@ -61,10 +54,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public AlignmentSequenceAnnotation() - { + public AlignmentSequenceAnnotation() { super(); - } //-- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation() + } //-----------/ @@ -72,22 +64,20 @@ implements java.io.Serializable //-----------/ /** - * Method deleteGraph - * */ - public void deleteGraph() - { + public void deleteGraph( + ) { this._has_graph= false; - } //-- void deleteGraph() + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -111,7 +101,7 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'graph'. The field 'graph' has @@ -123,82 +113,117 @@ implements java.io.Serializable * together form a graph * * - * @return boolean - * @return the value of field 'graph'. + * @return the value of field 'Graph'. */ - public boolean getGraph() - { + public boolean getGraph( + ) { return this._graph; - } //-- boolean getGraph() + } /** * Returns the value of field 'provenance'. * - * @return Provenance - * @return the value of field 'provenance'. + * @return the value of field 'Provenance'. */ - public uk.ac.vamsas.objects.core.Provenance getProvenance() - { + public uk.ac.vamsas.objects.core.Provenance getProvenance( + ) { return this._provenance; - } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + } /** - * Method hasGraph - * + * Method hasGraph. * - * - * @return boolean + * @return true if at least one Graph has been added */ - public boolean hasGraph() - { + public boolean hasGraph( + ) { return this._has_graph; - } //-- boolean hasGraph() + } /** - * Method isValid + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + (_graph?0:1); + if (_provenance != null) { + result = 37 * result + _provenance.hashCode(); + } + + return result; + } + + /** + * Returns the value of field 'graph'. The field 'graph' has + * the following description: TODO: + * decide if this flag is + * redundant - when true it + * would suggest that the + * annotationElement values + * together form a graph + * * + * @return the value of field 'Graph'. + */ + public boolean isGraph( + ) { + return this._graph; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'graph'. The field 'graph' has the @@ -212,45 +237,49 @@ implements java.io.Serializable * * @param graph the value of field 'graph'. */ - public void setGraph(boolean graph) - { + public void setGraph( + final boolean graph) { this._graph = graph; this._has_graph = true; - } //-- void setGraph(boolean) + } /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. */ - public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) - { + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { this._provenance = provenance; - } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return RangeType + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType */ - public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, reader); - } //-- uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.RangeType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/AnnotationElement.java b/src/uk/ac/vamsas/objects/core/AnnotationElement.java index ff2e6fb..a53f1ee 100644 --- a/src/uk/ac/vamsas/objects/core/AnnotationElement.java +++ b/src/uk/ac/vamsas/objects/core/AnnotationElement.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 AnnotationElement. @@ -41,7 +32,7 @@ implements java.io.Serializable * position with respect to the coordinate frame defined by a * rangeType specification */ - private int _position; + private long _position; /** * keeps track of state for field: _position @@ -91,12 +82,11 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public AnnotationElement() - { + public AnnotationElement() { super(); - _glyphList = new Vector(); - _valueList = new Vector(); - } //-- uk.ac.vamsas.objects.core.AnnotationElement() + this._glyphList = new java.util.Vector(); + this._valueList = new java.util.Vector(); + } //-----------/ @@ -104,109 +94,104 @@ implements java.io.Serializable //-----------/ /** - * Method addGlyph - * * * * @param vGlyph + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addGlyph(uk.ac.vamsas.objects.core.Glyph vGlyph) - throws java.lang.IndexOutOfBoundsException - { - _glyphList.addElement(vGlyph); - } //-- void addGlyph(uk.ac.vamsas.objects.core.Glyph) + public void addGlyph( + final uk.ac.vamsas.objects.core.Glyph vGlyph) + throws java.lang.IndexOutOfBoundsException { + this._glyphList.addElement(vGlyph); + } /** - * Method addGlyph - * * * * @param index * @param vGlyph + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addGlyph(int index, uk.ac.vamsas.objects.core.Glyph vGlyph) - throws java.lang.IndexOutOfBoundsException - { - _glyphList.insertElementAt(vGlyph, index); - } //-- void addGlyph(int, uk.ac.vamsas.objects.core.Glyph) + public void addGlyph( + final int index, + final uk.ac.vamsas.objects.core.Glyph vGlyph) + throws java.lang.IndexOutOfBoundsException { + this._glyphList.add(index, vGlyph); + } /** - * Method addValue - * * * * @param vValue + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addValue(float vValue) - throws java.lang.IndexOutOfBoundsException - { - _valueList.addElement(new java.lang.Float(vValue)); - } //-- void addValue(float) + public void addValue( + final float vValue) + throws java.lang.IndexOutOfBoundsException { + this._valueList.addElement(new java.lang.Float(vValue)); + } /** - * Method addValue - * * * * @param index * @param vValue + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addValue(int index, float vValue) - throws java.lang.IndexOutOfBoundsException - { - _valueList.insertElementAt(new java.lang.Float(vValue), index); - } //-- void addValue(int, float) + public void addValue( + final int index, + final float vValue) + throws java.lang.IndexOutOfBoundsException { + this._valueList.add(index, new java.lang.Float(vValue)); + } /** - * Method deleteAfter - * */ - public void deleteAfter() - { + public void deleteAfter( + ) { this._has_after= false; - } //-- void deleteAfter() + } /** - * Method deletePosition - * */ - public void deletePosition() - { + public void deletePosition( + ) { this._has_position= false; - } //-- void deletePosition() + } /** - * Method enumerateGlyph + * Method enumerateGlyph. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Glyph elements */ - public java.util.Enumeration enumerateGlyph() - { - return _glyphList.elements(); - } //-- java.util.Enumeration enumerateGlyph() + public java.util.Enumeration enumerateGlyph( + ) { + return this._glyphList.elements(); + } /** - * Method enumerateValue - * + * Method enumerateValue. * - * - * @return Enumeration + * @return an Enumeration over all float elements */ - public java.util.Enumeration enumerateValue() - { - return _valueList.elements(); - } //-- java.util.Enumeration enumerateValue() + public java.util.Enumeration enumerateValue( + ) { + return this._valueList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -255,7 +240,7 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'after'. The field 'after' has @@ -263,87 +248,93 @@ implements java.io.Serializable * appears between the * specified position and the next * - * @return boolean - * @return the value of field 'after'. + * @return the value of field 'After'. */ - public boolean getAfter() - { + public boolean getAfter( + ) { return this._after; - } //-- boolean getAfter() + } /** * Returns the value of field 'description'. The field * 'description' has the following description: Free text at * this position * - * @return String - * @return the value of field 'description'. + * @return the value of field 'Description'. */ - public java.lang.String getDescription() - { + public java.lang.String getDescription( + ) { return this._description; - } //-- java.lang.String getDescription() + } /** - * Method getGlyph - * - * + * Method getGlyph. * * @param index - * @return Glyph - */ - public uk.ac.vamsas.objects.core.Glyph getGlyph(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _glyphList.size())) { - throw new IndexOutOfBoundsException("getGlyph: Index value '"+index+"' not in range [0.."+_glyphList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Glyph at + * the given index + */ + public uk.ac.vamsas.objects.core.Glyph getGlyph( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._glyphList.size()) { + throw new IndexOutOfBoundsException("getGlyph: Index value '" + index + "' not in range [0.." + (this._glyphList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Glyph) _glyphList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Glyph getGlyph(int) + return (uk.ac.vamsas.objects.core.Glyph) _glyphList.get(index); + } /** - * Method getGlyph + * Method getGlyph.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * - * @return Glyph + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Glyph[] getGlyph() - { - int size = _glyphList.size(); - uk.ac.vamsas.objects.core.Glyph[] mArray = new uk.ac.vamsas.objects.core.Glyph[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Glyph) _glyphList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Glyph[] getGlyph() + public uk.ac.vamsas.objects.core.Glyph[] getGlyph( + ) { + uk.ac.vamsas.objects.core.Glyph[] array = new uk.ac.vamsas.objects.core.Glyph[0]; + return (uk.ac.vamsas.objects.core.Glyph[]) this._glyphList.toArray(array); + } /** - * Method getGlyphCount - * + * Method getGlyphAsReference.Returns a reference to + * '_glyphList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getGlyphAsReference( + ) { + return this._glyphList; + } + + /** + * Method getGlyphCount. * - * @return int + * @return the size of this collection */ - public int getGlyphCount() - { - return _glyphList.size(); - } //-- int getGlyphCount() + public int getGlyphCount( + ) { + return this._glyphList.size(); + } /** * Returns the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object * referencing * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** * Returns the value of field 'position'. The field 'position' @@ -351,179 +342,243 @@ implements java.io.Serializable * coordinate frame defined by a * rangeType specification * - * @return int - * @return the value of field 'position'. + * @return the value of field 'Position'. */ - public int getPosition() - { + public long getPosition( + ) { return this._position; - } //-- int getPosition() + } /** - * Method getValue - * - * + * Method getValue. * * @param index - * @return float - */ - public float getValue(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _valueList.size())) { - throw new IndexOutOfBoundsException("getValue: Index value '"+index+"' not in range [0.."+_valueList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the float at the given index + */ + public float getValue( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._valueList.size()) { + throw new IndexOutOfBoundsException("getValue: Index value '" + index + "' not in range [0.." + (this._valueList.size() - 1) + "]"); } - return ((java.lang.Float)_valueList.elementAt(index)).floatValue(); - } //-- float getValue(int) + return ((java.lang.Float) _valueList.get(index)).floatValue(); + } /** - * Method getValue - * - * + * Method getValue.Returns the contents of the collection in an + * Array. * - * @return float + * @return this collection as an Array */ - public float[] getValue() - { - int size = _valueList.size(); - float[] mArray = new float[size]; + public float[] getValue( + ) { + int size = this._valueList.size(); + float[] array = new float[size]; + java.util.Iterator iter = _valueList.iterator(); for (int index = 0; index < size; index++) { - mArray[index] = ((java.lang.Float)_valueList.elementAt(index)).floatValue(); + array[index] = ((java.lang.Float) iter.next()).floatValue(); } - return mArray; - } //-- float[] getValue() + return array; + } /** - * Method getValueCount + * Method getValueAsReference.Returns a reference to + * '_valueList'. No type checking is performed on any + * modifications to the Vector. * - * - * - * @return int + * @return a reference to the Vector backing this class */ - public int getValueCount() - { - return _valueList.size(); - } //-- int getValueCount() + public java.util.Vector getValueAsReference( + ) { + return this._valueList; + } /** - * Method hasAfter - * + * Method getValueCount. * + * @return the size of this collection + */ + public int getValueCount( + ) { + return this._valueList.size(); + } + + /** + * Method hasAfter. * - * @return boolean + * @return true if at least one After has been added */ - public boolean hasAfter() - { + public boolean hasAfter( + ) { return this._has_after; - } //-- boolean hasAfter() + } /** - * Method hasPosition + * Method hasPosition. * - * - * - * @return boolean + * @return true if at least one Position has been added */ - public boolean hasPosition() - { + public boolean hasPosition( + ) { return this._has_position; - } //-- boolean hasPosition() + } /** - * Method isValid + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + (int)(_position^(_position>>>32)); + result = 37 * result + (_after?0:1); + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_description != null) { + result = 37 * result + _description.hashCode(); + } + if (_glyphList != null) { + result = 37 * result + _glyphList.hashCode(); + } + if (_valueList != null) { + result = 37 * result + _valueList.hashCode(); + } + + return result; + } + + /** + * Returns the value of field 'after'. The field 'after' has + * the following description: true means the annotation element + * appears between the + * specified position and the next * + * @return the value of field 'After'. + */ + public boolean isAfter( + ) { + return this._after; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAllGlyph - * */ - public void removeAllGlyph() - { - _glyphList.removeAllElements(); - } //-- void removeAllGlyph() + public void removeAllGlyph( + ) { + this._glyphList.clear(); + } /** - * Method removeAllValue - * */ - public void removeAllValue() - { - _valueList.removeAllElements(); - } //-- void removeAllValue() + public void removeAllValue( + ) { + this._valueList.clear(); + } /** - * Method removeGlyph - * + * Method removeGlyph. * + * @param vGlyph + * @return true if the object was removed from the collection. + */ + public boolean removeGlyph( + final uk.ac.vamsas.objects.core.Glyph vGlyph) { + boolean removed = _glyphList.remove(vGlyph); + return removed; + } + + /** + * Method removeGlyphAt. * * @param index - * @return Glyph + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Glyph removeGlyph(int index) - { - java.lang.Object obj = _glyphList.elementAt(index); - _glyphList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Glyph removeGlyphAt( + final int index) { + java.lang.Object obj = this._glyphList.remove(index); return (uk.ac.vamsas.objects.core.Glyph) obj; - } //-- uk.ac.vamsas.objects.core.Glyph removeGlyph(int) + } /** - * Method removeValue - * + * Method removeValue. * + * @param vValue + * @return true if the object was removed from the collection. + */ + public boolean removeValue( + final float vValue) { + boolean removed = _valueList.remove(new java.lang.Float(vValue)); + return removed; + } + + /** + * Method removeValueAt. * * @param index - * @return float + * @return the element removed from the collection */ - public float removeValue(int index) - { - java.lang.Object obj = _valueList.elementAt(index); - _valueList.removeElementAt(index); - return ((java.lang.Float)obj).floatValue(); - } //-- float removeValue(int) + public float removeValueAt( + final int index) { + java.lang.Object obj = this._valueList.remove(index); + return ((java.lang.Float) obj).floatValue(); + } /** * Sets the value of field 'after'. The field 'after' has the @@ -533,11 +588,11 @@ implements java.io.Serializable * * @param after the value of field 'after'. */ - public void setAfter(boolean after) - { + public void setAfter( + final boolean after) { this._after = after; this._has_after = true; - } //-- void setAfter(boolean) + } /** * Sets the value of field 'description'. The field @@ -546,44 +601,71 @@ implements java.io.Serializable * * @param description the value of field 'description'. */ - public void setDescription(java.lang.String description) - { + public void setDescription( + final java.lang.String description) { this._description = description; - } //-- void setDescription(java.lang.String) + } /** - * Method setGlyph - * * * * @param index * @param vGlyph - */ - public void setGlyph(int index, uk.ac.vamsas.objects.core.Glyph vGlyph) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _glyphList.size())) { - throw new IndexOutOfBoundsException("setGlyph: Index value '"+index+"' not in range [0.."+_glyphList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setGlyph( + final int index, + final uk.ac.vamsas.objects.core.Glyph vGlyph) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._glyphList.size()) { + throw new IndexOutOfBoundsException("setGlyph: Index value '" + index + "' not in range [0.." + (this._glyphList.size() - 1) + "]"); } - _glyphList.setElementAt(vGlyph, index); - } //-- void setGlyph(int, uk.ac.vamsas.objects.core.Glyph) + + this._glyphList.set(index, vGlyph); + } /** - * Method setGlyph - * * * - * @param glyphArray + * @param vGlyphArray */ - public void setGlyph(uk.ac.vamsas.objects.core.Glyph[] glyphArray) - { + public void setGlyph( + final uk.ac.vamsas.objects.core.Glyph[] vGlyphArray) { //-- copy array - _glyphList.removeAllElements(); - for (int i = 0; i < glyphArray.length; i++) { - _glyphList.addElement(glyphArray[i]); + _glyphList.clear(); + + for (int i = 0; i < vGlyphArray.length; i++) { + this._glyphList.add(vGlyphArray[i]); } - } //-- void setGlyph(uk.ac.vamsas.objects.core.Glyph) + } + + /** + * Sets the value of '_glyphList' by copying the given Vector. + * All elements will be checked for type safety. + * + * @param vGlyphList the Vector to copy. + */ + public void setGlyph( + final java.util.Vector vGlyphList) { + // copy vector + this._glyphList.clear(); + + this._glyphList.addAll(vGlyphList); + } + + /** + * Sets the value of '_glyphList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param glyphVector the Vector to set. + */ + public void setGlyphAsReference( + final java.util.Vector glyphVector) { + this._glyphList = glyphVector; + } /** * Sets the value of field 'id'. The field 'id' has the @@ -592,10 +674,10 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'position'. The field 'position' has @@ -605,69 +687,101 @@ implements java.io.Serializable * * @param position the value of field 'position'. */ - public void setPosition(int position) - { + public void setPosition( + final long position) { this._position = position; this._has_position = true; - } //-- void setPosition(int) + } /** - * Method setValue - * * * * @param index * @param vValue - */ - public void setValue(int index, float vValue) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _valueList.size())) { - throw new IndexOutOfBoundsException("setValue: Index value '"+index+"' not in range [0.."+_valueList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setValue( + final int index, + final float vValue) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._valueList.size()) { + throw new IndexOutOfBoundsException("setValue: Index value '" + index + "' not in range [0.." + (this._valueList.size() - 1) + "]"); } - _valueList.setElementAt(new java.lang.Float(vValue), index); - } //-- void setValue(int, float) + + this._valueList.set(index, new java.lang.Float(vValue)); + } /** - * Method setValue - * * * - * @param valueArray + * @param vValueArray */ - public void setValue(float[] valueArray) - { + public void setValue( + final float[] vValueArray) { //-- copy array - _valueList.removeAllElements(); - for (int i = 0; i < valueArray.length; i++) { - _valueList.addElement(new java.lang.Float(valueArray[i])); + _valueList.clear(); + + for (int i = 0; i < vValueArray.length; i++) { + this._valueList.add(new java.lang.Float(vValueArray[i])); } - } //-- void setValue(float) + } /** - * Method unmarshal + * Sets the value of '_valueList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vValueList the Vector to copy. + */ + public void setValue( + final java.util.Vector vValueList) { + // copy vector + this._valueList.clear(); + + this._valueList.addAll(vValueList); + } + + /** + * Sets the value of '_valueList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated * + * @param valueVector the Vector to set. + */ + public void setValueAsReference( + final java.util.Vector valueVector) { + this._valueList = valueVector; + } + + /** + * Method unmarshal. * * @param reader - * @return AnnotationElement - */ - public static uk.ac.vamsas.objects.core.AnnotationElement unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled + * uk.ac.vamsas.objects.core.AnnotationElement + */ + public static uk.ac.vamsas.objects.core.AnnotationElement unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.AnnotationElement) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AnnotationElement.class, reader); - } //-- uk.ac.vamsas.objects.core.AnnotationElement unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/AppData.java b/src/uk/ac/vamsas/objects/core/AppData.java index 857f0a8..90235c3 100644 --- a/src/uk/ac/vamsas/objects/core/AppData.java +++ b/src/uk/ac/vamsas/objects/core/AppData.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 AppData. @@ -41,12 +34,12 @@ implements java.io.Serializable private java.lang.Object _choiceValue; /** - * Field _data + * Field _data. */ private byte[] _data; /** - * Field _dataReference + * Field _dataReference. */ private java.lang.String _dataReference; @@ -55,10 +48,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public AppData() - { + public AppData() { super(); - } //-- uk.ac.vamsas.objects.core.AppData() + } //-----------/ @@ -66,13 +58,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -91,7 +83,7 @@ implements java.io.Serializable return false; if (this._data != null) { if (temp._data == null) return false; - else if (!(this._data.equals(temp._data))) + else if (!(java.util.Arrays.equals(this._data, temp._data))) return false; } else if (temp._data != null) @@ -106,134 +98,162 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'choiceValue'. The field * 'choiceValue' has the following description: Internal choice * value storage * - * @return Object - * @return the value of field 'choiceValue'. + * @return the value of field 'ChoiceValue'. */ - public java.lang.Object getChoiceValue() - { + public java.lang.Object getChoiceValue( + ) { return this._choiceValue; - } //-- java.lang.Object getChoiceValue() + } /** * Returns the value of field 'data'. * - * @return byte - * @return the value of field 'data'. + * @return the value of field 'Data'. */ - public byte[] getData() - { + public byte[] getData( + ) { return this._data; - } //-- byte[] getData() + } /** * Returns the value of field 'dataReference'. * - * @return String - * @return the value of field 'dataReference'. + * @return the value of field 'DataReference'. */ - public java.lang.String getDataReference() - { + public java.lang.String getDataReference( + ) { return this._dataReference; - } //-- java.lang.String getDataReference() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_choiceValue != null) { + result = 37 * result + _choiceValue.hashCode(); + } + if (_data != null) { + result = 37 * result + _data.hashCode(); + } + if (_dataReference != null) { + result = 37 * result + _dataReference.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'data'. * * @param data the value of field 'data'. */ - public void setData(byte[] data) - { + public void setData( + final byte[] data) { this._data = data; this._choiceValue = data; - } //-- void setData(byte) + } /** * Sets the value of field 'dataReference'. * * @param dataReference the value of field 'dataReference'. */ - public void setDataReference(java.lang.String dataReference) - { + public void setDataReference( + final java.lang.String dataReference) { this._dataReference = dataReference; this._choiceValue = dataReference; - } //-- void setDataReference(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return AppData + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.AppData */ - public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.AppData unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AppData.class, reader); - } //-- uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/ApplicationData.java b/src/uk/ac/vamsas/objects/core/ApplicationData.java index 69b9853..ff0b5d0 100644 --- a/src/uk/ac/vamsas/objects/core/ApplicationData.java +++ b/src/uk/ac/vamsas/objects/core/ApplicationData.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 ApplicationData. @@ -49,17 +40,17 @@ implements java.io.Serializable private java.lang.String _name; /** - * Field _userList + * Field _userList. */ private java.util.Vector _userList; /** - * Field _common + * Field _common. */ private uk.ac.vamsas.objects.core.Common _common; /** - * Field _instanceList + * Field _instanceList. */ private java.util.Vector _instanceList; @@ -68,12 +59,11 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public ApplicationData() - { + public ApplicationData() { super(); - _userList = new Vector(); - _instanceList = new Vector(); - } //-- uk.ac.vamsas.objects.core.ApplicationData() + this._userList = new java.util.Vector(); + this._instanceList = new java.util.Vector(); + } //-----------/ @@ -81,91 +71,91 @@ implements java.io.Serializable //-----------/ /** - * Method addInstance - * * * * @param vInstance + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addInstance(uk.ac.vamsas.objects.core.Instance vInstance) - throws java.lang.IndexOutOfBoundsException - { - _instanceList.addElement(vInstance); - } //-- void addInstance(uk.ac.vamsas.objects.core.Instance) + public void addInstance( + final uk.ac.vamsas.objects.core.Instance vInstance) + throws java.lang.IndexOutOfBoundsException { + this._instanceList.addElement(vInstance); + } /** - * Method addInstance - * * * * @param index * @param vInstance + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addInstance(int index, uk.ac.vamsas.objects.core.Instance vInstance) - throws java.lang.IndexOutOfBoundsException - { - _instanceList.insertElementAt(vInstance, index); - } //-- void addInstance(int, uk.ac.vamsas.objects.core.Instance) + public void addInstance( + final int index, + final uk.ac.vamsas.objects.core.Instance vInstance) + throws java.lang.IndexOutOfBoundsException { + this._instanceList.add(index, vInstance); + } /** - * Method addUser - * * * * @param vUser + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addUser(uk.ac.vamsas.objects.core.User vUser) - throws java.lang.IndexOutOfBoundsException - { - _userList.addElement(vUser); - } //-- void addUser(uk.ac.vamsas.objects.core.User) + public void addUser( + final uk.ac.vamsas.objects.core.User vUser) + throws java.lang.IndexOutOfBoundsException { + this._userList.addElement(vUser); + } /** - * Method addUser - * * * * @param index * @param vUser + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addUser(int index, uk.ac.vamsas.objects.core.User vUser) - throws java.lang.IndexOutOfBoundsException - { - _userList.insertElementAt(vUser, index); - } //-- void addUser(int, uk.ac.vamsas.objects.core.User) + public void addUser( + final int index, + final uk.ac.vamsas.objects.core.User vUser) + throws java.lang.IndexOutOfBoundsException { + this._userList.add(index, vUser); + } /** - * Method enumerateInstance - * - * + * Method enumerateInstance. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Instance elements */ - public java.util.Enumeration enumerateInstance() - { - return _instanceList.elements(); - } //-- java.util.Enumeration enumerateInstance() + public java.util.Enumeration enumerateInstance( + ) { + return this._instanceList.elements(); + } /** - * Method enumerateUser + * Method enumerateUser. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.User elements */ - public java.util.Enumeration enumerateUser() - { - return _userList.elements(); - } //-- java.util.Enumeration enumerateUser() + public java.util.Enumeration enumerateUser( + ) { + return this._userList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -213,126 +203,142 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'common'. * - * @return Common - * @return the value of field 'common'. + * @return the value of field 'Common'. */ - public uk.ac.vamsas.objects.core.Common getCommon() - { + public uk.ac.vamsas.objects.core.Common getCommon( + ) { return this._common; - } //-- uk.ac.vamsas.objects.core.Common getCommon() + } /** - * Method getInstance - * - * + * Method getInstance. * * @param index - * @return Instance - */ - public uk.ac.vamsas.objects.core.Instance getInstance(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _instanceList.size())) { - throw new IndexOutOfBoundsException("getInstance: Index value '"+index+"' not in range [0.."+_instanceList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Instance + * at the given index + */ + public uk.ac.vamsas.objects.core.Instance getInstance( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._instanceList.size()) { + throw new IndexOutOfBoundsException("getInstance: Index value '" + index + "' not in range [0.." + (this._instanceList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Instance) _instanceList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Instance getInstance(int) + return (uk.ac.vamsas.objects.core.Instance) _instanceList.get(index); + } /** - * Method getInstance - * + * Method getInstance.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return Instance + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Instance[] getInstance() - { - int size = _instanceList.size(); - uk.ac.vamsas.objects.core.Instance[] mArray = new uk.ac.vamsas.objects.core.Instance[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Instance) _instanceList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Instance[] getInstance() + public uk.ac.vamsas.objects.core.Instance[] getInstance( + ) { + uk.ac.vamsas.objects.core.Instance[] array = new uk.ac.vamsas.objects.core.Instance[0]; + return (uk.ac.vamsas.objects.core.Instance[]) this._instanceList.toArray(array); + } /** - * Method getInstanceCount - * + * Method getInstanceAsReference.Returns a reference to + * '_instanceList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getInstanceAsReference( + ) { + return this._instanceList; + } + + /** + * Method getInstanceCount. * - * @return int + * @return the size of this collection */ - public int getInstanceCount() - { - return _instanceList.size(); - } //-- int getInstanceCount() + public int getInstanceCount( + ) { + return this._instanceList.size(); + } /** * Returns the value of field 'name'. The field 'name' has the * following description: Canonical name of application * - * @return String - * @return the value of field 'name'. + * @return the value of field 'Name'. */ - public java.lang.String getName() - { + public java.lang.String getName( + ) { return this._name; - } //-- java.lang.String getName() + } /** - * Method getUser - * - * + * Method getUser. * * @param index - * @return User - */ - public uk.ac.vamsas.objects.core.User getUser(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _userList.size())) { - throw new IndexOutOfBoundsException("getUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.User at + * the given index + */ + public uk.ac.vamsas.objects.core.User getUser( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._userList.size()) { + throw new IndexOutOfBoundsException("getUser: Index value '" + index + "' not in range [0.." + (this._userList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.User) _userList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.User getUser(int) + return (uk.ac.vamsas.objects.core.User) _userList.get(index); + } /** - * Method getUser - * + * Method getUser.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return User + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.User[] getUser() - { - int size = _userList.size(); - uk.ac.vamsas.objects.core.User[] mArray = new uk.ac.vamsas.objects.core.User[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.User) _userList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.User[] getUser() + public uk.ac.vamsas.objects.core.User[] getUser( + ) { + uk.ac.vamsas.objects.core.User[] array = new uk.ac.vamsas.objects.core.User[0]; + return (uk.ac.vamsas.objects.core.User[]) this._userList.toArray(array); + } /** - * Method getUserCount - * + * Method getUserAsReference.Returns a reference to + * '_userList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getUserAsReference( + ) { + return this._userList; + } + + /** + * Method getUserCount. * - * @return int + * @return the size of this collection */ - public int getUserCount() - { - return _userList.size(); - } //-- int getUserCount() + public int getUserCount( + ) { + return this._userList.size(); + } /** * Returns the value of field 'version'. The field 'version' @@ -340,151 +346,224 @@ implements java.io.Serializable * application specific * data storage version used * - * @return String - * @return the value of field 'version'. + * @return the value of field 'Version'. */ - public java.lang.String getVersion() - { + public java.lang.String getVersion( + ) { return this._version; - } //-- java.lang.String getVersion() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_version != null) { + result = 37 * result + _version.hashCode(); + } + if (_name != null) { + result = 37 * result + _name.hashCode(); + } + if (_userList != null) { + result = 37 * result + _userList.hashCode(); + } + if (_common != null) { + result = 37 * result + _common.hashCode(); + } + if (_instanceList != null) { + result = 37 * result + _instanceList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAllInstance - * */ - public void removeAllInstance() - { - _instanceList.removeAllElements(); - } //-- void removeAllInstance() + public void removeAllInstance( + ) { + this._instanceList.clear(); + } /** - * Method removeAllUser - * */ - public void removeAllUser() - { - _userList.removeAllElements(); - } //-- void removeAllUser() + public void removeAllUser( + ) { + this._userList.clear(); + } /** - * Method removeInstance - * + * Method removeInstance. * + * @param vInstance + * @return true if the object was removed from the collection. + */ + public boolean removeInstance( + final uk.ac.vamsas.objects.core.Instance vInstance) { + boolean removed = _instanceList.remove(vInstance); + return removed; + } + + /** + * Method removeInstanceAt. * * @param index - * @return Instance + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Instance removeInstance(int index) - { - java.lang.Object obj = _instanceList.elementAt(index); - _instanceList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Instance removeInstanceAt( + final int index) { + java.lang.Object obj = this._instanceList.remove(index); return (uk.ac.vamsas.objects.core.Instance) obj; - } //-- uk.ac.vamsas.objects.core.Instance removeInstance(int) + } /** - * Method removeUser - * + * Method removeUser. * + * @param vUser + * @return true if the object was removed from the collection. + */ + public boolean removeUser( + final uk.ac.vamsas.objects.core.User vUser) { + boolean removed = _userList.remove(vUser); + return removed; + } + + /** + * Method removeUserAt. * * @param index - * @return User + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.User removeUser(int index) - { - java.lang.Object obj = _userList.elementAt(index); - _userList.removeElementAt(index); + public uk.ac.vamsas.objects.core.User removeUserAt( + final int index) { + java.lang.Object obj = this._userList.remove(index); return (uk.ac.vamsas.objects.core.User) obj; - } //-- uk.ac.vamsas.objects.core.User removeUser(int) + } /** * Sets the value of field 'common'. * * @param common the value of field 'common'. */ - public void setCommon(uk.ac.vamsas.objects.core.Common common) - { + public void setCommon( + final uk.ac.vamsas.objects.core.Common common) { this._common = common; - } //-- void setCommon(uk.ac.vamsas.objects.core.Common) + } /** - * Method setInstance - * * * * @param index * @param vInstance - */ - public void setInstance(int index, uk.ac.vamsas.objects.core.Instance vInstance) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _instanceList.size())) { - throw new IndexOutOfBoundsException("setInstance: Index value '"+index+"' not in range [0.."+_instanceList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setInstance( + final int index, + final uk.ac.vamsas.objects.core.Instance vInstance) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._instanceList.size()) { + throw new IndexOutOfBoundsException("setInstance: Index value '" + index + "' not in range [0.." + (this._instanceList.size() - 1) + "]"); } - _instanceList.setElementAt(vInstance, index); - } //-- void setInstance(int, uk.ac.vamsas.objects.core.Instance) + + this._instanceList.set(index, vInstance); + } /** - * Method setInstance - * * * - * @param instanceArray + * @param vInstanceArray */ - public void setInstance(uk.ac.vamsas.objects.core.Instance[] instanceArray) - { + public void setInstance( + final uk.ac.vamsas.objects.core.Instance[] vInstanceArray) { //-- copy array - _instanceList.removeAllElements(); - for (int i = 0; i < instanceArray.length; i++) { - _instanceList.addElement(instanceArray[i]); + _instanceList.clear(); + + for (int i = 0; i < vInstanceArray.length; i++) { + this._instanceList.add(vInstanceArray[i]); } - } //-- void setInstance(uk.ac.vamsas.objects.core.Instance) + } + + /** + * Sets the value of '_instanceList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vInstanceList the Vector to copy. + */ + public void setInstance( + final java.util.Vector vInstanceList) { + // copy vector + this._instanceList.clear(); + + this._instanceList.addAll(vInstanceList); + } + + /** + * Sets the value of '_instanceList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param instanceVector the Vector to set. + */ + public void setInstanceAsReference( + final java.util.Vector instanceVector) { + this._instanceList = instanceVector; + } /** * Sets the value of field 'name'. The field 'name' has the @@ -492,44 +571,71 @@ implements java.io.Serializable * * @param name the value of field 'name'. */ - public void setName(java.lang.String name) - { + public void setName( + final java.lang.String name) { this._name = name; - } //-- void setName(java.lang.String) + } /** - * Method setUser - * * * * @param index * @param vUser - */ - public void setUser(int index, uk.ac.vamsas.objects.core.User vUser) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _userList.size())) { - throw new IndexOutOfBoundsException("setUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setUser( + final int index, + final uk.ac.vamsas.objects.core.User vUser) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._userList.size()) { + throw new IndexOutOfBoundsException("setUser: Index value '" + index + "' not in range [0.." + (this._userList.size() - 1) + "]"); } - _userList.setElementAt(vUser, index); - } //-- void setUser(int, uk.ac.vamsas.objects.core.User) + + this._userList.set(index, vUser); + } /** - * Method setUser - * * * - * @param userArray + * @param vUserArray */ - public void setUser(uk.ac.vamsas.objects.core.User[] userArray) - { + public void setUser( + final uk.ac.vamsas.objects.core.User[] vUserArray) { //-- copy array - _userList.removeAllElements(); - for (int i = 0; i < userArray.length; i++) { - _userList.addElement(userArray[i]); + _userList.clear(); + + for (int i = 0; i < vUserArray.length; i++) { + this._userList.add(vUserArray[i]); } - } //-- void setUser(uk.ac.vamsas.objects.core.User) + } + + /** + * Sets the value of '_userList' by copying the given Vector. + * All elements will be checked for type safety. + * + * @param vUserList the Vector to copy. + */ + public void setUser( + final java.util.Vector vUserList) { + // copy vector + this._userList.clear(); + + this._userList.addAll(vUserList); + } + + /** + * Sets the value of '_userList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param userVector the Vector to set. + */ + public void setUserAsReference( + final java.util.Vector userVector) { + this._userList = userVector; + } /** * Sets the value of field 'version'. The field 'version' has @@ -539,34 +645,38 @@ implements java.io.Serializable * * @param version the value of field 'version'. */ - public void setVersion(java.lang.String version) - { + public void setVersion( + final java.lang.String version) { this._version = version; - } //-- void setVersion(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return AppData + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.AppData */ - public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.ApplicationData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.ApplicationData.class, reader); - } //-- uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.AppData unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.ApplicationData.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Attachment.java b/src/uk/ac/vamsas/objects/core/Attachment.java index d0ed365..7b6fcc4 100644 --- a/src/uk/ac/vamsas/objects/core/Attachment.java +++ b/src/uk/ac/vamsas/objects/core/Attachment.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Attachment. @@ -69,10 +62,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Attachment() - { + public Attachment() { super(); - } //-- uk.ac.vamsas.objects.core.Attachment() + } //-----------/ @@ -80,22 +72,20 @@ implements java.io.Serializable //-----------/ /** - * Method deleteCompressed - * */ - public void deleteCompressed() - { + public void deleteCompressed( + ) { this._has_compressed= false; - } //-- void deleteCompressed() + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -133,7 +123,7 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'compressed'. The field @@ -141,13 +131,12 @@ implements java.io.Serializable * data will be decompresses with Zip * before presenting to application * - * @return boolean - * @return the value of field 'compressed'. + * @return the value of field 'Compressed'. */ - public boolean getCompressed() - { + public boolean getCompressed( + ) { return this._compressed; - } //-- boolean getCompressed() + } /** * Returns the value of field 'id'. The field 'id' has the @@ -155,13 +144,12 @@ implements java.io.Serializable * referencing * * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** * Returns the value of field 'objectref'. The field @@ -169,13 +157,12 @@ implements java.io.Serializable * arbitrary data is associated with * * - * @return Object - * @return the value of field 'objectref'. + * @return the value of field 'Objectref'. */ - public java.lang.Object getObjectref() - { + public java.lang.Object getObjectref( + ) { return this._objectref; - } //-- java.lang.Object getObjectref() + } /** * Returns the value of field 'type'. The field 'type' has the @@ -183,71 +170,109 @@ implements java.io.Serializable * format - use * (extended) MIME types ? * - * @return String - * @return the value of field 'type'. + * @return the value of field 'Type'. */ - public java.lang.String getType() - { + public java.lang.String getType( + ) { return this._type; - } //-- java.lang.String getType() + } /** - * Method hasCompressed - * + * Method hasCompressed. * - * - * @return boolean + * @return true if at least one Compressed has been added */ - public boolean hasCompressed() - { + public boolean hasCompressed( + ) { return this._has_compressed; - } //-- boolean hasCompressed() + } /** - * Method isValid + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + (_compressed?0:1); + if (_type != null) { + result = 37 * result + _type.hashCode(); + } + if (_objectref != null) { + result = 37 * result + _objectref.hashCode(); + } + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + + return result; + } + + /** + * Returns the value of field 'compressed'. The field + * 'compressed' has the following description: true implies + * data will be decompresses with Zip + * before presenting to application * + * @return the value of field 'Compressed'. + */ + public boolean isCompressed( + ) { + return this._compressed; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'compressed'. The field 'compressed' @@ -257,11 +282,11 @@ implements java.io.Serializable * * @param compressed the value of field 'compressed'. */ - public void setCompressed(boolean compressed) - { + public void setCompressed( + final boolean compressed) { this._compressed = compressed; this._has_compressed = true; - } //-- void setCompressed(boolean) + } /** * Sets the value of field 'id'. The field 'id' has the @@ -271,10 +296,10 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'objectref'. The field 'objectref' @@ -284,10 +309,10 @@ implements java.io.Serializable * * @param objectref the value of field 'objectref'. */ - public void setObjectref(java.lang.Object objectref) - { + public void setObjectref( + final java.lang.Object objectref) { this._objectref = objectref; - } //-- void setObjectref(java.lang.Object) + } /** * Sets the value of field 'type'. The field 'type' has the @@ -297,34 +322,38 @@ implements java.io.Serializable * * @param type the value of field 'type'. */ - public void setType(java.lang.String type) - { + public void setType( + final java.lang.String type) { this._type = type; - } //-- void setType(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return AppData + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.AppData */ - public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.Attachment) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Attachment.class, reader); - } //-- uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.AppData unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Attachment.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Common.java b/src/uk/ac/vamsas/objects/core/Common.java index fcc9883..cda263d 100644 --- a/src/uk/ac/vamsas/objects/core/Common.java +++ b/src/uk/ac/vamsas/objects/core/Common.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Common. @@ -35,10 +28,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Common() - { + public Common() { super(); - } //-- uk.ac.vamsas.objects.core.Common() + } //-----------/ @@ -46,13 +38,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -61,81 +53,102 @@ implements java.io.Serializable if (obj instanceof Common) { - Common temp = (Common)obj; - return true; - } - return false; - } //-- boolean equals(java.lang.Object) + return true; + } + return false; + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 unmarshal - * - * + * Method unmarshal. * * @param reader - * @return AppData + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.AppData */ - public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.Common) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Common.class, reader); - } //-- uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.AppData unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Common.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/DataSet.java b/src/uk/ac/vamsas/objects/core/DataSet.java index 2d627e3..2b2004a 100644 --- a/src/uk/ac/vamsas/objects/core/DataSet.java +++ b/src/uk/ac/vamsas/objects/core/DataSet.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 DataSet. @@ -43,27 +34,27 @@ implements java.io.Serializable private java.lang.String _id; /** - * Field _sequenceList + * Field _sequenceList. */ private java.util.Vector _sequenceList; /** - * Field _dataSetAnnotationsList + * Field _dataSetAnnotationsList. */ private java.util.Vector _dataSetAnnotationsList; /** - * Field _alignmentList + * Field _alignmentList. */ private java.util.Vector _alignmentList; /** - * Field _treeList + * Field _treeList. */ private java.util.Vector _treeList; /** - * Field _provenance + * Field _provenance. */ private uk.ac.vamsas.objects.core.Provenance _provenance; @@ -72,14 +63,13 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public DataSet() - { + public DataSet() { super(); - _sequenceList = new Vector(); - _dataSetAnnotationsList = new Vector(); - _alignmentList = new Vector(); - _treeList = new Vector(); - } //-- uk.ac.vamsas.objects.core.DataSet() + this._sequenceList = new java.util.Vector(); + this._dataSetAnnotationsList = new java.util.Vector(); + this._alignmentList = new java.util.Vector(); + this._treeList = new java.util.Vector(); + } //-----------/ @@ -87,169 +77,169 @@ implements java.io.Serializable //-----------/ /** - * Method addAlignment - * * * * @param vAlignment + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignment(uk.ac.vamsas.objects.core.Alignment vAlignment) - throws java.lang.IndexOutOfBoundsException - { - _alignmentList.addElement(vAlignment); - } //-- void addAlignment(uk.ac.vamsas.objects.core.Alignment) + public void addAlignment( + final uk.ac.vamsas.objects.core.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException { + this._alignmentList.addElement(vAlignment); + } /** - * Method addAlignment - * * * * @param index * @param vAlignment + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignment(int index, uk.ac.vamsas.objects.core.Alignment vAlignment) - throws java.lang.IndexOutOfBoundsException - { - _alignmentList.insertElementAt(vAlignment, index); - } //-- void addAlignment(int, uk.ac.vamsas.objects.core.Alignment) + public void addAlignment( + final int index, + final uk.ac.vamsas.objects.core.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException { + this._alignmentList.add(index, vAlignment); + } /** - * Method addDataSetAnnotations - * * * * @param vDataSetAnnotations + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) - throws java.lang.IndexOutOfBoundsException - { - _dataSetAnnotationsList.addElement(vDataSetAnnotations); - } //-- void addDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations) + public void addDataSetAnnotations( + final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException { + this._dataSetAnnotationsList.addElement(vDataSetAnnotations); + } /** - * Method addDataSetAnnotations - * * * * @param index * @param vDataSetAnnotations + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addDataSetAnnotations(int index, uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) - throws java.lang.IndexOutOfBoundsException - { - _dataSetAnnotationsList.insertElementAt(vDataSetAnnotations, index); - } //-- void addDataSetAnnotations(int, uk.ac.vamsas.objects.core.DataSetAnnotations) + public void addDataSetAnnotations( + final int index, + final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException { + this._dataSetAnnotationsList.add(index, vDataSetAnnotations); + } /** - * Method addSequence - * * * * @param vSequence + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addSequence(uk.ac.vamsas.objects.core.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException - { - _sequenceList.addElement(vSequence); - } //-- void addSequence(uk.ac.vamsas.objects.core.Sequence) + public void addSequence( + final uk.ac.vamsas.objects.core.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException { + this._sequenceList.addElement(vSequence); + } /** - * Method addSequence - * * * * @param index * @param vSequence + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addSequence(int index, uk.ac.vamsas.objects.core.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException - { - _sequenceList.insertElementAt(vSequence, index); - } //-- void addSequence(int, uk.ac.vamsas.objects.core.Sequence) + public void addSequence( + final int index, + final uk.ac.vamsas.objects.core.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException { + this._sequenceList.add(index, vSequence); + } /** - * Method addTree - * * * * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.addElement(vTree); - } //-- void addTree(uk.ac.vamsas.objects.core.Tree) + public void addTree( + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.addElement(vTree); + } /** - * Method addTree - * * * * @param index * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(int index, uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.insertElementAt(vTree, index); - } //-- void addTree(int, uk.ac.vamsas.objects.core.Tree) + public void addTree( + final int index, + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.add(index, vTree); + } /** - * Method enumerateAlignment - * - * + * Method enumerateAlignment. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Alignment elements */ - public java.util.Enumeration enumerateAlignment() - { - return _alignmentList.elements(); - } //-- java.util.Enumeration enumerateAlignment() + public java.util.Enumeration enumerateAlignment( + ) { + return this._alignmentList.elements(); + } /** - * Method enumerateDataSetAnnotations + * Method enumerateDataSetAnnotations. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.DataSetAnnotations elements */ - public java.util.Enumeration enumerateDataSetAnnotations() - { - return _dataSetAnnotationsList.elements(); - } //-- java.util.Enumeration enumerateDataSetAnnotations() + public java.util.Enumeration enumerateDataSetAnnotations( + ) { + return this._dataSetAnnotationsList.elements(); + } /** - * Method enumerateSequence - * + * Method enumerateSequence. * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Sequence elements */ - public java.util.Enumeration enumerateSequence() - { - return _sequenceList.elements(); - } //-- java.util.Enumeration enumerateSequence() + public java.util.Enumeration enumerateSequence( + ) { + return this._sequenceList.elements(); + } /** - * Method enumerateTree - * + * Method enumerateTree. * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Tree elements */ - public java.util.Enumeration enumerateTree() - { - return _treeList.elements(); - } //-- java.util.Enumeration enumerateTree() + public java.util.Enumeration enumerateTree( + ) { + return this._treeList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -304,433 +294,587 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** - * Method getAlignment - * - * + * Method getAlignment. * * @param index - * @return Alignment - */ - public uk.ac.vamsas.objects.core.Alignment getAlignment(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentList.size())) { - throw new IndexOutOfBoundsException("getAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Alignment + * at the given index + */ + public uk.ac.vamsas.objects.core.Alignment getAlignment( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentList.size()) { + throw new IndexOutOfBoundsException("getAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Alignment) _alignmentList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Alignment getAlignment(int) + return (uk.ac.vamsas.objects.core.Alignment) _alignmentList.get(index); + } /** - * Method getAlignment + * Method getAlignment.Returns the contents of the collection + * in an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * - * @return Alignment + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Alignment[] getAlignment() - { - int size = _alignmentList.size(); - uk.ac.vamsas.objects.core.Alignment[] mArray = new uk.ac.vamsas.objects.core.Alignment[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Alignment) _alignmentList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Alignment[] getAlignment() + public uk.ac.vamsas.objects.core.Alignment[] getAlignment( + ) { + uk.ac.vamsas.objects.core.Alignment[] array = new uk.ac.vamsas.objects.core.Alignment[0]; + return (uk.ac.vamsas.objects.core.Alignment[]) this._alignmentList.toArray(array); + } /** - * Method getAlignmentCount - * - * + * Method getAlignmentAsReference.Returns a reference to + * '_alignmentList'. No type checking is performed on any + * modifications to the Vector. * - * @return int + * @return a reference to the Vector backing this class */ - public int getAlignmentCount() - { - return _alignmentList.size(); - } //-- int getAlignmentCount() + public java.util.Vector getAlignmentAsReference( + ) { + return this._alignmentList; + } /** - * Method getDataSetAnnotations - * + * Method getAlignmentCount. * + * @return the size of this collection + */ + public int getAlignmentCount( + ) { + return this._alignmentList.size(); + } + + /** + * Method getDataSetAnnotations. * * @param index - * @return DataSetAnnotations - */ - public uk.ac.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()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * uk.ac.vamsas.objects.core.DataSetAnnotations at the given + * index + */ + public uk.ac.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._dataSetAnnotationsList.size()) { + throw new IndexOutOfBoundsException("getDataSetAnnotations: Index value '" + index + "' not in range [0.." + (this._dataSetAnnotationsList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int) + return (uk.ac.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.get(index); + } /** - * Method getDataSetAnnotations - * - * - * - * @return DataSetAnnotations + * Method getDataSetAnnotations.Returns the contents of the + * collection in an Array.

Note: Just in case the + * collection contents are changing in another thread, we pass + * a 0-length Array of the correct type into the API call. + * This way we know that the Array returned is of + * exactly the correct length. + * + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations() - { - int size = _dataSetAnnotationsList.size(); - uk.ac.vamsas.objects.core.DataSetAnnotations[] mArray = new uk.ac.vamsas.objects.core.DataSetAnnotations[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations() + public uk.ac.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations( + ) { + uk.ac.vamsas.objects.core.DataSetAnnotations[] array = new uk.ac.vamsas.objects.core.DataSetAnnotations[0]; + return (uk.ac.vamsas.objects.core.DataSetAnnotations[]) this._dataSetAnnotationsList.toArray(array); + } /** - * Method getDataSetAnnotationsCount - * + * Method getDataSetAnnotationsAsReference.Returns a reference + * to '_dataSetAnnotationsList'. No type checking is performed + * on any modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getDataSetAnnotationsAsReference( + ) { + return this._dataSetAnnotationsList; + } + + /** + * Method getDataSetAnnotationsCount. * - * @return int + * @return the size of this collection */ - public int getDataSetAnnotationsCount() - { - return _dataSetAnnotationsList.size(); - } //-- int getDataSetAnnotationsCount() + public int getDataSetAnnotationsCount( + ) { + return this._dataSetAnnotationsList.size(); + } /** * Returns the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object * referencing * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** * Returns the value of field 'provenance'. * - * @return Provenance - * @return the value of field 'provenance'. + * @return the value of field 'Provenance'. */ - public uk.ac.vamsas.objects.core.Provenance getProvenance() - { + public uk.ac.vamsas.objects.core.Provenance getProvenance( + ) { return this._provenance; - } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + } /** - * Method getSequence - * - * + * Method getSequence. * * @param index - * @return Sequence - */ - public uk.ac.vamsas.objects.core.Sequence getSequence(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _sequenceList.size())) { - throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Sequence + * at the given index + */ + public uk.ac.vamsas.objects.core.Sequence getSequence( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._sequenceList.size()) { + throw new IndexOutOfBoundsException("getSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Sequence) _sequenceList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Sequence getSequence(int) + return (uk.ac.vamsas.objects.core.Sequence) _sequenceList.get(index); + } /** - * Method getSequence - * - * + * Method getSequence.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * @return Sequence + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Sequence[] getSequence() - { - int size = _sequenceList.size(); - uk.ac.vamsas.objects.core.Sequence[] mArray = new uk.ac.vamsas.objects.core.Sequence[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Sequence) _sequenceList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Sequence[] getSequence() + public uk.ac.vamsas.objects.core.Sequence[] getSequence( + ) { + uk.ac.vamsas.objects.core.Sequence[] array = new uk.ac.vamsas.objects.core.Sequence[0]; + return (uk.ac.vamsas.objects.core.Sequence[]) this._sequenceList.toArray(array); + } /** - * Method getSequenceCount - * + * Method getSequenceAsReference.Returns a reference to + * '_sequenceList'. No type checking is performed on any + * modifications to the Vector. * - * - * @return int + * @return a reference to the Vector backing this class */ - public int getSequenceCount() - { - return _sequenceList.size(); - } //-- int getSequenceCount() + public java.util.Vector getSequenceAsReference( + ) { + return this._sequenceList; + } /** - * Method getTree - * + * Method getSequenceCount. * + * @return the size of this collection + */ + public int getSequenceCount( + ) { + return this._sequenceList.size(); + } + + /** + * Method getTree. * * @param index - * @return Tree - */ - public uk.ac.vamsas.objects.core.Tree getTree(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _treeList.size())) { - throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Tree at + * the given index + */ + public uk.ac.vamsas.objects.core.Tree getTree( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) { + throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Tree getTree(int) + return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index); + } /** - * Method getTree - * + * Method getTree.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return Tree + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Tree[] getTree() - { - int size = _treeList.size(); - uk.ac.vamsas.objects.core.Tree[] mArray = new uk.ac.vamsas.objects.core.Tree[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Tree[] getTree() + public uk.ac.vamsas.objects.core.Tree[] getTree( + ) { + uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0]; + return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array); + } /** - * Method getTreeCount - * - * + * Method getTreeAsReference.Returns a reference to + * '_treeList'. No type checking is performed on any + * modifications to the Vector. * - * @return int + * @return a reference to the Vector backing this class */ - public int getTreeCount() - { - return _treeList.size(); - } //-- int getTreeCount() + public java.util.Vector getTreeAsReference( + ) { + return this._treeList; + } /** - * Method isValid + * Method getTreeCount. * + * @return the size of this collection + */ + public int getTreeCount( + ) { + return this._treeList.size(); + } + + /** + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_sequenceList != null) { + result = 37 * result + _sequenceList.hashCode(); + } + if (_dataSetAnnotationsList != null) { + result = 37 * result + _dataSetAnnotationsList.hashCode(); + } + if (_alignmentList != null) { + result = 37 * result + _alignmentList.hashCode(); + } + if (_treeList != null) { + result = 37 * result + _treeList.hashCode(); + } + if (_provenance != null) { + result = 37 * result + _provenance.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 removeAlignment - * + * Method removeAlignment. * + * @param vAlignment + * @return true if the object was removed from the collection. + */ + public boolean removeAlignment( + final uk.ac.vamsas.objects.core.Alignment vAlignment) { + boolean removed = _alignmentList.remove(vAlignment); + return removed; + } + + /** + * Method removeAlignmentAt. * * @param index - * @return Alignment + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Alignment removeAlignment(int index) - { - java.lang.Object obj = _alignmentList.elementAt(index); - _alignmentList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Alignment removeAlignmentAt( + final int index) { + java.lang.Object obj = this._alignmentList.remove(index); return (uk.ac.vamsas.objects.core.Alignment) obj; - } //-- uk.ac.vamsas.objects.core.Alignment removeAlignment(int) + } /** - * Method removeAllAlignment - * */ - public void removeAllAlignment() - { - _alignmentList.removeAllElements(); - } //-- void removeAllAlignment() + public void removeAllAlignment( + ) { + this._alignmentList.clear(); + } /** - * Method removeAllDataSetAnnotations - * */ - public void removeAllDataSetAnnotations() - { - _dataSetAnnotationsList.removeAllElements(); - } //-- void removeAllDataSetAnnotations() + public void removeAllDataSetAnnotations( + ) { + this._dataSetAnnotationsList.clear(); + } /** - * Method removeAllSequence - * */ - public void removeAllSequence() - { - _sequenceList.removeAllElements(); - } //-- void removeAllSequence() + public void removeAllSequence( + ) { + this._sequenceList.clear(); + } /** - * Method removeAllTree - * */ - public void removeAllTree() - { - _treeList.removeAllElements(); - } //-- void removeAllTree() + public void removeAllTree( + ) { + this._treeList.clear(); + } /** - * Method removeDataSetAnnotations - * + * Method removeDataSetAnnotations. * + * @param vDataSetAnnotations + * @return true if the object was removed from the collection. + */ + public boolean removeDataSetAnnotations( + final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) { + boolean removed = _dataSetAnnotationsList.remove(vDataSetAnnotations); + return removed; + } + + /** + * Method removeDataSetAnnotationsAt. * * @param index - * @return DataSetAnnotations + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int index) - { - java.lang.Object obj = _dataSetAnnotationsList.elementAt(index); - _dataSetAnnotationsList.removeElementAt(index); + public uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotationsAt( + final int index) { + java.lang.Object obj = this._dataSetAnnotationsList.remove(index); return (uk.ac.vamsas.objects.core.DataSetAnnotations) obj; - } //-- uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int) + } /** - * Method removeSequence - * + * Method removeSequence. * + * @param vSequence + * @return true if the object was removed from the collection. + */ + public boolean removeSequence( + final uk.ac.vamsas.objects.core.Sequence vSequence) { + boolean removed = _sequenceList.remove(vSequence); + return removed; + } + + /** + * Method removeSequenceAt. * * @param index - * @return Sequence + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Sequence removeSequence(int index) - { - java.lang.Object obj = _sequenceList.elementAt(index); - _sequenceList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Sequence removeSequenceAt( + final int index) { + java.lang.Object obj = this._sequenceList.remove(index); return (uk.ac.vamsas.objects.core.Sequence) obj; - } //-- uk.ac.vamsas.objects.core.Sequence removeSequence(int) + } /** - * Method removeTree - * + * Method removeTree. * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree( + final uk.ac.vamsas.objects.core.Tree vTree) { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. * * @param index - * @return Tree + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Tree removeTree(int index) - { - java.lang.Object obj = _treeList.elementAt(index); - _treeList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Tree removeTreeAt( + final int index) { + java.lang.Object obj = this._treeList.remove(index); return (uk.ac.vamsas.objects.core.Tree) obj; - } //-- uk.ac.vamsas.objects.core.Tree removeTree(int) + } /** - * Method setAlignment - * * * * @param index * @param vAlignment + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setAlignment(int index, uk.ac.vamsas.objects.core.Alignment vAlignment) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentList.size())) { - throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]"); + public void setAlignment( + final int index, + final uk.ac.vamsas.objects.core.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentList.size()) { + throw new IndexOutOfBoundsException("setAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]"); } - _alignmentList.setElementAt(vAlignment, index); - } //-- void setAlignment(int, uk.ac.vamsas.objects.core.Alignment) + + this._alignmentList.set(index, vAlignment); + } /** - * Method setAlignment * * - * - * @param alignmentArray + * @param vAlignmentArray */ - public void setAlignment(uk.ac.vamsas.objects.core.Alignment[] alignmentArray) - { + public void setAlignment( + final uk.ac.vamsas.objects.core.Alignment[] vAlignmentArray) { //-- copy array - _alignmentList.removeAllElements(); - for (int i = 0; i < alignmentArray.length; i++) { - _alignmentList.addElement(alignmentArray[i]); + _alignmentList.clear(); + + for (int i = 0; i < vAlignmentArray.length; i++) { + this._alignmentList.add(vAlignmentArray[i]); } - } //-- void setAlignment(uk.ac.vamsas.objects.core.Alignment) + } /** - * Method setDataSetAnnotations + * Sets the value of '_alignmentList' by copying the given + * Vector. All elements will be checked for type safety. * + * @param vAlignmentList the Vector to copy. + */ + public void setAlignment( + final java.util.Vector vAlignmentList) { + // copy vector + this._alignmentList.clear(); + + this._alignmentList.addAll(vAlignmentList); + } + + /** + * Sets the value of '_alignmentList' by setting it to the + * given Vector. No type checking is performed. + * @deprecated + * + * @param alignmentVector the Vector to set. + */ + public void setAlignmentAsReference( + final java.util.Vector alignmentVector) { + this._alignmentList = alignmentVector; + } + + /** * * * @param index * @param vDataSetAnnotations + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setDataSetAnnotations(int index, uk.ac.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()+ "]"); + public void setDataSetAnnotations( + final int index, + final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._dataSetAnnotationsList.size()) { + throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '" + index + "' not in range [0.." + (this._dataSetAnnotationsList.size() - 1) + "]"); } - _dataSetAnnotationsList.setElementAt(vDataSetAnnotations, index); - } //-- void setDataSetAnnotations(int, uk.ac.vamsas.objects.core.DataSetAnnotations) + + this._dataSetAnnotationsList.set(index, vDataSetAnnotations); + } /** - * Method setDataSetAnnotations - * * * - * @param dataSetAnnotationsArray + * @param vDataSetAnnotationsArray */ - public void setDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations[] dataSetAnnotationsArray) - { + public void setDataSetAnnotations( + final uk.ac.vamsas.objects.core.DataSetAnnotations[] vDataSetAnnotationsArray) { //-- copy array - _dataSetAnnotationsList.removeAllElements(); - for (int i = 0; i < dataSetAnnotationsArray.length; i++) { - _dataSetAnnotationsList.addElement(dataSetAnnotationsArray[i]); + _dataSetAnnotationsList.clear(); + + for (int i = 0; i < vDataSetAnnotationsArray.length; i++) { + this._dataSetAnnotationsList.add(vDataSetAnnotationsArray[i]); } - } //-- void setDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations) + } + + /** + * Sets the value of '_dataSetAnnotationsList' by copying the + * given Vector. All elements will be checked for type safety. + * + * @param vDataSetAnnotationsList the Vector to copy. + */ + public void setDataSetAnnotations( + final java.util.Vector vDataSetAnnotationsList) { + // copy vector + this._dataSetAnnotationsList.clear(); + + this._dataSetAnnotationsList.addAll(vDataSetAnnotationsList); + } + + /** + * Sets the value of '_dataSetAnnotationsList' by setting it to + * the given Vector. No type checking is performed. + * @deprecated + * + * @param dataSetAnnotationsVector the Vector to set. + */ + public void setDataSetAnnotationsAsReference( + final java.util.Vector dataSetAnnotationsVector) { + this._dataSetAnnotationsList = dataSetAnnotationsVector; + } /** * Sets the value of field 'id'. The field 'id' has the @@ -739,112 +883,170 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. */ - public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) - { + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { this._provenance = provenance; - } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + } /** - * Method setSequence - * * * * @param index * @param vSequence + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setSequence(int index, uk.ac.vamsas.objects.core.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _sequenceList.size())) { - throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]"); + public void setSequence( + final int index, + final uk.ac.vamsas.objects.core.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._sequenceList.size()) { + throw new IndexOutOfBoundsException("setSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]"); } - _sequenceList.setElementAt(vSequence, index); - } //-- void setSequence(int, uk.ac.vamsas.objects.core.Sequence) + + this._sequenceList.set(index, vSequence); + } /** - * Method setSequence - * * * - * @param sequenceArray + * @param vSequenceArray */ - public void setSequence(uk.ac.vamsas.objects.core.Sequence[] sequenceArray) - { + public void setSequence( + final uk.ac.vamsas.objects.core.Sequence[] vSequenceArray) { //-- copy array - _sequenceList.removeAllElements(); - for (int i = 0; i < sequenceArray.length; i++) { - _sequenceList.addElement(sequenceArray[i]); + _sequenceList.clear(); + + for (int i = 0; i < vSequenceArray.length; i++) { + this._sequenceList.add(vSequenceArray[i]); } - } //-- void setSequence(uk.ac.vamsas.objects.core.Sequence) + } + + /** + * Sets the value of '_sequenceList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vSequenceList the Vector to copy. + */ + public void setSequence( + final java.util.Vector vSequenceList) { + // copy vector + this._sequenceList.clear(); + + this._sequenceList.addAll(vSequenceList); + } /** - * Method setTree + * Sets the value of '_sequenceList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated * + * @param sequenceVector the Vector to set. + */ + public void setSequenceAsReference( + final java.util.Vector sequenceVector) { + this._sequenceList = sequenceVector; + } + + /** * * * @param index * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setTree(int index, uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _treeList.size())) { - throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + public void setTree( + final int index, + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) { + throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); } - _treeList.setElementAt(vTree, index); - } //-- void setTree(int, uk.ac.vamsas.objects.core.Tree) + + this._treeList.set(index, vTree); + } /** - * Method setTree - * * * - * @param treeArray + * @param vTreeArray */ - public void setTree(uk.ac.vamsas.objects.core.Tree[] treeArray) - { + public void setTree( + final uk.ac.vamsas.objects.core.Tree[] vTreeArray) { //-- copy array - _treeList.removeAllElements(); - for (int i = 0; i < treeArray.length; i++) { - _treeList.addElement(treeArray[i]); + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) { + this._treeList.add(vTreeArray[i]); } - } //-- void setTree(uk.ac.vamsas.objects.core.Tree) + } /** - * Method unmarshal + * Sets the value of '_treeList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vTreeList the Vector to copy. + */ + public void setTree( + final java.util.Vector vTreeList) { + // copy vector + this._treeList.clear(); + + this._treeList.addAll(vTreeList); + } + + /** + * Sets the value of '_treeList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated * + * @param treeVector the Vector to set. + */ + public void setTreeAsReference( + final java.util.Vector treeVector) { + this._treeList = treeVector; + } + + /** + * Method unmarshal. * * @param reader - * @return DataSet + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.DataSet */ - public static uk.ac.vamsas.objects.core.DataSet unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.DataSet unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSet.class, reader); - } //-- uk.ac.vamsas.objects.core.DataSet unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java index 0507d37..2d1c91a 100644 --- a/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java +++ b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 DataSetAnnotations. @@ -42,7 +35,7 @@ implements java.io.Serializable private java.lang.Object _seqRef; /** - * Field _provenance + * Field _provenance. */ private uk.ac.vamsas.objects.core.Provenance _provenance; @@ -51,10 +44,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public DataSetAnnotations() - { + public DataSetAnnotations() { super(); - } //-- uk.ac.vamsas.objects.core.DataSetAnnotations() + } //-----------/ @@ -62,13 +54,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -95,87 +87,109 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'provenance'. * - * @return Provenance - * @return the value of field 'provenance'. + * @return the value of field 'Provenance'. */ - public uk.ac.vamsas.objects.core.Provenance getProvenance() - { + public uk.ac.vamsas.objects.core.Provenance getProvenance( + ) { return this._provenance; - } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + } /** * Returns the value of field 'seqRef'. The field 'seqRef' has * the following description: annotation is associated with a * particular dataset sequence * - * @return Object - * @return the value of field 'seqRef'. + * @return the value of field 'SeqRef'. */ - public java.lang.Object getSeqRef() - { + public java.lang.Object getSeqRef( + ) { return this._seqRef; - } //-- java.lang.Object getSeqRef() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_seqRef != null) { + result = 37 * result + _seqRef.hashCode(); + } + if (_provenance != null) { + result = 37 * result + _provenance.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. */ - public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) - { + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { this._provenance = provenance; - } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + } /** * Sets the value of field 'seqRef'. The field 'seqRef' has the @@ -184,34 +198,38 @@ implements java.io.Serializable * * @param seqRef the value of field 'seqRef'. */ - public void setSeqRef(java.lang.Object seqRef) - { + public void setSeqRef( + final java.lang.Object seqRef) { this._seqRef = seqRef; - } //-- void setSeqRef(java.lang.Object) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return RangeType + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType */ - public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.DataSetAnnotations) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSetAnnotations.class, reader); - } //-- uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.RangeType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSetAnnotations.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/DbRef.java b/src/uk/ac/vamsas/objects/core/DbRef.java index 5b69fd5..a228591 100644 --- a/src/uk/ac/vamsas/objects/core/DbRef.java +++ b/src/uk/ac/vamsas/objects/core/DbRef.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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; /** * Store a list of database references @@ -85,12 +76,12 @@ implements java.io.Serializable private java.util.Vector _mapList; /** - * Field _linkList + * Field _linkList. */ private java.util.Vector _linkList; /** - * Field _propertyList + * Field _propertyList. */ private java.util.Vector _propertyList; @@ -99,13 +90,12 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public DbRef() - { + public DbRef() { super(); - _mapList = new Vector(); - _linkList = new Vector(); - _propertyList = new Vector(); - } //-- uk.ac.vamsas.objects.core.DbRef() + this._mapList = new java.util.Vector(); + this._linkList = new java.util.Vector(); + this._propertyList = new java.util.Vector(); + } //-----------/ @@ -113,130 +103,130 @@ implements java.io.Serializable //-----------/ /** - * Method addLink - * * * * @param vLink + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addLink(uk.ac.vamsas.objects.core.Link vLink) - throws java.lang.IndexOutOfBoundsException - { - _linkList.addElement(vLink); - } //-- void addLink(uk.ac.vamsas.objects.core.Link) + public void addLink( + final uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException { + this._linkList.addElement(vLink); + } /** - * Method addLink - * * * * @param index * @param vLink + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addLink(int index, uk.ac.vamsas.objects.core.Link vLink) - throws java.lang.IndexOutOfBoundsException - { - _linkList.insertElementAt(vLink, index); - } //-- void addLink(int, uk.ac.vamsas.objects.core.Link) + public void addLink( + final int index, + final uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException { + this._linkList.add(index, vLink); + } /** - * Method addMap - * * * * @param vMap + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addMap(uk.ac.vamsas.objects.core.Map vMap) - throws java.lang.IndexOutOfBoundsException - { - _mapList.addElement(vMap); - } //-- void addMap(uk.ac.vamsas.objects.core.Map) + public void addMap( + final uk.ac.vamsas.objects.core.Map vMap) + throws java.lang.IndexOutOfBoundsException { + this._mapList.addElement(vMap); + } /** - * Method addMap - * * * * @param index * @param vMap + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addMap(int index, uk.ac.vamsas.objects.core.Map vMap) - throws java.lang.IndexOutOfBoundsException - { - _mapList.insertElementAt(vMap, index); - } //-- void addMap(int, uk.ac.vamsas.objects.core.Map) + public void addMap( + final int index, + final uk.ac.vamsas.objects.core.Map vMap) + throws java.lang.IndexOutOfBoundsException { + this._mapList.add(index, vMap); + } /** - * Method addProperty - * * * * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.addElement(vProperty); - } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + public void addProperty( + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.addElement(vProperty); + } /** - * Method addProperty - * * * * @param index * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.insertElementAt(vProperty, index); - } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + public void addProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.add(index, vProperty); + } /** - * Method enumerateLink - * - * + * Method enumerateLink. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Link elements */ - public java.util.Enumeration enumerateLink() - { - return _linkList.elements(); - } //-- java.util.Enumeration enumerateLink() + public java.util.Enumeration enumerateLink( + ) { + return this._linkList.elements(); + } /** - * Method enumerateMap + * Method enumerateMap. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Map elements */ - public java.util.Enumeration enumerateMap() - { - return _mapList.elements(); - } //-- java.util.Enumeration enumerateMap() + public java.util.Enumeration enumerateMap( + ) { + return this._mapList.elements(); + } /** - * Method enumerateProperty - * - * + * Method enumerateProperty. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Property elements */ - public java.util.Enumeration enumerateProperty() - { - return _propertyList.elements(); - } //-- java.util.Enumeration enumerateProperty() + public java.util.Enumeration enumerateProperty( + ) { + return this._propertyList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -298,7 +288,7 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'accessionId'. The field @@ -309,170 +299,195 @@ implements java.io.Serializable * special property of the dbRef object ? * * - * @return String - * @return the value of field 'accessionId'. + * @return the value of field 'AccessionId'. */ - public java.lang.String getAccessionId() - { + public java.lang.String getAccessionId( + ) { return this._accessionId; - } //-- java.lang.String getAccessionId() + } /** * Returns the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object * referencing * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** - * Method getLink - * - * + * Method getLink. * * @param index - * @return Link - */ - public uk.ac.vamsas.objects.core.Link getLink(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _linkList.size())) { - throw new IndexOutOfBoundsException("getLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Link at + * the given index + */ + public uk.ac.vamsas.objects.core.Link getLink( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._linkList.size()) { + throw new IndexOutOfBoundsException("getLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Link) _linkList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Link getLink(int) + return (uk.ac.vamsas.objects.core.Link) _linkList.get(index); + } /** - * Method getLink - * + * Method getLink.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return Link + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Link[] getLink() - { - int size = _linkList.size(); - uk.ac.vamsas.objects.core.Link[] mArray = new uk.ac.vamsas.objects.core.Link[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Link) _linkList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Link[] getLink() + public uk.ac.vamsas.objects.core.Link[] getLink( + ) { + uk.ac.vamsas.objects.core.Link[] array = new uk.ac.vamsas.objects.core.Link[0]; + return (uk.ac.vamsas.objects.core.Link[]) this._linkList.toArray(array); + } /** - * Method getLinkCount - * - * + * Method getLinkAsReference.Returns a reference to + * '_linkList'. No type checking is performed on any + * modifications to the Vector. * - * @return int + * @return a reference to the Vector backing this class */ - public int getLinkCount() - { - return _linkList.size(); - } //-- int getLinkCount() + public java.util.Vector getLinkAsReference( + ) { + return this._linkList; + } /** - * Method getMap - * + * Method getLinkCount. * + * @return the size of this collection + */ + public int getLinkCount( + ) { + return this._linkList.size(); + } + + /** + * Method getMap. * * @param index - * @return Map - */ - public uk.ac.vamsas.objects.core.Map getMap(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _mapList.size())) { - throw new IndexOutOfBoundsException("getMap: Index value '"+index+"' not in range [0.."+_mapList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Map at + * the given index + */ + public uk.ac.vamsas.objects.core.Map getMap( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._mapList.size()) { + throw new IndexOutOfBoundsException("getMap: Index value '" + index + "' not in range [0.." + (this._mapList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Map) _mapList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Map getMap(int) + return (uk.ac.vamsas.objects.core.Map) _mapList.get(index); + } /** - * Method getMap + * Method getMap.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * - * @return Map + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Map[] getMap() - { - int size = _mapList.size(); - uk.ac.vamsas.objects.core.Map[] mArray = new uk.ac.vamsas.objects.core.Map[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Map) _mapList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Map[] getMap() + public uk.ac.vamsas.objects.core.Map[] getMap( + ) { + uk.ac.vamsas.objects.core.Map[] array = new uk.ac.vamsas.objects.core.Map[0]; + return (uk.ac.vamsas.objects.core.Map[]) this._mapList.toArray(array); + } /** - * Method getMapCount - * + * Method getMapAsReference.Returns a reference to '_mapList'. + * No type checking is performed on any modifications to the + * Vector. * - * - * @return int + * @return a reference to the Vector backing this class */ - public int getMapCount() - { - return _mapList.size(); - } //-- int getMapCount() + public java.util.Vector getMapAsReference( + ) { + return this._mapList; + } /** - * Method getProperty - * + * Method getMapCount. * + * @return the size of this collection + */ + public int getMapCount( + ) { + return this._mapList.size(); + } + + /** + * Method getProperty. * * @param index - * @return Property - */ - public uk.ac.vamsas.objects.core.Property getProperty(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Property + * at the given index + */ + public uk.ac.vamsas.objects.core.Property getProperty( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index); + } /** - * Method getProperty - * - * + * Method getProperty.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * @return Property + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Property[] getProperty() - { - int size = _propertyList.size(); - uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + public uk.ac.vamsas.objects.core.Property[] getProperty( + ) { + uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0]; + return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array); + } /** - * Method getPropertyCount - * + * Method getPropertyAsReference.Returns a reference to + * '_propertyList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getPropertyAsReference( + ) { + return this._propertyList; + } + + /** + * Method getPropertyCount. * - * @return int + * @return the size of this collection */ - public int getPropertyCount() - { - return _propertyList.size(); - } //-- int getPropertyCount() + public int getPropertyCount( + ) { + return this._propertyList.size(); + } /** * Returns the value of field 'source'. The field 'source' has @@ -482,144 +497,202 @@ implements java.io.Serializable * uncontrolled/unspecified string ID * * - * @return String - * @return the value of field 'source'. + * @return the value of field 'Source'. */ - public java.lang.String getSource() - { + public java.lang.String getSource( + ) { return this._source; - } //-- java.lang.String getSource() + } /** * Returns the value of field 'version'. The field 'version' * has the following description: Version must be specified - * * - * @return String - * @return the value of field 'version'. + * @return the value of field 'Version'. */ - public java.lang.String getVersion() - { + public java.lang.String getVersion( + ) { return this._version; - } //-- java.lang.String getVersion() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_source != null) { + result = 37 * result + _source.hashCode(); + } + if (_version != null) { + result = 37 * result + _version.hashCode(); + } + if (_accessionId != null) { + result = 37 * result + _accessionId.hashCode(); + } + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_mapList != null) { + result = 37 * result + _mapList.hashCode(); + } + if (_linkList != null) { + result = 37 * result + _linkList.hashCode(); + } + if (_propertyList != null) { + result = 37 * result + _propertyList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAllLink - * */ - public void removeAllLink() - { - _linkList.removeAllElements(); - } //-- void removeAllLink() + public void removeAllLink( + ) { + this._linkList.clear(); + } /** - * Method removeAllMap - * */ - public void removeAllMap() - { - _mapList.removeAllElements(); - } //-- void removeAllMap() + public void removeAllMap( + ) { + this._mapList.clear(); + } /** - * Method removeAllProperty - * */ - public void removeAllProperty() - { - _propertyList.removeAllElements(); - } //-- void removeAllProperty() + public void removeAllProperty( + ) { + this._propertyList.clear(); + } /** - * Method removeLink - * + * Method removeLink. * + * @param vLink + * @return true if the object was removed from the collection. + */ + public boolean removeLink( + final uk.ac.vamsas.objects.core.Link vLink) { + boolean removed = _linkList.remove(vLink); + return removed; + } + + /** + * Method removeLinkAt. * * @param index - * @return Link + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Link removeLink(int index) - { - java.lang.Object obj = _linkList.elementAt(index); - _linkList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Link removeLinkAt( + final int index) { + java.lang.Object obj = this._linkList.remove(index); return (uk.ac.vamsas.objects.core.Link) obj; - } //-- uk.ac.vamsas.objects.core.Link removeLink(int) + } /** - * Method removeMap - * + * Method removeMap. * + * @param vMap + * @return true if the object was removed from the collection. + */ + public boolean removeMap( + final uk.ac.vamsas.objects.core.Map vMap) { + boolean removed = _mapList.remove(vMap); + return removed; + } + + /** + * Method removeMapAt. * * @param index - * @return Map + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Map removeMap(int index) - { - java.lang.Object obj = _mapList.elementAt(index); - _mapList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Map removeMapAt( + final int index) { + java.lang.Object obj = this._mapList.remove(index); return (uk.ac.vamsas.objects.core.Map) obj; - } //-- uk.ac.vamsas.objects.core.Map removeMap(int) + } /** - * Method removeProperty - * + * Method removeProperty. * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final uk.ac.vamsas.objects.core.Property vProperty) { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. * * @param index - * @return Property + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Property removeProperty(int index) - { - java.lang.Object obj = _propertyList.elementAt(index); - _propertyList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Property removePropertyAt( + final int index) { + java.lang.Object obj = this._propertyList.remove(index); return (uk.ac.vamsas.objects.core.Property) obj; - } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + } /** * Sets the value of field 'accessionId'. The field @@ -632,10 +705,10 @@ implements java.io.Serializable * * @param accessionId the value of field 'accessionId'. */ - public void setAccessionId(java.lang.String accessionId) - { + public void setAccessionId( + final java.lang.String accessionId) { this._accessionId = accessionId; - } //-- void setAccessionId(java.lang.String) + } /** * Sets the value of field 'id'. The field 'id' has the @@ -644,112 +717,193 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** - * Method setLink - * * * * @param index * @param vLink - */ - public void setLink(int index, uk.ac.vamsas.objects.core.Link vLink) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _linkList.size())) { - throw new IndexOutOfBoundsException("setLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setLink( + final int index, + final uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._linkList.size()) { + throw new IndexOutOfBoundsException("setLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]"); } - _linkList.setElementAt(vLink, index); - } //-- void setLink(int, uk.ac.vamsas.objects.core.Link) + + this._linkList.set(index, vLink); + } /** - * Method setLink - * * * - * @param linkArray + * @param vLinkArray */ - public void setLink(uk.ac.vamsas.objects.core.Link[] linkArray) - { + public void setLink( + final uk.ac.vamsas.objects.core.Link[] vLinkArray) { //-- copy array - _linkList.removeAllElements(); - for (int i = 0; i < linkArray.length; i++) { - _linkList.addElement(linkArray[i]); + _linkList.clear(); + + for (int i = 0; i < vLinkArray.length; i++) { + this._linkList.add(vLinkArray[i]); } - } //-- void setLink(uk.ac.vamsas.objects.core.Link) + } /** - * Method setMap + * Sets the value of '_linkList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vLinkList the Vector to copy. + */ + public void setLink( + final java.util.Vector vLinkList) { + // copy vector + this._linkList.clear(); + + this._linkList.addAll(vLinkList); + } + + /** + * Sets the value of '_linkList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param linkVector the Vector to set. + */ + public void setLinkAsReference( + final java.util.Vector linkVector) { + this._linkList = linkVector; + } + + /** * * * @param index * @param vMap - */ - public void setMap(int index, uk.ac.vamsas.objects.core.Map vMap) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _mapList.size())) { - throw new IndexOutOfBoundsException("setMap: Index value '"+index+"' not in range [0.."+_mapList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setMap( + final int index, + final uk.ac.vamsas.objects.core.Map vMap) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._mapList.size()) { + throw new IndexOutOfBoundsException("setMap: Index value '" + index + "' not in range [0.." + (this._mapList.size() - 1) + "]"); } - _mapList.setElementAt(vMap, index); - } //-- void setMap(int, uk.ac.vamsas.objects.core.Map) + + this._mapList.set(index, vMap); + } /** - * Method setMap * * - * - * @param mapArray + * @param vMapArray */ - public void setMap(uk.ac.vamsas.objects.core.Map[] mapArray) - { + public void setMap( + final uk.ac.vamsas.objects.core.Map[] vMapArray) { //-- copy array - _mapList.removeAllElements(); - for (int i = 0; i < mapArray.length; i++) { - _mapList.addElement(mapArray[i]); + _mapList.clear(); + + for (int i = 0; i < vMapArray.length; i++) { + this._mapList.add(vMapArray[i]); } - } //-- void setMap(uk.ac.vamsas.objects.core.Map) + } /** - * Method setProperty + * Sets the value of '_mapList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vMapList the Vector to copy. + */ + public void setMap( + final java.util.Vector vMapList) { + // copy vector + this._mapList.clear(); + + this._mapList.addAll(vMapList); + } + + /** + * Sets the value of '_mapList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param mapVector the Vector to set. + */ + public void setMapAsReference( + final java.util.Vector mapVector) { + this._mapList = mapVector; + } + + /** * * * @param index * @param vProperty - */ - public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - _propertyList.setElementAt(vProperty, index); - } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + this._propertyList.set(index, vProperty); + } /** - * Method setProperty - * * * - * @param propertyArray + * @param vPropertyArray */ - public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) - { + public void setProperty( + final uk.ac.vamsas.objects.core.Property[] vPropertyArray) { //-- copy array - _propertyList.removeAllElements(); - for (int i = 0; i < propertyArray.length; i++) { - _propertyList.addElement(propertyArray[i]); + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) { + this._propertyList.add(vPropertyArray[i]); } - } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + } + + /** + * Sets the value of '_propertyList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vPropertyList the Vector to copy. + */ + public void setProperty( + final java.util.Vector vPropertyList) { + // copy vector + this._propertyList.clear(); + + this._propertyList.addAll(vPropertyList); + } + + /** + * Sets the value of '_propertyList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param propertyVector the Vector to set. + */ + public void setPropertyAsReference( + final java.util.Vector propertyVector) { + this._propertyList = propertyVector; + } /** * Sets the value of field 'source'. The field 'source' has the @@ -761,10 +915,10 @@ implements java.io.Serializable * * @param source the value of field 'source'. */ - public void setSource(java.lang.String source) - { + public void setSource( + final java.lang.String source) { this._source = source; - } //-- void setSource(java.lang.String) + } /** * Sets the value of field 'version'. The field 'version' has @@ -773,34 +927,38 @@ implements java.io.Serializable * * @param version the value of field 'version'. */ - public void setVersion(java.lang.String version) - { + public void setVersion( + final java.lang.String version) { this._version = version; - } //-- void setVersion(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return DbRef - */ - public static uk.ac.vamsas.objects.core.DbRef unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.DbRef + */ + public static uk.ac.vamsas.objects.core.DbRef unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.DbRef) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DbRef.class, reader); - } //-- uk.ac.vamsas.objects.core.DbRef unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Entry.java b/src/uk/ac/vamsas/objects/core/Entry.java index 6def10e..d484a25 100644 --- a/src/uk/ac/vamsas/objects/core/Entry.java +++ b/src/uk/ac/vamsas/objects/core/Entry.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Entry. @@ -84,13 +75,12 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Entry() - { + public Entry() { super(); - _propertyList = new Vector(); - _paramList = new Vector(); - _inputList = new Vector(); - } //-- uk.ac.vamsas.objects.core.Entry() + this._propertyList = new java.util.Vector(); + this._paramList = new java.util.Vector(); + this._inputList = new java.util.Vector(); + } //-----------/ @@ -98,130 +88,130 @@ implements java.io.Serializable //-----------/ /** - * Method addInput - * * * * @param vInput + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addInput(uk.ac.vamsas.objects.core.Input vInput) - throws java.lang.IndexOutOfBoundsException - { - _inputList.addElement(vInput); - } //-- void addInput(uk.ac.vamsas.objects.core.Input) + public void addInput( + final uk.ac.vamsas.objects.core.Input vInput) + throws java.lang.IndexOutOfBoundsException { + this._inputList.addElement(vInput); + } /** - * Method addInput - * * * * @param index * @param vInput + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addInput(int index, uk.ac.vamsas.objects.core.Input vInput) - throws java.lang.IndexOutOfBoundsException - { - _inputList.insertElementAt(vInput, index); - } //-- void addInput(int, uk.ac.vamsas.objects.core.Input) + public void addInput( + final int index, + final uk.ac.vamsas.objects.core.Input vInput) + throws java.lang.IndexOutOfBoundsException { + this._inputList.add(index, vInput); + } /** - * Method addParam - * * * * @param vParam + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addParam(uk.ac.vamsas.objects.core.Param vParam) - throws java.lang.IndexOutOfBoundsException - { - _paramList.addElement(vParam); - } //-- void addParam(uk.ac.vamsas.objects.core.Param) + public void addParam( + final uk.ac.vamsas.objects.core.Param vParam) + throws java.lang.IndexOutOfBoundsException { + this._paramList.addElement(vParam); + } /** - * Method addParam - * * * * @param index * @param vParam + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addParam(int index, uk.ac.vamsas.objects.core.Param vParam) - throws java.lang.IndexOutOfBoundsException - { - _paramList.insertElementAt(vParam, index); - } //-- void addParam(int, uk.ac.vamsas.objects.core.Param) + public void addParam( + final int index, + final uk.ac.vamsas.objects.core.Param vParam) + throws java.lang.IndexOutOfBoundsException { + this._paramList.add(index, vParam); + } /** - * Method addProperty - * * * * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.addElement(vProperty); - } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + public void addProperty( + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.addElement(vProperty); + } /** - * Method addProperty - * * * * @param index * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.insertElementAt(vProperty, index); - } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + public void addProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.add(index, vProperty); + } /** - * Method enumerateInput - * - * + * Method enumerateInput. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Input elements */ - public java.util.Enumeration enumerateInput() - { - return _inputList.elements(); - } //-- java.util.Enumeration enumerateInput() + public java.util.Enumeration enumerateInput( + ) { + return this._inputList.elements(); + } /** - * Method enumerateParam + * Method enumerateParam. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Param elements */ - public java.util.Enumeration enumerateParam() - { - return _paramList.elements(); - } //-- java.util.Enumeration enumerateParam() + public java.util.Enumeration enumerateParam( + ) { + return this._paramList.elements(); + } /** - * Method enumerateProperty - * - * + * Method enumerateProperty. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Property elements */ - public java.util.Enumeration enumerateProperty() - { - return _propertyList.elements(); - } //-- java.util.Enumeration enumerateProperty() + public java.util.Enumeration enumerateProperty( + ) { + return this._propertyList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -290,43 +280,40 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'action'. The field 'action' has * the following description: Did what * - * @return String - * @return the value of field 'action'. + * @return the value of field 'Action'. */ - public java.lang.String getAction() - { + public java.lang.String getAction( + ) { return this._action; - } //-- java.lang.String getAction() + } /** * Returns the value of field 'app'. The field 'app' has the * following description: With which application * - * @return String - * @return the value of field 'app'. + * @return the value of field 'App'. */ - public java.lang.String getApp() - { + public java.lang.String getApp( + ) { return this._app; - } //-- java.lang.String getApp() + } /** * Returns the value of field 'date'. The field 'date' has the * following description: When * - * @return Date - * @return the value of field 'date'. + * @return the value of field 'Date'. */ - public org.exolab.castor.types.Date getDate() - { + public org.exolab.castor.types.Date getDate( + ) { return this._date; - } //-- org.exolab.castor.types.Date getDate() + } /** * Returns the value of field 'id'. The field 'id' has the @@ -334,287 +321,375 @@ implements java.io.Serializable * referencing * * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** - * Method getInput - * - * + * Method getInput. * * @param index - * @return Input - */ - public uk.ac.vamsas.objects.core.Input getInput(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _inputList.size())) { - throw new IndexOutOfBoundsException("getInput: Index value '"+index+"' not in range [0.."+_inputList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Input at + * the given index + */ + public uk.ac.vamsas.objects.core.Input getInput( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._inputList.size()) { + throw new IndexOutOfBoundsException("getInput: Index value '" + index + "' not in range [0.." + (this._inputList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Input) _inputList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Input getInput(int) + return (uk.ac.vamsas.objects.core.Input) _inputList.get(index); + } /** - * Method getInput - * + * Method getInput.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return Input + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Input[] getInput() - { - int size = _inputList.size(); - uk.ac.vamsas.objects.core.Input[] mArray = new uk.ac.vamsas.objects.core.Input[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Input) _inputList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Input[] getInput() + public uk.ac.vamsas.objects.core.Input[] getInput( + ) { + uk.ac.vamsas.objects.core.Input[] array = new uk.ac.vamsas.objects.core.Input[0]; + return (uk.ac.vamsas.objects.core.Input[]) this._inputList.toArray(array); + } /** - * Method getInputCount - * - * + * Method getInputAsReference.Returns a reference to + * '_inputList'. No type checking is performed on any + * modifications to the Vector. * - * @return int + * @return a reference to the Vector backing this class */ - public int getInputCount() - { - return _inputList.size(); - } //-- int getInputCount() + public java.util.Vector getInputAsReference( + ) { + return this._inputList; + } /** - * Method getParam - * + * Method getInputCount. * + * @return the size of this collection + */ + public int getInputCount( + ) { + return this._inputList.size(); + } + + /** + * Method getParam. * * @param index - * @return Param - */ - public uk.ac.vamsas.objects.core.Param getParam(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _paramList.size())) { - throw new IndexOutOfBoundsException("getParam: Index value '"+index+"' not in range [0.."+_paramList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Param at + * the given index + */ + public uk.ac.vamsas.objects.core.Param getParam( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._paramList.size()) { + throw new IndexOutOfBoundsException("getParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Param) _paramList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Param getParam(int) + return (uk.ac.vamsas.objects.core.Param) _paramList.get(index); + } /** - * Method getParam + * Method getParam.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * - * @return Param + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Param[] getParam() - { - int size = _paramList.size(); - uk.ac.vamsas.objects.core.Param[] mArray = new uk.ac.vamsas.objects.core.Param[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Param) _paramList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Param[] getParam() + public uk.ac.vamsas.objects.core.Param[] getParam( + ) { + uk.ac.vamsas.objects.core.Param[] array = new uk.ac.vamsas.objects.core.Param[0]; + return (uk.ac.vamsas.objects.core.Param[]) this._paramList.toArray(array); + } /** - * Method getParamCount - * + * Method getParamAsReference.Returns a reference to + * '_paramList'. No type checking is performed on any + * modifications to the Vector. * - * - * @return int + * @return a reference to the Vector backing this class */ - public int getParamCount() - { - return _paramList.size(); - } //-- int getParamCount() + public java.util.Vector getParamAsReference( + ) { + return this._paramList; + } /** - * Method getProperty - * + * Method getParamCount. * + * @return the size of this collection + */ + public int getParamCount( + ) { + return this._paramList.size(); + } + + /** + * Method getProperty. * * @param index - * @return Property - */ - public uk.ac.vamsas.objects.core.Property getProperty(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Property + * at the given index + */ + public uk.ac.vamsas.objects.core.Property getProperty( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index); + } /** - * Method getProperty - * - * + * Method getProperty.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * @return Property + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Property[] getProperty() - { - int size = _propertyList.size(); - uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + public uk.ac.vamsas.objects.core.Property[] getProperty( + ) { + uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0]; + return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array); + } /** - * Method getPropertyCount - * + * Method getPropertyAsReference.Returns a reference to + * '_propertyList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getPropertyAsReference( + ) { + return this._propertyList; + } + + /** + * Method getPropertyCount. * - * @return int + * @return the size of this collection */ - public int getPropertyCount() - { - return _propertyList.size(); - } //-- int getPropertyCount() + public int getPropertyCount( + ) { + return this._propertyList.size(); + } /** * Returns the value of field 'user'. The field 'user' has the * following description: Who * - * @return String - * @return the value of field 'user'. + * @return the value of field 'User'. */ - public java.lang.String getUser() - { + public java.lang.String getUser( + ) { return this._user; - } //-- java.lang.String getUser() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_user != null) { + result = 37 * result + _user.hashCode(); + } + if (_app != null) { + result = 37 * result + _app.hashCode(); + } + if (_action != null) { + result = 37 * result + _action.hashCode(); + } + if (_date != null) { + result = 37 * result + _date.hashCode(); + } + if (_propertyList != null) { + result = 37 * result + _propertyList.hashCode(); + } + if (_paramList != null) { + result = 37 * result + _paramList.hashCode(); + } + if (_inputList != null) { + result = 37 * result + _inputList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAllInput - * */ - public void removeAllInput() - { - _inputList.removeAllElements(); - } //-- void removeAllInput() + public void removeAllInput( + ) { + this._inputList.clear(); + } /** - * Method removeAllParam - * */ - public void removeAllParam() - { - _paramList.removeAllElements(); - } //-- void removeAllParam() + public void removeAllParam( + ) { + this._paramList.clear(); + } /** - * Method removeAllProperty - * */ - public void removeAllProperty() - { - _propertyList.removeAllElements(); - } //-- void removeAllProperty() + public void removeAllProperty( + ) { + this._propertyList.clear(); + } /** - * Method removeInput - * + * Method removeInput. * + * @param vInput + * @return true if the object was removed from the collection. + */ + public boolean removeInput( + final uk.ac.vamsas.objects.core.Input vInput) { + boolean removed = _inputList.remove(vInput); + return removed; + } + + /** + * Method removeInputAt. * * @param index - * @return Input + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Input removeInput(int index) - { - java.lang.Object obj = _inputList.elementAt(index); - _inputList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Input removeInputAt( + final int index) { + java.lang.Object obj = this._inputList.remove(index); return (uk.ac.vamsas.objects.core.Input) obj; - } //-- uk.ac.vamsas.objects.core.Input removeInput(int) + } /** - * Method removeParam - * + * Method removeParam. * + * @param vParam + * @return true if the object was removed from the collection. + */ + public boolean removeParam( + final uk.ac.vamsas.objects.core.Param vParam) { + boolean removed = _paramList.remove(vParam); + return removed; + } + + /** + * Method removeParamAt. * * @param index - * @return Param + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Param removeParam(int index) - { - java.lang.Object obj = _paramList.elementAt(index); - _paramList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Param removeParamAt( + final int index) { + java.lang.Object obj = this._paramList.remove(index); return (uk.ac.vamsas.objects.core.Param) obj; - } //-- uk.ac.vamsas.objects.core.Param removeParam(int) + } /** - * Method removeProperty - * + * Method removeProperty. * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final uk.ac.vamsas.objects.core.Property vProperty) { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. * * @param index - * @return Property + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Property removeProperty(int index) - { - java.lang.Object obj = _propertyList.elementAt(index); - _propertyList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Property removePropertyAt( + final int index) { + java.lang.Object obj = this._propertyList.remove(index); return (uk.ac.vamsas.objects.core.Property) obj; - } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + } /** * Sets the value of field 'action'. The field 'action' has the @@ -622,10 +697,10 @@ implements java.io.Serializable * * @param action the value of field 'action'. */ - public void setAction(java.lang.String action) - { + public void setAction( + final java.lang.String action) { this._action = action; - } //-- void setAction(java.lang.String) + } /** * Sets the value of field 'app'. The field 'app' has the @@ -633,10 +708,10 @@ implements java.io.Serializable * * @param app the value of field 'app'. */ - public void setApp(java.lang.String app) - { + public void setApp( + final java.lang.String app) { this._app = app; - } //-- void setApp(java.lang.String) + } /** * Sets the value of field 'date'. The field 'date' has the @@ -644,10 +719,10 @@ implements java.io.Serializable * * @param date the value of field 'date'. */ - public void setDate(org.exolab.castor.types.Date date) - { + public void setDate( + final org.exolab.castor.types.Date date) { this._date = date; - } //-- void setDate(org.exolab.castor.types.Date) + } /** * Sets the value of field 'id'. The field 'id' has the @@ -657,112 +732,193 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** - * Method setInput - * * * * @param index * @param vInput - */ - public void setInput(int index, uk.ac.vamsas.objects.core.Input vInput) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _inputList.size())) { - throw new IndexOutOfBoundsException("setInput: Index value '"+index+"' not in range [0.."+_inputList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setInput( + final int index, + final uk.ac.vamsas.objects.core.Input vInput) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._inputList.size()) { + throw new IndexOutOfBoundsException("setInput: Index value '" + index + "' not in range [0.." + (this._inputList.size() - 1) + "]"); } - _inputList.setElementAt(vInput, index); - } //-- void setInput(int, uk.ac.vamsas.objects.core.Input) + + this._inputList.set(index, vInput); + } /** - * Method setInput * * - * - * @param inputArray + * @param vInputArray */ - public void setInput(uk.ac.vamsas.objects.core.Input[] inputArray) - { + public void setInput( + final uk.ac.vamsas.objects.core.Input[] vInputArray) { //-- copy array - _inputList.removeAllElements(); - for (int i = 0; i < inputArray.length; i++) { - _inputList.addElement(inputArray[i]); + _inputList.clear(); + + for (int i = 0; i < vInputArray.length; i++) { + this._inputList.add(vInputArray[i]); } - } //-- void setInput(uk.ac.vamsas.objects.core.Input) + } /** - * Method setParam + * Sets the value of '_inputList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vInputList the Vector to copy. + */ + public void setInput( + final java.util.Vector vInputList) { + // copy vector + this._inputList.clear(); + + this._inputList.addAll(vInputList); + } + + /** + * Sets the value of '_inputList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param inputVector the Vector to set. + */ + public void setInputAsReference( + final java.util.Vector inputVector) { + this._inputList = inputVector; + } + + /** * * * @param index * @param vParam - */ - public void setParam(int index, uk.ac.vamsas.objects.core.Param vParam) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _paramList.size())) { - throw new IndexOutOfBoundsException("setParam: Index value '"+index+"' not in range [0.."+_paramList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setParam( + final int index, + final uk.ac.vamsas.objects.core.Param vParam) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._paramList.size()) { + throw new IndexOutOfBoundsException("setParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]"); } - _paramList.setElementAt(vParam, index); - } //-- void setParam(int, uk.ac.vamsas.objects.core.Param) + + this._paramList.set(index, vParam); + } /** - * Method setParam - * * * - * @param paramArray + * @param vParamArray */ - public void setParam(uk.ac.vamsas.objects.core.Param[] paramArray) - { + public void setParam( + final uk.ac.vamsas.objects.core.Param[] vParamArray) { //-- copy array - _paramList.removeAllElements(); - for (int i = 0; i < paramArray.length; i++) { - _paramList.addElement(paramArray[i]); + _paramList.clear(); + + for (int i = 0; i < vParamArray.length; i++) { + this._paramList.add(vParamArray[i]); } - } //-- void setParam(uk.ac.vamsas.objects.core.Param) + } /** - * Method setProperty + * Sets the value of '_paramList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vParamList the Vector to copy. + */ + public void setParam( + final java.util.Vector vParamList) { + // copy vector + this._paramList.clear(); + + this._paramList.addAll(vParamList); + } + + /** + * Sets the value of '_paramList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param paramVector the Vector to set. + */ + public void setParamAsReference( + final java.util.Vector paramVector) { + this._paramList = paramVector; + } + + /** * * * @param index * @param vProperty - */ - public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - _propertyList.setElementAt(vProperty, index); - } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + this._propertyList.set(index, vProperty); + } /** - * Method setProperty * * - * - * @param propertyArray + * @param vPropertyArray */ - public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) - { + public void setProperty( + final uk.ac.vamsas.objects.core.Property[] vPropertyArray) { //-- copy array - _propertyList.removeAllElements(); - for (int i = 0; i < propertyArray.length; i++) { - _propertyList.addElement(propertyArray[i]); + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) { + this._propertyList.add(vPropertyArray[i]); } - } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + } + + /** + * Sets the value of '_propertyList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vPropertyList the Vector to copy. + */ + public void setProperty( + final java.util.Vector vPropertyList) { + // copy vector + this._propertyList.clear(); + + this._propertyList.addAll(vPropertyList); + } + + /** + * Sets the value of '_propertyList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param propertyVector the Vector to set. + */ + public void setPropertyAsReference( + final java.util.Vector propertyVector) { + this._propertyList = propertyVector; + } /** * Sets the value of field 'user'. The field 'user' has the @@ -770,34 +926,38 @@ implements java.io.Serializable * * @param user the value of field 'user'. */ - public void setUser(java.lang.String user) - { + public void setUser( + final java.lang.String user) { this._user = user; - } //-- void setUser(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Entry - */ - public static uk.ac.vamsas.objects.core.Entry unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Entry + */ + public static uk.ac.vamsas.objects.core.Entry unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Entry) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Entry.class, reader); - } //-- uk.ac.vamsas.objects.core.Entry unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Glyph.java b/src/uk/ac/vamsas/objects/core/Glyph.java index 8fd8feb..ae91252 100644 --- a/src/uk/ac/vamsas/objects/core/Glyph.java +++ b/src/uk/ac/vamsas/objects/core/Glyph.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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; /** * Discrete symbol - possibly graphically represented @@ -55,12 +48,11 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Glyph() - { + public Glyph() { super(); setContent(""); setDict("utf8"); - } //-- uk.ac.vamsas.objects.core.Glyph() + } //-----------/ @@ -68,13 +60,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -101,19 +93,18 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'content'. The field 'content' * has the following description: internal content storage * - * @return String - * @return the value of field 'content'. + * @return the value of field 'Content'. */ - public java.lang.String getContent() - { + public java.lang.String getContent( + ) { return this._content; - } //-- java.lang.String getContent() + } /** * Returns the value of field 'dict'. The field 'dict' has the @@ -124,59 +115,82 @@ implements java.io.Serializable * applications must ensure they gracefully deal with * invalid entries here * - * @return String - * @return the value of field 'dict'. + * @return the value of field 'Dict'. */ - public java.lang.String getDict() - { + public java.lang.String getDict( + ) { return this._dict; - } //-- java.lang.String getDict() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_content != null) { + result = 37 * result + _content.hashCode(); + } + if (_dict != null) { + result = 37 * result + _dict.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'content'. The field 'content' has @@ -184,10 +198,10 @@ implements java.io.Serializable * * @param content the value of field 'content'. */ - public void setContent(java.lang.String content) - { + public void setContent( + final java.lang.String content) { this._content = content; - } //-- void setContent(java.lang.String) + } /** * Sets the value of field 'dict'. The field 'dict' has the @@ -200,34 +214,38 @@ implements java.io.Serializable * * @param dict the value of field 'dict'. */ - public void setDict(java.lang.String dict) - { + public void setDict( + final java.lang.String dict) { this._dict = dict; - } //-- void setDict(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Glyph + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Glyph */ - public static uk.ac.vamsas.objects.core.Glyph unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Glyph unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Glyph) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Glyph.class, reader); - } //-- uk.ac.vamsas.objects.core.Glyph unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Input.java b/src/uk/ac/vamsas/objects/core/Input.java index db1af9e..5d8b2b3 100644 --- a/src/uk/ac/vamsas/objects/core/Input.java +++ b/src/uk/ac/vamsas/objects/core/Input.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Input. @@ -36,7 +29,7 @@ implements java.io.Serializable //--------------------------/ /** - * Field _name + * Field _name. */ private java.lang.String _name; @@ -51,10 +44,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Input() - { + public Input() { super(); - } //-- uk.ac.vamsas.objects.core.Input() + } //-----------/ @@ -62,13 +54,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -95,18 +87,17 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'name'. * - * @return String - * @return the value of field 'name'. + * @return the value of field 'Name'. */ - public java.lang.String getName() - { + public java.lang.String getName( + ) { return this._name; - } //-- java.lang.String getName() + } /** * Returns the value of field 'objRef'. The field 'objRef' has @@ -114,69 +105,92 @@ implements java.io.Serializable * specfication * * - * @return Object - * @return the value of field 'objRef'. + * @return the value of field 'ObjRef'. */ - public java.lang.Object getObjRef() - { + public java.lang.Object getObjRef( + ) { return this._objRef; - } //-- java.lang.Object getObjRef() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_name != null) { + result = 37 * result + _name.hashCode(); + } + if (_objRef != null) { + result = 37 * result + _objRef.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'name'. * * @param name the value of field 'name'. */ - public void setName(java.lang.String name) - { + public void setName( + final java.lang.String name) { this._name = name; - } //-- void setName(java.lang.String) + } /** * Sets the value of field 'objRef'. The field 'objRef' has the @@ -186,34 +200,38 @@ implements java.io.Serializable * * @param objRef the value of field 'objRef'. */ - public void setObjRef(java.lang.Object objRef) - { + public void setObjRef( + final java.lang.Object objRef) { this._objRef = objRef; - } //-- void setObjRef(java.lang.Object) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return RangeType + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType */ - public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.Input) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Input.class, reader); - } //-- uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.RangeType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Input.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Instance.java b/src/uk/ac/vamsas/objects/core/Instance.java index 6b7bfe5..6cfeec0 100644 --- a/src/uk/ac/vamsas/objects/core/Instance.java +++ b/src/uk/ac/vamsas/objects/core/Instance.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Instance. @@ -36,7 +29,7 @@ implements java.io.Serializable //--------------------------/ /** - * Field _urn + * Field _urn. */ private java.lang.String _urn; @@ -45,10 +38,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Instance() - { + public Instance() { super(); - } //-- uk.ac.vamsas.objects.core.Instance() + } //-----------/ @@ -56,13 +48,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -82,98 +74,122 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'urn'. * - * @return String - * @return the value of field 'urn'. + * @return the value of field 'Urn'. */ - public java.lang.String getUrn() - { + public java.lang.String getUrn( + ) { return this._urn; - } //-- java.lang.String getUrn() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_urn != null) { + result = 37 * result + _urn.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'urn'. * * @param urn the value of field 'urn'. */ - public void setUrn(java.lang.String urn) - { + public void setUrn( + final java.lang.String urn) { this._urn = urn; - } //-- void setUrn(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return AppData + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.AppData */ - public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.Instance) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Instance.class, reader); - } //-- uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.AppData unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Instance.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Link.java b/src/uk/ac/vamsas/objects/core/Link.java index ac155e8..aea537d 100644 --- a/src/uk/ac/vamsas/objects/core/Link.java +++ b/src/uk/ac/vamsas/objects/core/Link.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Link. @@ -50,11 +43,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Link() - { + public Link() { super(); setContent(""); - } //-- uk.ac.vamsas.objects.core.Link() + } //-----------/ @@ -62,13 +54,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -95,77 +87,99 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'content'. The field 'content' * has the following description: internal content storage * - * @return String - * @return the value of field 'content'. + * @return the value of field 'Content'. */ - public java.lang.String getContent() - { + public java.lang.String getContent( + ) { return this._content; - } //-- java.lang.String getContent() + } /** * Returns the value of field 'href'. The field 'href' has the * following description: The URI * - * @return String - * @return the value of field 'href'. + * @return the value of field 'Href'. */ - public java.lang.String getHref() - { + public java.lang.String getHref( + ) { return this._href; - } //-- java.lang.String getHref() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_content != null) { + result = 37 * result + _content.hashCode(); + } + if (_href != null) { + result = 37 * result + _href.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'content'. The field 'content' has @@ -173,10 +187,10 @@ implements java.io.Serializable * * @param content the value of field 'content'. */ - public void setContent(java.lang.String content) - { + public void setContent( + final java.lang.String content) { this._content = content; - } //-- void setContent(java.lang.String) + } /** * Sets the value of field 'href'. The field 'href' has the @@ -184,34 +198,38 @@ implements java.io.Serializable * * @param href the value of field 'href'. */ - public void setHref(java.lang.String href) - { + public void setHref( + final java.lang.String href) { this._href = href; - } //-- void setHref(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Link + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Link */ - public static uk.ac.vamsas.objects.core.Link unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Link unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Link) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Link.class, reader); - } //-- uk.ac.vamsas.objects.core.Link unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/LockFile.java b/src/uk/ac/vamsas/objects/core/LockFile.java index d2dcb60..915bd07 100644 --- a/src/uk/ac/vamsas/objects/core/LockFile.java +++ b/src/uk/ac/vamsas/objects/core/LockFile.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 LockFile. @@ -45,11 +38,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public LockFile() - { + public LockFile() { super(); setContent(""); - } //-- uk.ac.vamsas.objects.core.LockFile() + } //-----------/ @@ -57,13 +49,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -83,65 +75,85 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'content'. The field 'content' * has the following description: internal content storage * - * @return String - * @return the value of field 'content'. + * @return the value of field 'Content'. */ - public java.lang.String getContent() - { + public java.lang.String getContent( + ) { return this._content; - } //-- java.lang.String getContent() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_content != null) { + result = 37 * result + _content.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'content'. The field 'content' has @@ -149,34 +161,38 @@ implements java.io.Serializable * * @param content the value of field 'content'. */ - public void setContent(java.lang.String content) - { + public void setContent( + final java.lang.String content) { this._content = content; - } //-- void setContent(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return LockFile + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.LockFile */ - public static uk.ac.vamsas.objects.core.LockFile unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.LockFile unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.LockFile) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.LockFile.class, reader); - } //-- uk.ac.vamsas.objects.core.LockFile unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Map.java b/src/uk/ac/vamsas/objects/core/Map.java index 882c2e4..5d5668d 100644 --- a/src/uk/ac/vamsas/objects/core/Map.java +++ b/src/uk/ac/vamsas/objects/core/Map.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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; /** * From: Offset to first @@ -45,10 +38,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Map() - { + public Map() { super(); - } //-- uk.ac.vamsas.objects.core.Map() + } //-----------/ @@ -56,13 +48,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -71,81 +63,102 @@ implements java.io.Serializable if (obj instanceof Map) { - Map temp = (Map)obj; - return true; - } - return false; - } //-- boolean equals(java.lang.Object) + return true; + } + return false; + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 unmarshal - * - * + * Method unmarshal. * * @param reader - * @return MapList + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.MapList */ - public static uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.Map) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Map.class, reader); - } //-- uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.MapList unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Map.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/MapList.java b/src/uk/ac/vamsas/objects/core/MapList.java index 63d6a1e..af7ebb6 100644 --- a/src/uk/ac/vamsas/objects/core/MapList.java +++ b/src/uk/ac/vamsas/objects/core/MapList.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 MapList. @@ -40,7 +33,7 @@ implements java.io.Serializable * start * position on 'onto' maps to */ - private int _from = 0; + private long _from = 0; /** * keeps track of state for field: _from @@ -51,7 +44,7 @@ implements java.io.Serializable * Offset to last position in dataset sequence record that end * position on 'onto' maps to */ - private int _to = 0; + private long _to = 0; /** * keeps track of state for field: _to @@ -63,7 +56,7 @@ implements java.io.Serializable * offset) * position in sequence maps to */ - private int _start; + private long _start; /** * keeps track of state for field: _start @@ -74,7 +67,7 @@ implements java.io.Serializable * Offset to last position in database entry that last (offset) * position in sequence maps to */ - private int _end; + private long _end; /** * keeps track of state for field: _end @@ -86,10 +79,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public MapList() - { + public MapList() { super(); - } //-- uk.ac.vamsas.objects.core.MapList() + } //-----------/ @@ -97,49 +89,41 @@ implements java.io.Serializable //-----------/ /** - * Method deleteEnd - * */ - public void deleteEnd() - { + public void deleteEnd( + ) { this._has_end= false; - } //-- void deleteEnd() + } /** - * Method deleteFrom - * */ - public void deleteFrom() - { + public void deleteFrom( + ) { this._has_from= false; - } //-- void deleteFrom() + } /** - * Method deleteStart - * */ - public void deleteStart() - { + public void deleteStart( + ) { this._has_start= false; - } //-- void deleteStart() + } /** - * Method deleteTo - * */ - public void deleteTo() - { + public void deleteTo( + ) { this._has_to= false; - } //-- void deleteTo() + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -168,7 +152,7 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'end'. The field 'end' has the @@ -176,13 +160,12 @@ implements java.io.Serializable * entry that last (offset) * position in sequence maps to * - * @return int - * @return the value of field 'end'. + * @return the value of field 'End'. */ - public int getEnd() - { + public long getEnd( + ) { return this._end; - } //-- int getEnd() + } /** * Returns the value of field 'from'. The field 'from' has the @@ -190,13 +173,12 @@ implements java.io.Serializable * sequence record that start * position on 'onto' maps to * - * @return int - * @return the value of field 'from'. + * @return the value of field 'From'. */ - public int getFrom() - { + public long getFrom( + ) { return this._from; - } //-- int getFrom() + } /** * Returns the value of field 'start'. The field 'start' has @@ -204,13 +186,12 @@ implements java.io.Serializable * database entry that first (or offset) * position in sequence maps to * - * @return int - * @return the value of field 'start'. + * @return the value of field 'Start'. */ - public int getStart() - { + public long getStart( + ) { return this._start; - } //-- int getStart() + } /** * Returns the value of field 'to'. The field 'to' has the @@ -218,107 +199,120 @@ implements java.io.Serializable * sequence record that end * position on 'onto' maps to * - * @return int - * @return the value of field 'to'. + * @return the value of field 'To'. */ - public int getTo() - { + public long getTo( + ) { return this._to; - } //-- int getTo() + } /** - * Method hasEnd + * Method hasEnd. * - * - * - * @return boolean + * @return true if at least one End has been added */ - public boolean hasEnd() - { + public boolean hasEnd( + ) { return this._has_end; - } //-- boolean hasEnd() + } /** - * Method hasFrom - * + * Method hasFrom. * - * - * @return boolean + * @return true if at least one From has been added */ - public boolean hasFrom() - { + public boolean hasFrom( + ) { return this._has_from; - } //-- boolean hasFrom() + } /** - * Method hasStart - * - * + * Method hasStart. * - * @return boolean + * @return true if at least one Start has been added */ - public boolean hasStart() - { + public boolean hasStart( + ) { return this._has_start; - } //-- boolean hasStart() + } /** - * Method hasTo + * Method hasTo. * - * - * - * @return boolean + * @return true if at least one To has been added */ - public boolean hasTo() - { + public boolean hasTo( + ) { return this._has_to; - } //-- boolean hasTo() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + (int)(_from^(_from>>>32)); + result = 37 * result + (int)(_to^(_to>>>32)); + result = 37 * result + (int)(_start^(_start>>>32)); + result = 37 * result + (int)(_end^(_end>>>32)); + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'end'. The field 'end' has the @@ -328,11 +322,11 @@ implements java.io.Serializable * * @param end the value of field 'end'. */ - public void setEnd(int end) - { + public void setEnd( + final long end) { this._end = end; this._has_end = true; - } //-- void setEnd(int) + } /** * Sets the value of field 'from'. The field 'from' has the @@ -342,11 +336,11 @@ implements java.io.Serializable * * @param from the value of field 'from'. */ - public void setFrom(int from) - { + public void setFrom( + final long from) { this._from = from; this._has_from = true; - } //-- void setFrom(int) + } /** * Sets the value of field 'start'. The field 'start' has the @@ -356,11 +350,11 @@ implements java.io.Serializable * * @param start the value of field 'start'. */ - public void setStart(int start) - { + public void setStart( + final long start) { this._start = start; this._has_start = true; - } //-- void setStart(int) + } /** * Sets the value of field 'to'. The field 'to' has the @@ -370,35 +364,39 @@ implements java.io.Serializable * * @param to the value of field 'to'. */ - public void setTo(int to) - { + public void setTo( + final long to) { this._to = to; this._has_to = true; - } //-- void setTo(int) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return MapList + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.MapList */ - public static uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.MapList unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapList.class, reader); - } //-- uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Mapping.java b/src/uk/ac/vamsas/objects/core/Mapping.java index f5c3317..97eadf1 100644 --- a/src/uk/ac/vamsas/objects/core/Mapping.java +++ b/src/uk/ac/vamsas/objects/core/Mapping.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Mapping. @@ -46,10 +39,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Mapping() - { + public Mapping() { super(); - } //-- uk.ac.vamsas.objects.core.Mapping() + } //-----------/ @@ -57,13 +49,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -83,7 +75,7 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'onto'. The field 'onto' has the @@ -91,59 +83,79 @@ implements java.io.Serializable * mapped * * - * @return Object - * @return the value of field 'onto'. + * @return the value of field 'Onto'. */ - public java.lang.Object getOnto() - { + public java.lang.Object getOnto( + ) { return this._onto; - } //-- java.lang.Object getOnto() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_onto != null) { + result = 37 * result + _onto.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'onto'. The field 'onto' has the @@ -153,34 +165,38 @@ implements java.io.Serializable * * @param onto the value of field 'onto'. */ - public void setOnto(java.lang.Object onto) - { + public void setOnto( + final java.lang.Object onto) { this._onto = onto; - } //-- void setOnto(java.lang.Object) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return MapList + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.MapList */ - public static uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.Mapping) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Mapping.class, reader); - } //-- uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.MapList unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Mapping.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Newick.java b/src/uk/ac/vamsas/objects/core/Newick.java index 7e9f372..23d4f82 100644 --- a/src/uk/ac/vamsas/objects/core/Newick.java +++ b/src/uk/ac/vamsas/objects/core/Newick.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Newick. @@ -41,7 +34,7 @@ implements java.io.Serializable private java.lang.String _content = ""; /** - * Field _title + * Field _title. */ private java.lang.String _title; @@ -52,7 +45,7 @@ implements java.io.Serializable private java.lang.String _id; /** - * Field _modifiable + * Field _modifiable. */ private java.lang.String _modifiable; @@ -61,11 +54,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Newick() - { + public Newick() { super(); setContent(""); - } //-- uk.ac.vamsas.objects.core.Newick() + } //-----------/ @@ -73,13 +65,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -120,19 +112,18 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'content'. The field 'content' * has the following description: internal content storage * - * @return String - * @return the value of field 'content'. + * @return the value of field 'Content'. */ - public java.lang.String getContent() - { + public java.lang.String getContent( + ) { return this._content; - } //-- java.lang.String getContent() + } /** * Returns the value of field 'id'. The field 'id' has the @@ -140,81 +131,108 @@ implements java.io.Serializable * referencing * * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** * Returns the value of field 'modifiable'. * - * @return String - * @return the value of field 'modifiable'. + * @return the value of field 'Modifiable'. */ - public java.lang.String getModifiable() - { + public java.lang.String getModifiable( + ) { return this._modifiable; - } //-- java.lang.String getModifiable() + } /** * Returns the value of field 'title'. * - * @return String - * @return the value of field 'title'. + * @return the value of field 'Title'. */ - public java.lang.String getTitle() - { + public java.lang.String getTitle( + ) { return this._title; - } //-- java.lang.String getTitle() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_content != null) { + result = 37 * result + _content.hashCode(); + } + if (_title != null) { + result = 37 * result + _title.hashCode(); + } + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_modifiable != null) { + result = 37 * result + _modifiable.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'content'. The field 'content' has @@ -222,10 +240,10 @@ implements java.io.Serializable * * @param content the value of field 'content'. */ - public void setContent(java.lang.String content) - { + public void setContent( + final java.lang.String content) { this._content = content; - } //-- void setContent(java.lang.String) + } /** * Sets the value of field 'id'. The field 'id' has the @@ -235,54 +253,58 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'modifiable'. * * @param modifiable the value of field 'modifiable'. */ - public void setModifiable(java.lang.String modifiable) - { + public void setModifiable( + final java.lang.String modifiable) { this._modifiable = modifiable; - } //-- void setModifiable(java.lang.String) + } /** * Sets the value of field 'title'. * * @param title the value of field 'title'. */ - public void setTitle(java.lang.String title) - { + public void setTitle( + final java.lang.String title) { this._title = title; - } //-- void setTitle(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Newick + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Newick */ - public static uk.ac.vamsas.objects.core.Newick unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Newick unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Newick) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Newick.class, reader); - } //-- uk.ac.vamsas.objects.core.Newick unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Param.java b/src/uk/ac/vamsas/objects/core/Param.java index 99acc26..744dba5 100644 --- a/src/uk/ac/vamsas/objects/core/Param.java +++ b/src/uk/ac/vamsas/objects/core/Param.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Param. @@ -41,7 +34,7 @@ implements java.io.Serializable private java.lang.String _content = ""; /** - * Field _name + * Field _name. */ private java.lang.String _name; @@ -58,11 +51,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Param() - { + public Param() { super(); setContent(""); - } //-- uk.ac.vamsas.objects.core.Param() + } //-----------/ @@ -70,13 +62,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -110,30 +102,28 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'content'. The field 'content' * has the following description: internal content storage * - * @return String - * @return the value of field 'content'. + * @return the value of field 'Content'. */ - public java.lang.String getContent() - { + public java.lang.String getContent( + ) { return this._content; - } //-- java.lang.String getContent() + } /** * Returns the value of field 'name'. * - * @return String - * @return the value of field 'name'. + * @return the value of field 'Name'. */ - public java.lang.String getName() - { + public java.lang.String getName( + ) { return this._name; - } //-- java.lang.String getName() + } /** * Returns the value of field 'type'. The field 'type' has the @@ -143,59 +133,85 @@ implements java.io.Serializable * prototype the * input to a document. TODO: specify allowed types * - * @return String - * @return the value of field 'type'. + * @return the value of field 'Type'. */ - public java.lang.String getType() - { + public java.lang.String getType( + ) { return this._type; - } //-- java.lang.String getType() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_content != null) { + result = 37 * result + _content.hashCode(); + } + if (_name != null) { + result = 37 * result + _name.hashCode(); + } + if (_type != null) { + result = 37 * result + _type.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'content'. The field 'content' has @@ -203,20 +219,20 @@ implements java.io.Serializable * * @param content the value of field 'content'. */ - public void setContent(java.lang.String content) - { + public void setContent( + final java.lang.String content) { this._content = content; - } //-- void setContent(java.lang.String) + } /** * Sets the value of field 'name'. * * @param name the value of field 'name'. */ - public void setName(java.lang.String name) - { + public void setName( + final java.lang.String name) { this._name = name; - } //-- void setName(java.lang.String) + } /** * Sets the value of field 'type'. The field 'type' has the @@ -228,34 +244,38 @@ implements java.io.Serializable * * @param type the value of field 'type'. */ - public void setType(java.lang.String type) - { + public void setType( + final java.lang.String type) { this._type = type; - } //-- void setType(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Param + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Param */ - public static uk.ac.vamsas.objects.core.Param unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Param unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Param) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Param.class, reader); - } //-- uk.ac.vamsas.objects.core.Param unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Pos.java b/src/uk/ac/vamsas/objects/core/Pos.java index dbf5d47..7a98276 100644 --- a/src/uk/ac/vamsas/objects/core/Pos.java +++ b/src/uk/ac/vamsas/objects/core/Pos.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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; /** * a position within the associated object's coordinate system @@ -37,7 +30,7 @@ implements java.io.Serializable //--------------------------/ /** - * Field _i + * Field _i. */ private int _i; @@ -51,10 +44,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Pos() - { + public Pos() { super(); - } //-- uk.ac.vamsas.objects.core.Pos() + } //-----------/ @@ -62,22 +54,20 @@ implements java.io.Serializable //-----------/ /** - * Method deleteI - * */ - public void deleteI() - { + public void deleteI( + ) { this._has_i= false; - } //-- void deleteI() + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -94,111 +84,131 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'i'. * - * @return int - * @return the value of field 'i'. + * @return the value of field 'I'. */ - public int getI() - { + public int getI( + ) { return this._i; - } //-- int getI() + } /** - * Method hasI - * - * + * Method hasI. * - * @return boolean + * @return true if at least one I has been added */ - public boolean hasI() - { + public boolean hasI( + ) { return this._has_i; - } //-- boolean hasI() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + _i; + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'i'. * * @param i the value of field 'i'. */ - public void setI(int i) - { + public void setI( + final int i) { this._i = i; this._has_i = true; - } //-- void setI(int) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Pos + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Pos */ - public static uk.ac.vamsas.objects.core.Pos unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Pos unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Pos) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Pos.class, reader); - } //-- uk.ac.vamsas.objects.core.Pos unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Property.java b/src/uk/ac/vamsas/objects/core/Property.java index b8c4743..8161092 100644 --- a/src/uk/ac/vamsas/objects/core/Property.java +++ b/src/uk/ac/vamsas/objects/core/Property.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Property. @@ -41,7 +34,7 @@ implements java.io.Serializable private java.lang.String _content = ""; /** - * Field _name + * Field _name. */ private java.lang.String _name; @@ -58,11 +51,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Property() - { + public Property() { super(); setContent(""); - } //-- uk.ac.vamsas.objects.core.Property() + } //-----------/ @@ -70,13 +62,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -110,30 +102,28 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'content'. The field 'content' * has the following description: internal content storage * - * @return String - * @return the value of field 'content'. + * @return the value of field 'Content'. */ - public java.lang.String getContent() - { + public java.lang.String getContent( + ) { return this._content; - } //-- java.lang.String getContent() + } /** * Returns the value of field 'name'. * - * @return String - * @return the value of field 'name'. + * @return the value of field 'Name'. */ - public java.lang.String getName() - { + public java.lang.String getName( + ) { return this._name; - } //-- java.lang.String getName() + } /** * Returns the value of field 'type'. The field 'type' has the @@ -143,59 +133,85 @@ implements java.io.Serializable * prototype the * input to a document. TODO: specify allowed types * - * @return String - * @return the value of field 'type'. + * @return the value of field 'Type'. */ - public java.lang.String getType() - { + public java.lang.String getType( + ) { return this._type; - } //-- java.lang.String getType() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_content != null) { + result = 37 * result + _content.hashCode(); + } + if (_name != null) { + result = 37 * result + _name.hashCode(); + } + if (_type != null) { + result = 37 * result + _type.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'content'. The field 'content' has @@ -203,20 +219,20 @@ implements java.io.Serializable * * @param content the value of field 'content'. */ - public void setContent(java.lang.String content) - { + public void setContent( + final java.lang.String content) { this._content = content; - } //-- void setContent(java.lang.String) + } /** * Sets the value of field 'name'. * * @param name the value of field 'name'. */ - public void setName(java.lang.String name) - { + public void setName( + final java.lang.String name) { this._name = name; - } //-- void setName(java.lang.String) + } /** * Sets the value of field 'type'. The field 'type' has the @@ -228,34 +244,38 @@ implements java.io.Serializable * * @param type the value of field 'type'. */ - public void setType(java.lang.String type) - { + public void setType( + final java.lang.String type) { this._type = type; - } //-- void setType(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Property + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Property */ - public static uk.ac.vamsas.objects.core.Property unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Property unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Property) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Property.class, reader); - } //-- uk.ac.vamsas.objects.core.Property unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Provenance.java b/src/uk/ac/vamsas/objects/core/Provenance.java index 4eb591d..3477b22 100644 --- a/src/uk/ac/vamsas/objects/core/Provenance.java +++ b/src/uk/ac/vamsas/objects/core/Provenance.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Provenance. @@ -38,7 +29,7 @@ implements java.io.Serializable //--------------------------/ /** - * Field _entryList + * Field _entryList. */ private java.util.Vector _entryList; @@ -47,11 +38,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Provenance() - { + public Provenance() { super(); - _entryList = new Vector(); - } //-- uk.ac.vamsas.objects.core.Provenance() + this._entryList = new java.util.Vector(); + } //-----------/ @@ -59,52 +49,52 @@ implements java.io.Serializable //-----------/ /** - * Method addEntry - * * * * @param vEntry + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addEntry(uk.ac.vamsas.objects.core.Entry vEntry) - throws java.lang.IndexOutOfBoundsException - { - _entryList.addElement(vEntry); - } //-- void addEntry(uk.ac.vamsas.objects.core.Entry) + public void addEntry( + final uk.ac.vamsas.objects.core.Entry vEntry) + throws java.lang.IndexOutOfBoundsException { + this._entryList.addElement(vEntry); + } /** - * Method addEntry - * * * * @param index * @param vEntry + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addEntry(int index, uk.ac.vamsas.objects.core.Entry vEntry) - throws java.lang.IndexOutOfBoundsException - { - _entryList.insertElementAt(vEntry, index); - } //-- void addEntry(int, uk.ac.vamsas.objects.core.Entry) + public void addEntry( + final int index, + final uk.ac.vamsas.objects.core.Entry vEntry) + throws java.lang.IndexOutOfBoundsException { + this._entryList.add(index, vEntry); + } /** - * Method enumerateEntry - * + * Method enumerateEntry. * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Entry elements */ - public java.util.Enumeration enumerateEntry() - { - return _entryList.elements(); - } //-- java.util.Enumeration enumerateEntry() + public java.util.Enumeration enumerateEntry( + ) { + return this._entryList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -124,183 +114,251 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** - * Method getEntry - * - * + * Method getEntry. * * @param index - * @return Entry + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Entry at + * the given index */ - public uk.ac.vamsas.objects.core.Entry getEntry(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _entryList.size())) { - throw new IndexOutOfBoundsException("getEntry: Index value '"+index+"' not in range [0.."+_entryList.size()+ "]"); + public uk.ac.vamsas.objects.core.Entry getEntry( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._entryList.size()) { + throw new IndexOutOfBoundsException("getEntry: Index value '" + index + "' not in range [0.." + (this._entryList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Entry) _entryList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Entry getEntry(int) + return (uk.ac.vamsas.objects.core.Entry) _entryList.get(index); + } /** - * Method getEntry + * Method getEntry.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * - * @return Entry + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Entry[] getEntry() - { - int size = _entryList.size(); - uk.ac.vamsas.objects.core.Entry[] mArray = new uk.ac.vamsas.objects.core.Entry[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Entry) _entryList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Entry[] getEntry() + public uk.ac.vamsas.objects.core.Entry[] getEntry( + ) { + uk.ac.vamsas.objects.core.Entry[] array = new uk.ac.vamsas.objects.core.Entry[0]; + return (uk.ac.vamsas.objects.core.Entry[]) this._entryList.toArray(array); + } /** - * Method getEntryCount - * - * + * Method getEntryAsReference.Returns a reference to + * '_entryList'. No type checking is performed on any + * modifications to the Vector. * - * @return int + * @return a reference to the Vector backing this class */ - public int getEntryCount() - { - return _entryList.size(); - } //-- int getEntryCount() + public java.util.Vector getEntryAsReference( + ) { + return this._entryList; + } /** - * Method isValid + * Method getEntryCount. * + * @return the size of this collection + */ + public int getEntryCount( + ) { + return this._entryList.size(); + } + + /** + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_entryList != null) { + result = 37 * result + _entryList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 removeAllEntry - * */ - public void removeAllEntry() - { - _entryList.removeAllElements(); - } //-- void removeAllEntry() + public void removeAllEntry( + ) { + this._entryList.clear(); + } /** - * Method removeEntry - * + * Method removeEntry. * + * @param vEntry + * @return true if the object was removed from the collection. + */ + public boolean removeEntry( + final uk.ac.vamsas.objects.core.Entry vEntry) { + boolean removed = _entryList.remove(vEntry); + return removed; + } + + /** + * Method removeEntryAt. * * @param index - * @return Entry + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Entry removeEntry(int index) - { - java.lang.Object obj = _entryList.elementAt(index); - _entryList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Entry removeEntryAt( + final int index) { + java.lang.Object obj = this._entryList.remove(index); return (uk.ac.vamsas.objects.core.Entry) obj; - } //-- uk.ac.vamsas.objects.core.Entry removeEntry(int) + } /** - * Method setEntry - * * * * @param index * @param vEntry + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setEntry(int index, uk.ac.vamsas.objects.core.Entry vEntry) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _entryList.size())) { - throw new IndexOutOfBoundsException("setEntry: Index value '"+index+"' not in range [0.."+_entryList.size()+ "]"); + public void setEntry( + final int index, + final uk.ac.vamsas.objects.core.Entry vEntry) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._entryList.size()) { + throw new IndexOutOfBoundsException("setEntry: Index value '" + index + "' not in range [0.." + (this._entryList.size() - 1) + "]"); } - _entryList.setElementAt(vEntry, index); - } //-- void setEntry(int, uk.ac.vamsas.objects.core.Entry) + + this._entryList.set(index, vEntry); + } /** - * Method setEntry * * - * - * @param entryArray + * @param vEntryArray */ - public void setEntry(uk.ac.vamsas.objects.core.Entry[] entryArray) - { + public void setEntry( + final uk.ac.vamsas.objects.core.Entry[] vEntryArray) { //-- copy array - _entryList.removeAllElements(); - for (int i = 0; i < entryArray.length; i++) { - _entryList.addElement(entryArray[i]); + _entryList.clear(); + + for (int i = 0; i < vEntryArray.length; i++) { + this._entryList.add(vEntryArray[i]); } - } //-- void setEntry(uk.ac.vamsas.objects.core.Entry) + } /** - * Method unmarshal + * Sets the value of '_entryList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vEntryList the Vector to copy. + */ + public void setEntry( + final java.util.Vector vEntryList) { + // copy vector + this._entryList.clear(); + + this._entryList.addAll(vEntryList); + } + + /** + * Sets the value of '_entryList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated * + * @param entryVector the Vector to set. + */ + public void setEntryAsReference( + final java.util.Vector entryVector) { + this._entryList = entryVector; + } + + /** + * Method unmarshal. * * @param reader - * @return Provenance + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Provenance */ - public static uk.ac.vamsas.objects.core.Provenance unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Provenance unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Provenance) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Provenance.class, reader); - } //-- uk.ac.vamsas.objects.core.Provenance unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/RangeAnnotation.java b/src/uk/ac/vamsas/objects/core/RangeAnnotation.java index f36bbfb..869c4f5 100644 --- a/src/uk/ac/vamsas/objects/core/RangeAnnotation.java +++ b/src/uk/ac/vamsas/objects/core/RangeAnnotation.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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; /** * Annotation for a rangeSpec - values can be attached for the @@ -48,7 +39,7 @@ implements java.io.Serializable private java.lang.String _id; /** - * Field _modifiable + * Field _modifiable. */ private java.lang.String _modifiable; @@ -107,7 +98,7 @@ implements java.io.Serializable private java.util.Vector _scoreList; /** - * Field _linkList + * Field _linkList. */ private java.util.Vector _linkList; @@ -122,15 +113,14 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public RangeAnnotation() - { + public RangeAnnotation() { super(); setGroup(""); - _annotationElementList = new Vector(); - _scoreList = new Vector(); - _linkList = new Vector(); - _propertyList = new Vector(); - } //-- uk.ac.vamsas.objects.core.RangeAnnotation() + this._annotationElementList = new java.util.Vector(); + this._scoreList = new java.util.Vector(); + this._linkList = new java.util.Vector(); + this._propertyList = new java.util.Vector(); + } //-----------/ @@ -138,169 +128,169 @@ implements java.io.Serializable //-----------/ /** - * Method addAnnotationElement - * * * * @param vAnnotationElement + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAnnotationElement(uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException - { - _annotationElementList.addElement(vAnnotationElement); - } //-- void addAnnotationElement(uk.ac.vamsas.objects.core.AnnotationElement) + public void addAnnotationElement( + final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException { + this._annotationElementList.addElement(vAnnotationElement); + } /** - * Method addAnnotationElement - * * * * @param index * @param vAnnotationElement + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAnnotationElement(int index, uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException - { - _annotationElementList.insertElementAt(vAnnotationElement, index); - } //-- void addAnnotationElement(int, uk.ac.vamsas.objects.core.AnnotationElement) + public void addAnnotationElement( + final int index, + final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException { + this._annotationElementList.add(index, vAnnotationElement); + } /** - * Method addLink - * * * * @param vLink + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addLink(uk.ac.vamsas.objects.core.Link vLink) - throws java.lang.IndexOutOfBoundsException - { - _linkList.addElement(vLink); - } //-- void addLink(uk.ac.vamsas.objects.core.Link) + public void addLink( + final uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException { + this._linkList.addElement(vLink); + } /** - * Method addLink - * * * * @param index * @param vLink + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addLink(int index, uk.ac.vamsas.objects.core.Link vLink) - throws java.lang.IndexOutOfBoundsException - { - _linkList.insertElementAt(vLink, index); - } //-- void addLink(int, uk.ac.vamsas.objects.core.Link) + public void addLink( + final int index, + final uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException { + this._linkList.add(index, vLink); + } /** - * Method addProperty - * * * * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.addElement(vProperty); - } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + public void addProperty( + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.addElement(vProperty); + } /** - * Method addProperty - * * * * @param index * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.insertElementAt(vProperty, index); - } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + public void addProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.add(index, vProperty); + } /** - * Method addScore - * * * * @param vScore + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addScore(uk.ac.vamsas.objects.core.Score vScore) - throws java.lang.IndexOutOfBoundsException - { - _scoreList.addElement(vScore); - } //-- void addScore(uk.ac.vamsas.objects.core.Score) + public void addScore( + final uk.ac.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException { + this._scoreList.addElement(vScore); + } /** - * Method addScore - * * * * @param index * @param vScore + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addScore(int index, uk.ac.vamsas.objects.core.Score vScore) - throws java.lang.IndexOutOfBoundsException - { - _scoreList.insertElementAt(vScore, index); - } //-- void addScore(int, uk.ac.vamsas.objects.core.Score) + public void addScore( + final int index, + final uk.ac.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException { + this._scoreList.add(index, vScore); + } /** - * Method enumerateAnnotationElement - * - * + * Method enumerateAnnotationElement. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.AnnotationElement elements */ - public java.util.Enumeration enumerateAnnotationElement() - { - return _annotationElementList.elements(); - } //-- java.util.Enumeration enumerateAnnotationElement() + public java.util.Enumeration enumerateAnnotationElement( + ) { + return this._annotationElementList.elements(); + } /** - * Method enumerateLink + * Method enumerateLink. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Link elements */ - public java.util.Enumeration enumerateLink() - { - return _linkList.elements(); - } //-- java.util.Enumeration enumerateLink() + public java.util.Enumeration enumerateLink( + ) { + return this._linkList.elements(); + } /** - * Method enumerateProperty - * + * Method enumerateProperty. * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Property elements */ - public java.util.Enumeration enumerateProperty() - { - return _propertyList.elements(); - } //-- java.util.Enumeration enumerateProperty() + public java.util.Enumeration enumerateProperty( + ) { + return this._propertyList.elements(); + } /** - * Method enumerateScore - * + * Method enumerateScore. * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Score elements */ - public java.util.Enumeration enumerateScore() - { - return _scoreList.elements(); - } //-- java.util.Enumeration enumerateScore() + public java.util.Enumeration enumerateScore( + ) { + return this._scoreList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -390,55 +380,65 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** - * Method getAnnotationElement - * - * + * Method getAnnotationElement. * * @param index - * @return AnnotationElement - */ - public uk.ac.vamsas.objects.core.AnnotationElement getAnnotationElement(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _annotationElementList.size())) { - throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * uk.ac.vamsas.objects.core.AnnotationElement at the given inde + */ + public uk.ac.vamsas.objects.core.AnnotationElement getAnnotationElement( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._annotationElementList.size()) { + throw new IndexOutOfBoundsException("getAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.AnnotationElement getAnnotationElement(int) + return (uk.ac.vamsas.objects.core.AnnotationElement) _annotationElementList.get(index); + } /** - * Method getAnnotationElement - * - * + * Method getAnnotationElement.Returns the contents of the + * collection in an Array.

Note: Just in case the + * collection contents are changing in another thread, we pass + * a 0-length Array of the correct type into the API call. + * This way we know that the Array returned is of + * exactly the correct length. * - * @return AnnotationElement + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.AnnotationElement[] getAnnotationElement() - { - int size = _annotationElementList.size(); - uk.ac.vamsas.objects.core.AnnotationElement[] mArray = new uk.ac.vamsas.objects.core.AnnotationElement[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.AnnotationElement[] getAnnotationElement() + public uk.ac.vamsas.objects.core.AnnotationElement[] getAnnotationElement( + ) { + uk.ac.vamsas.objects.core.AnnotationElement[] array = new uk.ac.vamsas.objects.core.AnnotationElement[0]; + return (uk.ac.vamsas.objects.core.AnnotationElement[]) this._annotationElementList.toArray(array); + } /** - * Method getAnnotationElementCount - * + * Method getAnnotationElementAsReference.Returns a reference + * to '_annotationElementList'. No type checking is performed + * on any modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getAnnotationElementAsReference( + ) { + return this._annotationElementList; + } + + /** + * Method getAnnotationElementCount. * - * @return int + * @return the size of this collection */ - public int getAnnotationElementCount() - { - return _annotationElementList.size(); - } //-- int getAnnotationElementCount() + public int getAnnotationElementCount( + ) { + return this._annotationElementList.size(); + } /** * Returns the value of field 'description'. The field @@ -446,13 +446,12 @@ implements java.io.Serializable * description of the annotation * * - * @return String - * @return the value of field 'description'. + * @return the value of field 'Description'. */ - public java.lang.String getDescription() - { + public java.lang.String getDescription( + ) { return this._description; - } //-- java.lang.String getDescription() + } /** * Returns the value of field 'group'. The field 'group' has @@ -460,13 +459,12 @@ implements java.io.Serializable * non-empty group name are grouped * together * - * @return String - * @return the value of field 'group'. + * @return the value of field 'Group'. */ - public java.lang.String getGroup() - { + public java.lang.String getGroup( + ) { return this._group; - } //-- java.lang.String getGroup() + } /** * Returns the value of field 'id'. The field 'id' has the @@ -474,13 +472,12 @@ implements java.io.Serializable * referencing * * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** * Returns the value of field 'label'. The field 'label' has @@ -490,168 +487,193 @@ implements java.io.Serializable * place. * * - * @return String - * @return the value of field 'label'. + * @return the value of field 'Label'. */ - public java.lang.String getLabel() - { + public java.lang.String getLabel( + ) { return this._label; - } //-- java.lang.String getLabel() + } /** - * Method getLink - * - * + * Method getLink. * * @param index - * @return Link - */ - public uk.ac.vamsas.objects.core.Link getLink(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _linkList.size())) { - throw new IndexOutOfBoundsException("getLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Link at + * the given index + */ + public uk.ac.vamsas.objects.core.Link getLink( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._linkList.size()) { + throw new IndexOutOfBoundsException("getLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Link) _linkList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Link getLink(int) + return (uk.ac.vamsas.objects.core.Link) _linkList.get(index); + } /** - * Method getLink - * + * Method getLink.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return Link + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Link[] getLink() - { - int size = _linkList.size(); - uk.ac.vamsas.objects.core.Link[] mArray = new uk.ac.vamsas.objects.core.Link[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Link) _linkList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Link[] getLink() + public uk.ac.vamsas.objects.core.Link[] getLink( + ) { + uk.ac.vamsas.objects.core.Link[] array = new uk.ac.vamsas.objects.core.Link[0]; + return (uk.ac.vamsas.objects.core.Link[]) this._linkList.toArray(array); + } /** - * Method getLinkCount - * + * Method getLinkAsReference.Returns a reference to + * '_linkList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getLinkAsReference( + ) { + return this._linkList; + } + + /** + * Method getLinkCount. * - * @return int + * @return the size of this collection */ - public int getLinkCount() - { - return _linkList.size(); - } //-- int getLinkCount() + public int getLinkCount( + ) { + return this._linkList.size(); + } /** * Returns the value of field 'modifiable'. * - * @return String - * @return the value of field 'modifiable'. + * @return the value of field 'Modifiable'. */ - public java.lang.String getModifiable() - { + public java.lang.String getModifiable( + ) { return this._modifiable; - } //-- java.lang.String getModifiable() + } /** - * Method getProperty - * - * + * Method getProperty. * * @param index - * @return Property - */ - public uk.ac.vamsas.objects.core.Property getProperty(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Property + * at the given index + */ + public uk.ac.vamsas.objects.core.Property getProperty( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index); + } /** - * Method getProperty - * - * + * Method getProperty.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * @return Property + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Property[] getProperty() - { - int size = _propertyList.size(); - uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + public uk.ac.vamsas.objects.core.Property[] getProperty( + ) { + uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0]; + return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array); + } /** - * Method getPropertyCount - * + * Method getPropertyAsReference.Returns a reference to + * '_propertyList'. No type checking is performed on any + * modifications to the Vector. * - * - * @return int + * @return a reference to the Vector backing this class */ - public int getPropertyCount() - { - return _propertyList.size(); - } //-- int getPropertyCount() + public java.util.Vector getPropertyAsReference( + ) { + return this._propertyList; + } /** - * Method getScore - * + * Method getPropertyCount. * + * @return the size of this collection + */ + public int getPropertyCount( + ) { + return this._propertyList.size(); + } + + /** + * Method getScore. * * @param index - * @return Score - */ - public uk.ac.vamsas.objects.core.Score getScore(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _scoreList.size())) { - throw new IndexOutOfBoundsException("getScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Score at + * the given index + */ + public uk.ac.vamsas.objects.core.Score getScore( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._scoreList.size()) { + throw new IndexOutOfBoundsException("getScore: Index value '" + index + "' not in range [0.." + (this._scoreList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Score) _scoreList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Score getScore(int) + return (uk.ac.vamsas.objects.core.Score) _scoreList.get(index); + } /** - * Method getScore + * Method getScore.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * - * @return Score + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Score[] getScore() - { - int size = _scoreList.size(); - uk.ac.vamsas.objects.core.Score[] mArray = new uk.ac.vamsas.objects.core.Score[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Score) _scoreList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Score[] getScore() + public uk.ac.vamsas.objects.core.Score[] getScore( + ) { + uk.ac.vamsas.objects.core.Score[] array = new uk.ac.vamsas.objects.core.Score[0]; + return (uk.ac.vamsas.objects.core.Score[]) this._scoreList.toArray(array); + } /** - * Method getScoreCount - * + * Method getScoreAsReference.Returns a reference to + * '_scoreList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getScoreAsReference( + ) { + return this._scoreList; + } + + /** + * Method getScoreCount. * - * @return int + * @return the size of this collection */ - public int getScoreCount() - { - return _scoreList.size(); - } //-- int getScoreCount() + public int getScoreCount( + ) { + return this._scoreList.size(); + } /** * Returns the value of field 'status'. The field 'status' has @@ -661,13 +683,12 @@ implements java.io.Serializable * quality to an * annotation. * - * @return String - * @return the value of field 'status'. + * @return the value of field 'Status'. */ - public java.lang.String getStatus() - { + public java.lang.String getStatus( + ) { return this._status; - } //-- java.lang.String getStatus() + } /** * Returns the value of field 'type'. The field 'type' has the @@ -681,189 +702,294 @@ implements java.io.Serializable * and * considered distinct from someotherDB:CHAIN * - * @return String - * @return the value of field 'type'. + * @return the value of field 'Type'. */ - public java.lang.String getType() - { + public java.lang.String getType( + ) { return this._type; - } //-- java.lang.String getType() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_modifiable != null) { + result = 37 * result + _modifiable.hashCode(); + } + if (_group != null) { + result = 37 * result + _group.hashCode(); + } + if (_type != null) { + result = 37 * result + _type.hashCode(); + } + if (_label != null) { + result = 37 * result + _label.hashCode(); + } + if (_description != null) { + result = 37 * result + _description.hashCode(); + } + if (_status != null) { + result = 37 * result + _status.hashCode(); + } + if (_annotationElementList != null) { + result = 37 * result + _annotationElementList.hashCode(); + } + if (_scoreList != null) { + result = 37 * result + _scoreList.hashCode(); + } + if (_linkList != null) { + result = 37 * result + _linkList.hashCode(); + } + if (_propertyList != null) { + result = 37 * result + _propertyList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAllAnnotationElement - * */ - public void removeAllAnnotationElement() - { - _annotationElementList.removeAllElements(); - } //-- void removeAllAnnotationElement() + public void removeAllAnnotationElement( + ) { + this._annotationElementList.clear(); + } /** - * Method removeAllLink - * */ - public void removeAllLink() - { - _linkList.removeAllElements(); - } //-- void removeAllLink() + public void removeAllLink( + ) { + this._linkList.clear(); + } /** - * Method removeAllProperty - * */ - public void removeAllProperty() - { - _propertyList.removeAllElements(); - } //-- void removeAllProperty() + public void removeAllProperty( + ) { + this._propertyList.clear(); + } /** - * Method removeAllScore - * */ - public void removeAllScore() - { - _scoreList.removeAllElements(); - } //-- void removeAllScore() + public void removeAllScore( + ) { + this._scoreList.clear(); + } /** - * Method removeAnnotationElement - * + * Method removeAnnotationElement. * + * @param vAnnotationElement + * @return true if the object was removed from the collection. + */ + public boolean removeAnnotationElement( + final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) { + boolean removed = _annotationElementList.remove(vAnnotationElement); + return removed; + } + + /** + * Method removeAnnotationElementAt. * * @param index - * @return AnnotationElement + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index) - { - java.lang.Object obj = _annotationElementList.elementAt(index); - _annotationElementList.removeElementAt(index); + public uk.ac.vamsas.objects.core.AnnotationElement removeAnnotationElementAt( + final int index) { + java.lang.Object obj = this._annotationElementList.remove(index); return (uk.ac.vamsas.objects.core.AnnotationElement) obj; - } //-- uk.ac.vamsas.objects.core.AnnotationElement removeAnnotationElement(int) + } /** - * Method removeLink - * + * Method removeLink. * + * @param vLink + * @return true if the object was removed from the collection. + */ + public boolean removeLink( + final uk.ac.vamsas.objects.core.Link vLink) { + boolean removed = _linkList.remove(vLink); + return removed; + } + + /** + * Method removeLinkAt. * * @param index - * @return Link + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Link removeLink(int index) - { - java.lang.Object obj = _linkList.elementAt(index); - _linkList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Link removeLinkAt( + final int index) { + java.lang.Object obj = this._linkList.remove(index); return (uk.ac.vamsas.objects.core.Link) obj; - } //-- uk.ac.vamsas.objects.core.Link removeLink(int) + } /** - * Method removeProperty - * + * Method removeProperty. * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final uk.ac.vamsas.objects.core.Property vProperty) { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. * * @param index - * @return Property + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Property removeProperty(int index) - { - java.lang.Object obj = _propertyList.elementAt(index); - _propertyList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Property removePropertyAt( + final int index) { + java.lang.Object obj = this._propertyList.remove(index); return (uk.ac.vamsas.objects.core.Property) obj; - } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + } /** - * Method removeScore - * + * Method removeScore. * + * @param vScore + * @return true if the object was removed from the collection. + */ + public boolean removeScore( + final uk.ac.vamsas.objects.core.Score vScore) { + boolean removed = _scoreList.remove(vScore); + return removed; + } + + /** + * Method removeScoreAt. * * @param index - * @return Score + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Score removeScore(int index) - { - java.lang.Object obj = _scoreList.elementAt(index); - _scoreList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Score removeScoreAt( + final int index) { + java.lang.Object obj = this._scoreList.remove(index); return (uk.ac.vamsas.objects.core.Score) obj; - } //-- uk.ac.vamsas.objects.core.Score removeScore(int) + } /** - * Method setAnnotationElement - * * * * @param index * @param vAnnotationElement - */ - public void setAnnotationElement(int index, uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _annotationElementList.size())) { - throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setAnnotationElement( + final int index, + final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._annotationElementList.size()) { + throw new IndexOutOfBoundsException("setAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]"); } - _annotationElementList.setElementAt(vAnnotationElement, index); - } //-- void setAnnotationElement(int, uk.ac.vamsas.objects.core.AnnotationElement) + + this._annotationElementList.set(index, vAnnotationElement); + } /** - * Method setAnnotationElement - * * * - * @param annotationElementArray + * @param vAnnotationElementArray */ - public void setAnnotationElement(uk.ac.vamsas.objects.core.AnnotationElement[] annotationElementArray) - { + public void setAnnotationElement( + final uk.ac.vamsas.objects.core.AnnotationElement[] vAnnotationElementArray) { //-- copy array - _annotationElementList.removeAllElements(); - for (int i = 0; i < annotationElementArray.length; i++) { - _annotationElementList.addElement(annotationElementArray[i]); + _annotationElementList.clear(); + + for (int i = 0; i < vAnnotationElementArray.length; i++) { + this._annotationElementList.add(vAnnotationElementArray[i]); } - } //-- void setAnnotationElement(uk.ac.vamsas.objects.core.AnnotationElement) + } + + /** + * Sets the value of '_annotationElementList' by copying the + * given Vector. All elements will be checked for type safety. + * + * @param vAnnotationElementList the Vector to copy. + */ + public void setAnnotationElement( + final java.util.Vector vAnnotationElementList) { + // copy vector + this._annotationElementList.clear(); + + this._annotationElementList.addAll(vAnnotationElementList); + } + + /** + * Sets the value of '_annotationElementList' by setting it to + * the given Vector. No type checking is performed. + * @deprecated + * + * @param annotationElementVector the Vector to set. + */ + public void setAnnotationElementAsReference( + final java.util.Vector annotationElementVector) { + this._annotationElementList = annotationElementVector; + } /** * Sets the value of field 'description'. The field @@ -873,10 +999,10 @@ implements java.io.Serializable * * @param description the value of field 'description'. */ - public void setDescription(java.lang.String description) - { + public void setDescription( + final java.lang.String description) { this._description = description; - } //-- void setDescription(java.lang.String) + } /** * Sets the value of field 'group'. The field 'group' has the @@ -886,10 +1012,10 @@ implements java.io.Serializable * * @param group the value of field 'group'. */ - public void setGroup(java.lang.String group) - { + public void setGroup( + final java.lang.String group) { this._group = group; - } //-- void setGroup(java.lang.String) + } /** * Sets the value of field 'id'. The field 'id' has the @@ -899,10 +1025,10 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'label'. The field 'label' has the @@ -914,122 +1040,203 @@ implements java.io.Serializable * * @param label the value of field 'label'. */ - public void setLabel(java.lang.String label) - { + public void setLabel( + final java.lang.String label) { this._label = label; - } //-- void setLabel(java.lang.String) + } /** - * Method setLink - * * * * @param index * @param vLink - */ - public void setLink(int index, uk.ac.vamsas.objects.core.Link vLink) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _linkList.size())) { - throw new IndexOutOfBoundsException("setLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setLink( + final int index, + final uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._linkList.size()) { + throw new IndexOutOfBoundsException("setLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]"); } - _linkList.setElementAt(vLink, index); - } //-- void setLink(int, uk.ac.vamsas.objects.core.Link) + + this._linkList.set(index, vLink); + } /** - * Method setLink - * * * - * @param linkArray + * @param vLinkArray */ - public void setLink(uk.ac.vamsas.objects.core.Link[] linkArray) - { + public void setLink( + final uk.ac.vamsas.objects.core.Link[] vLinkArray) { //-- copy array - _linkList.removeAllElements(); - for (int i = 0; i < linkArray.length; i++) { - _linkList.addElement(linkArray[i]); + _linkList.clear(); + + for (int i = 0; i < vLinkArray.length; i++) { + this._linkList.add(vLinkArray[i]); } - } //-- void setLink(uk.ac.vamsas.objects.core.Link) + } + + /** + * Sets the value of '_linkList' by copying the given Vector. + * All elements will be checked for type safety. + * + * @param vLinkList the Vector to copy. + */ + public void setLink( + final java.util.Vector vLinkList) { + // copy vector + this._linkList.clear(); + + this._linkList.addAll(vLinkList); + } + + /** + * Sets the value of '_linkList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param linkVector the Vector to set. + */ + public void setLinkAsReference( + final java.util.Vector linkVector) { + this._linkList = linkVector; + } /** * Sets the value of field 'modifiable'. * * @param modifiable the value of field 'modifiable'. */ - public void setModifiable(java.lang.String modifiable) - { + public void setModifiable( + final java.lang.String modifiable) { this._modifiable = modifiable; - } //-- void setModifiable(java.lang.String) + } /** - * Method setProperty - * * * * @param index * @param vProperty - */ - public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - _propertyList.setElementAt(vProperty, index); - } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + this._propertyList.set(index, vProperty); + } /** - * Method setProperty * * - * - * @param propertyArray + * @param vPropertyArray */ - public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) - { + public void setProperty( + final uk.ac.vamsas.objects.core.Property[] vPropertyArray) { //-- copy array - _propertyList.removeAllElements(); - for (int i = 0; i < propertyArray.length; i++) { - _propertyList.addElement(propertyArray[i]); + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) { + this._propertyList.add(vPropertyArray[i]); } - } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + } /** - * Method setScore + * Sets the value of '_propertyList' by copying the given + * Vector. All elements will be checked for type safety. * + * @param vPropertyList the Vector to copy. + */ + public void setProperty( + final java.util.Vector vPropertyList) { + // copy vector + this._propertyList.clear(); + + this._propertyList.addAll(vPropertyList); + } + + /** + * Sets the value of '_propertyList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param propertyVector the Vector to set. + */ + public void setPropertyAsReference( + final java.util.Vector propertyVector) { + this._propertyList = propertyVector; + } + + /** * * * @param index * @param vScore - */ - public void setScore(int index, uk.ac.vamsas.objects.core.Score vScore) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _scoreList.size())) { - throw new IndexOutOfBoundsException("setScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setScore( + final int index, + final uk.ac.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._scoreList.size()) { + throw new IndexOutOfBoundsException("setScore: Index value '" + index + "' not in range [0.." + (this._scoreList.size() - 1) + "]"); } - _scoreList.setElementAt(vScore, index); - } //-- void setScore(int, uk.ac.vamsas.objects.core.Score) + + this._scoreList.set(index, vScore); + } /** - * Method setScore * * - * - * @param scoreArray + * @param vScoreArray */ - public void setScore(uk.ac.vamsas.objects.core.Score[] scoreArray) - { + public void setScore( + final uk.ac.vamsas.objects.core.Score[] vScoreArray) { //-- copy array - _scoreList.removeAllElements(); - for (int i = 0; i < scoreArray.length; i++) { - _scoreList.addElement(scoreArray[i]); + _scoreList.clear(); + + for (int i = 0; i < vScoreArray.length; i++) { + this._scoreList.add(vScoreArray[i]); } - } //-- void setScore(uk.ac.vamsas.objects.core.Score) + } + + /** + * Sets the value of '_scoreList' by copying the given Vector. + * All elements will be checked for type safety. + * + * @param vScoreList the Vector to copy. + */ + public void setScore( + final java.util.Vector vScoreList) { + // copy vector + this._scoreList.clear(); + + this._scoreList.addAll(vScoreList); + } + + /** + * Sets the value of '_scoreList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param scoreVector the Vector to set. + */ + public void setScoreAsReference( + final java.util.Vector scoreVector) { + this._scoreList = scoreVector; + } /** * Sets the value of field 'status'. The field 'status' has the @@ -1041,10 +1248,10 @@ implements java.io.Serializable * * @param status the value of field 'status'. */ - public void setStatus(java.lang.String status) - { + public void setStatus( + final java.lang.String status) { this._status = status; - } //-- void setStatus(java.lang.String) + } /** * Sets the value of field 'type'. The field 'type' has the @@ -1060,34 +1267,38 @@ implements java.io.Serializable * * @param type the value of field 'type'. */ - public void setType(java.lang.String type) - { + public void setType( + final java.lang.String type) { this._type = type; - } //-- void setType(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return RangeType + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType */ - public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.RangeAnnotation) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.RangeAnnotation.class, reader); - } //-- uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.RangeType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.RangeAnnotation.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/RangeType.java b/src/uk/ac/vamsas/objects/core/RangeType.java index 3fc8fe1..91338e2 100644 --- a/src/uk/ac/vamsas/objects/core/RangeType.java +++ b/src/uk/ac/vamsas/objects/core/RangeType.java @@ -1,25 +1,12 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ package uk.ac.vamsas.objects.core; - //---------------------------------/ - //- Imported classes and packages -/ -//---------------------------------/ - -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -import java.util.Enumeration; -import java.util.Vector; -import org.exolab.castor.xml.Marshaller; -import org.exolab.castor.xml.Unmarshaller; -import org.exolab.castor.xml.ValidationException; - /** * Specify an ordered set of positions and/or regions on the * principle @@ -62,12 +49,11 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public RangeType() - { + public RangeType() { super(); - _posList = new Vector(); - _segList = new Vector(); - } //-- uk.ac.vamsas.objects.core.RangeType() + this._posList = new java.util.Vector(); + this._segList = new java.util.Vector(); + } //-----------/ @@ -75,91 +61,91 @@ implements java.io.Serializable //-----------/ /** - * Method addPos - * * * * @param vPos + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addPos(uk.ac.vamsas.objects.core.Pos vPos) - throws java.lang.IndexOutOfBoundsException - { - _posList.addElement(vPos); - } //-- void addPos(uk.ac.vamsas.objects.core.Pos) + public void addPos( + final uk.ac.vamsas.objects.core.Pos vPos) + throws java.lang.IndexOutOfBoundsException { + this._posList.addElement(vPos); + } /** - * Method addPos - * * * * @param index * @param vPos + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addPos(int index, uk.ac.vamsas.objects.core.Pos vPos) - throws java.lang.IndexOutOfBoundsException - { - _posList.insertElementAt(vPos, index); - } //-- void addPos(int, uk.ac.vamsas.objects.core.Pos) + public void addPos( + final int index, + final uk.ac.vamsas.objects.core.Pos vPos) + throws java.lang.IndexOutOfBoundsException { + this._posList.add(index, vPos); + } /** - * Method addSeg - * * * * @param vSeg + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addSeg(uk.ac.vamsas.objects.core.Seg vSeg) - throws java.lang.IndexOutOfBoundsException - { - _segList.addElement(vSeg); - } //-- void addSeg(uk.ac.vamsas.objects.core.Seg) + public void addSeg( + final uk.ac.vamsas.objects.core.Seg vSeg) + throws java.lang.IndexOutOfBoundsException { + this._segList.addElement(vSeg); + } /** - * Method addSeg - * * * * @param index * @param vSeg + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addSeg(int index, uk.ac.vamsas.objects.core.Seg vSeg) - throws java.lang.IndexOutOfBoundsException - { - _segList.insertElementAt(vSeg, index); - } //-- void addSeg(int, uk.ac.vamsas.objects.core.Seg) + public void addSeg( + final int index, + final uk.ac.vamsas.objects.core.Seg vSeg) + throws java.lang.IndexOutOfBoundsException { + this._segList.add(index, vSeg); + } /** - * Method enumeratePos - * - * + * Method enumeratePos. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Pos elements */ - public java.util.Enumeration enumeratePos() - { - return _posList.elements(); - } //-- java.util.Enumeration enumeratePos() + public java.util.Enumeration enumeratePos( + ) { + return this._posList.elements(); + } /** - * Method enumerateSeg - * - * + * Method enumerateSeg. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Seg elements */ - public java.util.Enumeration enumerateSeg() - { - return _segList.elements(); - } //-- java.util.Enumeration enumerateSeg() + public java.util.Enumeration enumerateSeg( + ) { + return this._segList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -193,260 +179,370 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'choiceValue'. The field * 'choiceValue' has the following description: Internal choice * value storage * - * @return Object - * @return the value of field 'choiceValue'. + * @return the value of field 'ChoiceValue'. */ - public java.lang.Object getChoiceValue() - { + public java.lang.Object getChoiceValue( + ) { return this._choiceValue; - } //-- java.lang.Object getChoiceValue() + } /** - * Method getPos - * - * + * Method getPos. * * @param index - * @return Pos - */ - public uk.ac.vamsas.objects.core.Pos getPos(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _posList.size())) { - throw new IndexOutOfBoundsException("getPos: Index value '"+index+"' not in range [0.."+_posList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Pos at + * the given index + */ + public uk.ac.vamsas.objects.core.Pos getPos( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._posList.size()) { + throw new IndexOutOfBoundsException("getPos: Index value '" + index + "' not in range [0.." + (this._posList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Pos) _posList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Pos getPos(int) + return (uk.ac.vamsas.objects.core.Pos) _posList.get(index); + } /** - * Method getPos - * - * + * Method getPos.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * @return Pos + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Pos[] getPos() - { - int size = _posList.size(); - uk.ac.vamsas.objects.core.Pos[] mArray = new uk.ac.vamsas.objects.core.Pos[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Pos) _posList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Pos[] getPos() + public uk.ac.vamsas.objects.core.Pos[] getPos( + ) { + uk.ac.vamsas.objects.core.Pos[] array = new uk.ac.vamsas.objects.core.Pos[0]; + return (uk.ac.vamsas.objects.core.Pos[]) this._posList.toArray(array); + } /** - * Method getPosCount - * - * + * Method getPosAsReference.Returns a reference to '_posList'. + * No type checking is performed on any modifications to the + * Vector. * - * @return int + * @return a reference to the Vector backing this class */ - public int getPosCount() - { - return _posList.size(); - } //-- int getPosCount() + public java.util.Vector getPosAsReference( + ) { + return this._posList; + } /** - * Method getSeg - * + * Method getPosCount. * + * @return the size of this collection + */ + public int getPosCount( + ) { + return this._posList.size(); + } + + /** + * Method getSeg. * * @param index - * @return Seg - */ - public uk.ac.vamsas.objects.core.Seg getSeg(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _segList.size())) { - throw new IndexOutOfBoundsException("getSeg: Index value '"+index+"' not in range [0.."+_segList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Seg at + * the given index + */ + public uk.ac.vamsas.objects.core.Seg getSeg( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._segList.size()) { + throw new IndexOutOfBoundsException("getSeg: Index value '" + index + "' not in range [0.." + (this._segList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Seg) _segList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Seg getSeg(int) + return (uk.ac.vamsas.objects.core.Seg) _segList.get(index); + } /** - * Method getSeg - * - * + * Method getSeg.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * @return Seg + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Seg[] getSeg() - { - int size = _segList.size(); - uk.ac.vamsas.objects.core.Seg[] mArray = new uk.ac.vamsas.objects.core.Seg[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Seg) _segList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Seg[] getSeg() + public uk.ac.vamsas.objects.core.Seg[] getSeg( + ) { + uk.ac.vamsas.objects.core.Seg[] array = new uk.ac.vamsas.objects.core.Seg[0]; + return (uk.ac.vamsas.objects.core.Seg[]) this._segList.toArray(array); + } /** - * Method getSegCount - * - * + * Method getSegAsReference.Returns a reference to '_segList'. + * No type checking is performed on any modifications to the + * Vector. * - * @return int + * @return a reference to the Vector backing this class */ - public int getSegCount() - { - return _segList.size(); - } //-- int getSegCount() + public java.util.Vector getSegAsReference( + ) { + return this._segList; + } /** - * Method isValid + * Method getSegCount. * + * @return the size of this collection + */ + public int getSegCount( + ) { + return this._segList.size(); + } + + /** + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_choiceValue != null) { + result = 37 * result + _choiceValue.hashCode(); + } + if (_posList != null) { + result = 37 * result + _posList.hashCode(); + } + if (_segList != null) { + result = 37 * result + _segList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method removeAllPos - * */ - public void removeAllPos() - { - _posList.removeAllElements(); - } //-- void removeAllPos() + public void removeAllPos( + ) { + this._posList.clear(); + } /** - * Method removeAllSeg - * */ - public void removeAllSeg() - { - _segList.removeAllElements(); - } //-- void removeAllSeg() + public void removeAllSeg( + ) { + this._segList.clear(); + } /** - * Method removePos - * + * Method removePos. * + * @param vPos + * @return true if the object was removed from the collection. + */ + public boolean removePos( + final uk.ac.vamsas.objects.core.Pos vPos) { + boolean removed = _posList.remove(vPos); + return removed; + } + + /** + * Method removePosAt. * * @param index - * @return Pos + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Pos removePos(int index) - { - java.lang.Object obj = _posList.elementAt(index); - _posList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Pos removePosAt( + final int index) { + java.lang.Object obj = this._posList.remove(index); return (uk.ac.vamsas.objects.core.Pos) obj; - } //-- uk.ac.vamsas.objects.core.Pos removePos(int) + } /** - * Method removeSeg - * + * Method removeSeg. * + * @param vSeg + * @return true if the object was removed from the collection. + */ + public boolean removeSeg( + final uk.ac.vamsas.objects.core.Seg vSeg) { + boolean removed = _segList.remove(vSeg); + return removed; + } + + /** + * Method removeSegAt. * * @param index - * @return Seg + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Seg removeSeg(int index) - { - java.lang.Object obj = _segList.elementAt(index); - _segList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Seg removeSegAt( + final int index) { + java.lang.Object obj = this._segList.remove(index); return (uk.ac.vamsas.objects.core.Seg) obj; - } //-- uk.ac.vamsas.objects.core.Seg removeSeg(int) + } /** - * Method setPos - * * * * @param index * @param vPos + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setPos(int index, uk.ac.vamsas.objects.core.Pos vPos) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _posList.size())) { - throw new IndexOutOfBoundsException("setPos: Index value '"+index+"' not in range [0.."+_posList.size()+ "]"); + public void setPos( + final int index, + final uk.ac.vamsas.objects.core.Pos vPos) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._posList.size()) { + throw new IndexOutOfBoundsException("setPos: Index value '" + index + "' not in range [0.." + (this._posList.size() - 1) + "]"); } - _posList.setElementAt(vPos, index); - } //-- void setPos(int, uk.ac.vamsas.objects.core.Pos) + + this._posList.set(index, vPos); + } /** - * Method setPos * * - * - * @param posArray + * @param vPosArray */ - public void setPos(uk.ac.vamsas.objects.core.Pos[] posArray) - { + public void setPos( + final uk.ac.vamsas.objects.core.Pos[] vPosArray) { //-- copy array - _posList.removeAllElements(); - for (int i = 0; i < posArray.length; i++) { - _posList.addElement(posArray[i]); + _posList.clear(); + + for (int i = 0; i < vPosArray.length; i++) { + this._posList.add(vPosArray[i]); } - } //-- void setPos(uk.ac.vamsas.objects.core.Pos) + } + + /** + * Sets the value of '_posList' by copying the given Vector. + * All elements will be checked for type safety. + * + * @param vPosList the Vector to copy. + */ + public void setPos( + final java.util.Vector vPosList) { + // copy vector + this._posList.clear(); + + this._posList.addAll(vPosList); + } /** - * Method setSeg + * Sets the value of '_posList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated * + * @param posVector the Vector to set. + */ + public void setPosAsReference( + final java.util.Vector posVector) { + this._posList = posVector; + } + + /** * * * @param index * @param vSeg + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setSeg(int index, uk.ac.vamsas.objects.core.Seg vSeg) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _segList.size())) { - throw new IndexOutOfBoundsException("setSeg: Index value '"+index+"' not in range [0.."+_segList.size()+ "]"); + public void setSeg( + final int index, + final uk.ac.vamsas.objects.core.Seg vSeg) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._segList.size()) { + throw new IndexOutOfBoundsException("setSeg: Index value '" + index + "' not in range [0.." + (this._segList.size() - 1) + "]"); } - _segList.setElementAt(vSeg, index); - } //-- void setSeg(int, uk.ac.vamsas.objects.core.Seg) + + this._segList.set(index, vSeg); + } /** - * Method setSeg - * * * - * @param segArray + * @param vSegArray */ - public void setSeg(uk.ac.vamsas.objects.core.Seg[] segArray) - { + public void setSeg( + final uk.ac.vamsas.objects.core.Seg[] vSegArray) { //-- copy array - _segList.removeAllElements(); - for (int i = 0; i < segArray.length; i++) { - _segList.addElement(segArray[i]); + _segList.clear(); + + for (int i = 0; i < vSegArray.length; i++) { + this._segList.add(vSegArray[i]); } - } //-- void setSeg(uk.ac.vamsas.objects.core.Seg) + } /** - * Method validate + * Sets the value of '_segList' by copying the given Vector. + * All elements will be checked for type safety. + * + * @param vSegList the Vector to copy. + */ + public void setSeg( + final java.util.Vector vSegList) { + // copy vector + this._segList.clear(); + + this._segList.addAll(vSegList); + } + + /** + * Sets the value of '_segList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param segVector the Vector to set. + */ + public void setSegAsReference( + final java.util.Vector segVector) { + this._segList = segVector; + } + + /** + * * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Score.java b/src/uk/ac/vamsas/objects/core/Score.java index bb00fa4..8448198 100644 --- a/src/uk/ac/vamsas/objects/core/Score.java +++ b/src/uk/ac/vamsas/objects/core/Score.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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; /** * Ordered set of optionally named float values for the @@ -47,7 +40,7 @@ implements java.io.Serializable private boolean _has_content; /** - * Field _name + * Field _name. */ private java.lang.String _name = "score"; @@ -56,11 +49,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Score() - { + public Score() { super(); setName("score"); - } //-- uk.ac.vamsas.objects.core.Score() + } //-----------/ @@ -68,22 +60,20 @@ implements java.io.Serializable //-----------/ /** - * Method deleteContent - * */ - public void deleteContent() - { + public void deleteContent( + ) { this._has_content= false; - } //-- void deleteContent() + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -107,88 +97,106 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'content'. The field 'content' * has the following description: internal content storage * - * @return float - * @return the value of field 'content'. + * @return the value of field 'Content'. */ - public float getContent() - { + public float getContent( + ) { return this._content; - } //-- float getContent() + } /** * Returns the value of field 'name'. * - * @return String - * @return the value of field 'name'. + * @return the value of field 'Name'. */ - public java.lang.String getName() - { + public java.lang.String getName( + ) { return this._name; - } //-- java.lang.String getName() + } /** - * Method hasContent - * - * + * Method hasContent. * - * @return boolean + * @return true if at least one Content has been added */ - public boolean hasContent() - { + public boolean hasContent( + ) { return this._has_content; - } //-- boolean hasContent() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + java.lang.Float.floatToIntBits(_content); + if (_name != null) { + result = 37 * result + _name.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'content'. The field 'content' has @@ -196,45 +204,49 @@ implements java.io.Serializable * * @param content the value of field 'content'. */ - public void setContent(float content) - { + public void setContent( + final float content) { this._content = content; this._has_content = true; - } //-- void setContent(float) + } /** * Sets the value of field 'name'. * * @param name the value of field 'name'. */ - public void setName(java.lang.String name) - { + public void setName( + final java.lang.String name) { this._name = name; - } //-- void setName(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Score + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Score */ - public static uk.ac.vamsas.objects.core.Score unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Score unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Score) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Score.class, reader); - } //-- uk.ac.vamsas.objects.core.Score unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Seg.java b/src/uk/ac/vamsas/objects/core/Seg.java index e6d0d1b..4a7c031 100644 --- a/src/uk/ac/vamsas/objects/core/Seg.java +++ b/src/uk/ac/vamsas/objects/core/Seg.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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; /** * a region from start to end, with flag for inclusivity of @@ -37,7 +30,7 @@ implements java.io.Serializable //--------------------------/ /** - * Field _start + * Field _start. */ private int _start; @@ -47,7 +40,7 @@ implements java.io.Serializable private boolean _has_start; /** - * Field _end + * Field _end. */ private int _end; @@ -74,10 +67,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Seg() - { + public Seg() { super(); - } //-- uk.ac.vamsas.objects.core.Seg() + } //-----------/ @@ -85,40 +77,34 @@ implements java.io.Serializable //-----------/ /** - * Method deleteEnd - * */ - public void deleteEnd() - { + public void deleteEnd( + ) { this._has_end= false; - } //-- void deleteEnd() + } /** - * Method deleteInclusive - * */ - public void deleteInclusive() - { + public void deleteInclusive( + ) { this._has_inclusive= false; - } //-- void deleteInclusive() + } /** - * Method deleteStart - * */ - public void deleteStart() - { + public void deleteStart( + ) { this._has_start= false; - } //-- void deleteStart() + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -143,18 +129,17 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'end'. * - * @return int - * @return the value of field 'end'. + * @return the value of field 'End'. */ - public int getEnd() - { + public int getEnd( + ) { return this._end; - } //-- int getEnd() + } /** * Returns the value of field 'inclusive'. The field @@ -164,117 +149,145 @@ implements java.io.Serializable * 2 * * - * @return boolean - * @return the value of field 'inclusive'. + * @return the value of field 'Inclusive'. */ - public boolean getInclusive() - { + public boolean getInclusive( + ) { return this._inclusive; - } //-- boolean getInclusive() + } /** * Returns the value of field 'start'. * - * @return int - * @return the value of field 'start'. + * @return the value of field 'Start'. */ - public int getStart() - { + public int getStart( + ) { return this._start; - } //-- int getStart() + } /** - * Method hasEnd - * + * Method hasEnd. * - * - * @return boolean + * @return true if at least one End has been added */ - public boolean hasEnd() - { + public boolean hasEnd( + ) { return this._has_end; - } //-- boolean hasEnd() + } /** - * Method hasInclusive - * + * Method hasInclusive. * - * - * @return boolean + * @return true if at least one Inclusive has been added */ - public boolean hasInclusive() - { + public boolean hasInclusive( + ) { return this._has_inclusive; - } //-- boolean hasInclusive() + } /** - * Method hasStart - * + * Method hasStart. * - * - * @return boolean + * @return true if at least one Start has been added */ - public boolean hasStart() - { + public boolean hasStart( + ) { return this._has_start; - } //-- boolean hasStart() + } /** - * Method isValid + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + _start; + result = 37 * result + _end; + result = 37 * result + (_inclusive?0:1); + + return result; + } + + /** + * Returns the value of field 'inclusive'. The field + * 'inclusive' has the following description: when false, a + * consecutive range like 'start=1, end=2' + * means the region lying after position 1 and before position + * 2 + * * + * @return the value of field 'Inclusive'. + */ + public boolean isInclusive( + ) { + return this._inclusive; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'end'. * * @param end the value of field 'end'. */ - public void setEnd(int end) - { + public void setEnd( + final int end) { this._end = end; this._has_end = true; - } //-- void setEnd(int) + } /** * Sets the value of field 'inclusive'. The field 'inclusive' @@ -286,46 +299,50 @@ implements java.io.Serializable * * @param inclusive the value of field 'inclusive'. */ - public void setInclusive(boolean inclusive) - { + public void setInclusive( + final boolean inclusive) { this._inclusive = inclusive; this._has_inclusive = true; - } //-- void setInclusive(boolean) + } /** * Sets the value of field 'start'. * * @param start the value of field 'start'. */ - public void setStart(int start) - { + public void setStart( + final int start) { this._start = start; this._has_start = true; - } //-- void setStart(int) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Seg + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Seg */ - public static uk.ac.vamsas.objects.core.Seg unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Seg unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Seg) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Seg.class, reader); - } //-- uk.ac.vamsas.objects.core.Seg unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Sequence.java b/src/uk/ac/vamsas/objects/core/Sequence.java index 1a23512..d4ff049 100644 --- a/src/uk/ac/vamsas/objects/core/Sequence.java +++ b/src/uk/ac/vamsas/objects/core/Sequence.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Sequence. @@ -61,11 +52,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Sequence() - { + public Sequence() { super(); - _dbRefList = new Vector(); - } //-- uk.ac.vamsas.objects.core.Sequence() + this._dbRefList = new java.util.Vector(); + } //-----------/ @@ -73,52 +63,52 @@ implements java.io.Serializable //-----------/ /** - * Method addDbRef - * * * * @param vDbRef + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addDbRef(uk.ac.vamsas.objects.core.DbRef vDbRef) - throws java.lang.IndexOutOfBoundsException - { - _dbRefList.addElement(vDbRef); - } //-- void addDbRef(uk.ac.vamsas.objects.core.DbRef) + public void addDbRef( + final uk.ac.vamsas.objects.core.DbRef vDbRef) + throws java.lang.IndexOutOfBoundsException { + this._dbRefList.addElement(vDbRef); + } /** - * Method addDbRef - * * * * @param index * @param vDbRef + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addDbRef(int index, uk.ac.vamsas.objects.core.DbRef vDbRef) - throws java.lang.IndexOutOfBoundsException - { - _dbRefList.insertElementAt(vDbRef, index); - } //-- void addDbRef(int, uk.ac.vamsas.objects.core.DbRef) + public void addDbRef( + final int index, + final uk.ac.vamsas.objects.core.DbRef vDbRef) + throws java.lang.IndexOutOfBoundsException { + this._dbRefList.add(index, vDbRef); + } /** - * Method enumerateDbRef - * - * + * Method enumerateDbRef. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.DbRef elements */ - public java.util.Enumeration enumerateDbRef() - { - return _dbRefList.elements(); - } //-- java.util.Enumeration enumerateDbRef() + public java.util.Enumeration enumerateDbRef( + ) { + return this._dbRefList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -152,55 +142,64 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** - * Method getDbRef - * - * + * Method getDbRef. * * @param index - * @return DbRef + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.DbRef at + * the given index */ - public uk.ac.vamsas.objects.core.DbRef getDbRef(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _dbRefList.size())) { - throw new IndexOutOfBoundsException("getDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]"); + public uk.ac.vamsas.objects.core.DbRef getDbRef( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._dbRefList.size()) { + throw new IndexOutOfBoundsException("getDbRef: Index value '" + index + "' not in range [0.." + (this._dbRefList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.DbRef) _dbRefList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.DbRef getDbRef(int) + return (uk.ac.vamsas.objects.core.DbRef) _dbRefList.get(index); + } /** - * Method getDbRef - * + * Method getDbRef.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return DbRef + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.DbRef[] getDbRef() - { - int size = _dbRefList.size(); - uk.ac.vamsas.objects.core.DbRef[] mArray = new uk.ac.vamsas.objects.core.DbRef[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.DbRef) _dbRefList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.DbRef[] getDbRef() + public uk.ac.vamsas.objects.core.DbRef[] getDbRef( + ) { + uk.ac.vamsas.objects.core.DbRef[] array = new uk.ac.vamsas.objects.core.DbRef[0]; + return (uk.ac.vamsas.objects.core.DbRef[]) this._dbRefList.toArray(array); + } /** - * Method getDbRefCount - * + * Method getDbRefAsReference.Returns a reference to + * '_dbRefList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getDbRefAsReference( + ) { + return this._dbRefList; + } + + /** + * Method getDbRefCount. * - * @return int + * @return the size of this collection */ - public int getDbRefCount() - { - return _dbRefList.size(); - } //-- int getDbRefCount() + public int getDbRefCount( + ) { + return this._dbRefList.size(); + } /** * Returns the value of field 'dictionary'. The field @@ -208,13 +207,12 @@ implements java.io.Serializable * sequence * * - * @return String - * @return the value of field 'dictionary'. + * @return the value of field 'Dictionary'. */ - public java.lang.String getDictionary() - { + public java.lang.String getDictionary( + ) { return this._dictionary; - } //-- java.lang.String getDictionary() + } /** * Returns the value of field 'id'. The field 'id' has the @@ -222,117 +220,177 @@ implements java.io.Serializable * referencing * * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_dictionary != null) { + result = 37 * result + _dictionary.hashCode(); + } + if (_dbRefList != null) { + result = 37 * result + _dbRefList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 removeAllDbRef - * */ - public void removeAllDbRef() - { - _dbRefList.removeAllElements(); - } //-- void removeAllDbRef() + public void removeAllDbRef( + ) { + this._dbRefList.clear(); + } /** - * Method removeDbRef - * + * Method removeDbRef. * + * @param vDbRef + * @return true if the object was removed from the collection. + */ + public boolean removeDbRef( + final uk.ac.vamsas.objects.core.DbRef vDbRef) { + boolean removed = _dbRefList.remove(vDbRef); + return removed; + } + + /** + * Method removeDbRefAt. * * @param index - * @return DbRef + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.DbRef removeDbRef(int index) - { - java.lang.Object obj = _dbRefList.elementAt(index); - _dbRefList.removeElementAt(index); + public uk.ac.vamsas.objects.core.DbRef removeDbRefAt( + final int index) { + java.lang.Object obj = this._dbRefList.remove(index); return (uk.ac.vamsas.objects.core.DbRef) obj; - } //-- uk.ac.vamsas.objects.core.DbRef removeDbRef(int) + } /** - * Method setDbRef - * * * * @param index * @param vDbRef + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setDbRef(int index, uk.ac.vamsas.objects.core.DbRef vDbRef) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _dbRefList.size())) { - throw new IndexOutOfBoundsException("setDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]"); + public void setDbRef( + final int index, + final uk.ac.vamsas.objects.core.DbRef vDbRef) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._dbRefList.size()) { + throw new IndexOutOfBoundsException("setDbRef: Index value '" + index + "' not in range [0.." + (this._dbRefList.size() - 1) + "]"); } - _dbRefList.setElementAt(vDbRef, index); - } //-- void setDbRef(int, uk.ac.vamsas.objects.core.DbRef) + + this._dbRefList.set(index, vDbRef); + } /** - * Method setDbRef - * * * - * @param dbRefArray + * @param vDbRefArray */ - public void setDbRef(uk.ac.vamsas.objects.core.DbRef[] dbRefArray) - { + public void setDbRef( + final uk.ac.vamsas.objects.core.DbRef[] vDbRefArray) { //-- copy array - _dbRefList.removeAllElements(); - for (int i = 0; i < dbRefArray.length; i++) { - _dbRefList.addElement(dbRefArray[i]); + _dbRefList.clear(); + + for (int i = 0; i < vDbRefArray.length; i++) { + this._dbRefList.add(vDbRefArray[i]); } - } //-- void setDbRef(uk.ac.vamsas.objects.core.DbRef) + } + + /** + * Sets the value of '_dbRefList' by copying the given Vector. + * All elements will be checked for type safety. + * + * @param vDbRefList the Vector to copy. + */ + public void setDbRef( + final java.util.Vector vDbRefList) { + // copy vector + this._dbRefList.clear(); + + this._dbRefList.addAll(vDbRefList); + } + + /** + * Sets the value of '_dbRefList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param dbRefVector the Vector to set. + */ + public void setDbRefAsReference( + final java.util.Vector dbRefVector) { + this._dbRefList = dbRefVector; + } /** * Sets the value of field 'dictionary'. The field 'dictionary' @@ -341,10 +399,10 @@ implements java.io.Serializable * * @param dictionary the value of field 'dictionary'. */ - public void setDictionary(java.lang.String dictionary) - { + public void setDictionary( + final java.lang.String dictionary) { this._dictionary = dictionary; - } //-- void setDictionary(java.lang.String) + } /** * Sets the value of field 'id'. The field 'id' has the @@ -354,34 +412,38 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return SequenceType + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.SequenceTyp */ - public static uk.ac.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.Sequence) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Sequence.class, reader); - } //-- uk.ac.vamsas.objects.core.SequenceType unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.SequenceType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Sequence.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/SequenceType.java b/src/uk/ac/vamsas/objects/core/SequenceType.java index 55efd85..4c057a4 100644 --- a/src/uk/ac/vamsas/objects/core/SequenceType.java +++ b/src/uk/ac/vamsas/objects/core/SequenceType.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 SequenceType. @@ -38,9 +29,9 @@ implements java.io.Serializable //--------------------------/ /** - * Field _start + * Field _start. */ - private int _start; + private long _start; /** * keeps track of state for field: _start @@ -48,9 +39,9 @@ implements java.io.Serializable private boolean _has_start; /** - * Field _end + * Field _end. */ - private int _end; + private long _end; /** * keeps track of state for field: _end @@ -58,17 +49,17 @@ implements java.io.Serializable private boolean _has_end; /** - * Field _sequence + * Field _sequence. */ private java.lang.String _sequence; /** - * Field _name + * Field _name. */ private java.lang.String _name; /** - * Field _description + * Field _description. */ private java.lang.String _description; @@ -78,7 +69,7 @@ implements java.io.Serializable private java.util.Vector _propertyList; /** - * Field _mappingList + * Field _mappingList. */ private java.util.Vector _mappingList; @@ -87,12 +78,11 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public SequenceType() - { + public SequenceType() { super(); - _propertyList = new Vector(); - _mappingList = new Vector(); - } //-- uk.ac.vamsas.objects.core.SequenceType() + this._propertyList = new java.util.Vector(); + this._mappingList = new java.util.Vector(); + } //-----------/ @@ -100,109 +90,105 @@ implements java.io.Serializable //-----------/ /** - * Method addMapping - * * * * @param vMapping + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addMapping(uk.ac.vamsas.objects.core.Mapping vMapping) - throws java.lang.IndexOutOfBoundsException - { - _mappingList.addElement(vMapping); - } //-- void addMapping(uk.ac.vamsas.objects.core.Mapping) + public void addMapping( + final uk.ac.vamsas.objects.core.Mapping vMapping) + throws java.lang.IndexOutOfBoundsException { + this._mappingList.addElement(vMapping); + } /** - * Method addMapping - * * * * @param index * @param vMapping + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addMapping(int index, uk.ac.vamsas.objects.core.Mapping vMapping) - throws java.lang.IndexOutOfBoundsException - { - _mappingList.insertElementAt(vMapping, index); - } //-- void addMapping(int, uk.ac.vamsas.objects.core.Mapping) + public void addMapping( + final int index, + final uk.ac.vamsas.objects.core.Mapping vMapping) + throws java.lang.IndexOutOfBoundsException { + this._mappingList.add(index, vMapping); + } /** - * Method addProperty - * * * * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.addElement(vProperty); - } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + public void addProperty( + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.addElement(vProperty); + } /** - * Method addProperty - * * * * @param index * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.insertElementAt(vProperty, index); - } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + public void addProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.add(index, vProperty); + } /** - * Method deleteEnd - * */ - public void deleteEnd() - { + public void deleteEnd( + ) { this._has_end= false; - } //-- void deleteEnd() + } /** - * Method deleteStart - * */ - public void deleteStart() - { + public void deleteStart( + ) { this._has_start= false; - } //-- void deleteStart() + } /** - * Method enumerateMapping + * Method enumerateMapping. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Mapping elements */ - public java.util.Enumeration enumerateMapping() - { - return _mappingList.elements(); - } //-- java.util.Enumeration enumerateMapping() + public java.util.Enumeration enumerateMapping( + ) { + return this._mappingList.elements(); + } /** - * Method enumerateProperty - * + * Method enumerateProperty. * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Property elements */ - public java.util.Enumeration enumerateProperty() - { - return _propertyList.elements(); - } //-- java.util.Enumeration enumerateProperty() + public java.util.Enumeration enumerateProperty( + ) { + return this._propertyList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -258,420 +244,536 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'description'. * - * @return String - * @return the value of field 'description'. + * @return the value of field 'Description'. */ - public java.lang.String getDescription() - { + public java.lang.String getDescription( + ) { return this._description; - } //-- java.lang.String getDescription() + } /** * Returns the value of field 'end'. * - * @return int - * @return the value of field 'end'. + * @return the value of field 'End'. */ - public int getEnd() - { + public long getEnd( + ) { return this._end; - } //-- int getEnd() + } /** - * Method getMapping - * - * + * Method getMapping. * * @param index - * @return Mapping - */ - public uk.ac.vamsas.objects.core.Mapping getMapping(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _mappingList.size())) { - throw new IndexOutOfBoundsException("getMapping: Index value '"+index+"' not in range [0.."+_mappingList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Mapping + * at the given index + */ + public uk.ac.vamsas.objects.core.Mapping getMapping( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._mappingList.size()) { + throw new IndexOutOfBoundsException("getMapping: Index value '" + index + "' not in range [0.." + (this._mappingList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Mapping) _mappingList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Mapping getMapping(int) + return (uk.ac.vamsas.objects.core.Mapping) _mappingList.get(index); + } /** - * Method getMapping + * Method getMapping.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * - * @return Mapping + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Mapping[] getMapping() - { - int size = _mappingList.size(); - uk.ac.vamsas.objects.core.Mapping[] mArray = new uk.ac.vamsas.objects.core.Mapping[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Mapping) _mappingList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Mapping[] getMapping() + public uk.ac.vamsas.objects.core.Mapping[] getMapping( + ) { + uk.ac.vamsas.objects.core.Mapping[] array = new uk.ac.vamsas.objects.core.Mapping[0]; + return (uk.ac.vamsas.objects.core.Mapping[]) this._mappingList.toArray(array); + } /** - * Method getMappingCount - * + * Method getMappingAsReference.Returns a reference to + * '_mappingList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getMappingAsReference( + ) { + return this._mappingList; + } + + /** + * Method getMappingCount. * - * @return int + * @return the size of this collection */ - public int getMappingCount() - { - return _mappingList.size(); - } //-- int getMappingCount() + public int getMappingCount( + ) { + return this._mappingList.size(); + } /** * Returns the value of field 'name'. * - * @return String - * @return the value of field 'name'. + * @return the value of field 'Name'. */ - public java.lang.String getName() - { + public java.lang.String getName( + ) { return this._name; - } //-- java.lang.String getName() + } /** - * Method getProperty - * - * + * Method getProperty. * * @param index - * @return Property - */ - public uk.ac.vamsas.objects.core.Property getProperty(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Property + * at the given index + */ + public uk.ac.vamsas.objects.core.Property getProperty( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index); + } /** - * Method getProperty + * Method getProperty.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * - * @return Property + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Property[] getProperty() - { - int size = _propertyList.size(); - uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + public uk.ac.vamsas.objects.core.Property[] getProperty( + ) { + uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0]; + return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array); + } /** - * Method getPropertyCount - * + * Method getPropertyAsReference.Returns a reference to + * '_propertyList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getPropertyAsReference( + ) { + return this._propertyList; + } + + /** + * Method getPropertyCount. * - * @return int + * @return the size of this collection */ - public int getPropertyCount() - { - return _propertyList.size(); - } //-- int getPropertyCount() + public int getPropertyCount( + ) { + return this._propertyList.size(); + } /** * Returns the value of field 'sequence'. * - * @return String - * @return the value of field 'sequence'. + * @return the value of field 'Sequence'. */ - public java.lang.String getSequence() - { + public java.lang.String getSequence( + ) { return this._sequence; - } //-- java.lang.String getSequence() + } /** * Returns the value of field 'start'. * - * @return int - * @return the value of field 'start'. + * @return the value of field 'Start'. */ - public int getStart() - { + public long getStart( + ) { return this._start; - } //-- int getStart() + } /** - * Method hasEnd - * - * + * Method hasEnd. * - * @return boolean + * @return true if at least one End has been added */ - public boolean hasEnd() - { + public boolean hasEnd( + ) { return this._has_end; - } //-- boolean hasEnd() + } /** - * Method hasStart + * Method hasStart. * - * - * - * @return boolean + * @return true if at least one Start has been added */ - public boolean hasStart() - { + public boolean hasStart( + ) { return this._has_start; - } //-- boolean hasStart() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + (int)(_start^(_start>>>32)); + result = 37 * result + (int)(_end^(_end>>>32)); + if (_sequence != null) { + result = 37 * result + _sequence.hashCode(); + } + if (_name != null) { + result = 37 * result + _name.hashCode(); + } + if (_description != null) { + result = 37 * result + _description.hashCode(); + } + if (_propertyList != null) { + result = 37 * result + _propertyList.hashCode(); + } + if (_mappingList != null) { + result = 37 * result + _mappingList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAllMapping - * */ - public void removeAllMapping() - { - _mappingList.removeAllElements(); - } //-- void removeAllMapping() + public void removeAllMapping( + ) { + this._mappingList.clear(); + } /** - * Method removeAllProperty - * */ - public void removeAllProperty() - { - _propertyList.removeAllElements(); - } //-- void removeAllProperty() + public void removeAllProperty( + ) { + this._propertyList.clear(); + } /** - * Method removeMapping - * + * Method removeMapping. * + * @param vMapping + * @return true if the object was removed from the collection. + */ + public boolean removeMapping( + final uk.ac.vamsas.objects.core.Mapping vMapping) { + boolean removed = _mappingList.remove(vMapping); + return removed; + } + + /** + * Method removeMappingAt. * * @param index - * @return Mapping + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Mapping removeMapping(int index) - { - java.lang.Object obj = _mappingList.elementAt(index); - _mappingList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Mapping removeMappingAt( + final int index) { + java.lang.Object obj = this._mappingList.remove(index); return (uk.ac.vamsas.objects.core.Mapping) obj; - } //-- uk.ac.vamsas.objects.core.Mapping removeMapping(int) + } /** - * Method removeProperty - * + * Method removeProperty. * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final uk.ac.vamsas.objects.core.Property vProperty) { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. * * @param index - * @return Property + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Property removeProperty(int index) - { - java.lang.Object obj = _propertyList.elementAt(index); - _propertyList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Property removePropertyAt( + final int index) { + java.lang.Object obj = this._propertyList.remove(index); return (uk.ac.vamsas.objects.core.Property) obj; - } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + } /** * Sets the value of field 'description'. * * @param description the value of field 'description'. */ - public void setDescription(java.lang.String description) - { + public void setDescription( + final java.lang.String description) { this._description = description; - } //-- void setDescription(java.lang.String) + } /** * Sets the value of field 'end'. * * @param end the value of field 'end'. */ - public void setEnd(int end) - { + public void setEnd( + final long end) { this._end = end; this._has_end = true; - } //-- void setEnd(int) + } /** - * Method setMapping - * * * * @param index * @param vMapping - */ - public void setMapping(int index, uk.ac.vamsas.objects.core.Mapping vMapping) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _mappingList.size())) { - throw new IndexOutOfBoundsException("setMapping: Index value '"+index+"' not in range [0.."+_mappingList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setMapping( + final int index, + final uk.ac.vamsas.objects.core.Mapping vMapping) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._mappingList.size()) { + throw new IndexOutOfBoundsException("setMapping: Index value '" + index + "' not in range [0.." + (this._mappingList.size() - 1) + "]"); } - _mappingList.setElementAt(vMapping, index); - } //-- void setMapping(int, uk.ac.vamsas.objects.core.Mapping) + + this._mappingList.set(index, vMapping); + } /** - * Method setMapping * * - * - * @param mappingArray + * @param vMappingArray */ - public void setMapping(uk.ac.vamsas.objects.core.Mapping[] mappingArray) - { + public void setMapping( + final uk.ac.vamsas.objects.core.Mapping[] vMappingArray) { //-- copy array - _mappingList.removeAllElements(); - for (int i = 0; i < mappingArray.length; i++) { - _mappingList.addElement(mappingArray[i]); + _mappingList.clear(); + + for (int i = 0; i < vMappingArray.length; i++) { + this._mappingList.add(vMappingArray[i]); } - } //-- void setMapping(uk.ac.vamsas.objects.core.Mapping) + } + + /** + * Sets the value of '_mappingList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vMappingList the Vector to copy. + */ + public void setMapping( + final java.util.Vector vMappingList) { + // copy vector + this._mappingList.clear(); + + this._mappingList.addAll(vMappingList); + } + + /** + * Sets the value of '_mappingList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param mappingVector the Vector to set. + */ + public void setMappingAsReference( + final java.util.Vector mappingVector) { + this._mappingList = mappingVector; + } /** * Sets the value of field 'name'. * * @param name the value of field 'name'. */ - public void setName(java.lang.String name) - { + public void setName( + final java.lang.String name) { this._name = name; - } //-- void setName(java.lang.String) + } /** - * Method setProperty - * * * * @param index * @param vProperty - */ - public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - _propertyList.setElementAt(vProperty, index); - } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + this._propertyList.set(index, vProperty); + } /** - * Method setProperty - * * * - * @param propertyArray + * @param vPropertyArray */ - public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) - { + public void setProperty( + final uk.ac.vamsas.objects.core.Property[] vPropertyArray) { //-- copy array - _propertyList.removeAllElements(); - for (int i = 0; i < propertyArray.length; i++) { - _propertyList.addElement(propertyArray[i]); + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) { + this._propertyList.add(vPropertyArray[i]); } - } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + } + + /** + * Sets the value of '_propertyList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vPropertyList the Vector to copy. + */ + public void setProperty( + final java.util.Vector vPropertyList) { + // copy vector + this._propertyList.clear(); + + this._propertyList.addAll(vPropertyList); + } + + /** + * Sets the value of '_propertyList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param propertyVector the Vector to set. + */ + public void setPropertyAsReference( + final java.util.Vector propertyVector) { + this._propertyList = propertyVector; + } /** * Sets the value of field 'sequence'. * * @param sequence the value of field 'sequence'. */ - public void setSequence(java.lang.String sequence) - { + public void setSequence( + final java.lang.String sequence) { this._sequence = sequence; - } //-- void setSequence(java.lang.String) + } /** * Sets the value of field 'start'. * * @param start the value of field 'start'. */ - public void setStart(int start) - { + public void setStart( + final long start) { this._start = start; this._has_start = true; - } //-- void setStart(int) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return SequenceType - */ - public static uk.ac.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.SequenceTyp + */ + public static uk.ac.vamsas.objects.core.SequenceType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.SequenceType.class, reader); - } //-- uk.ac.vamsas.objects.core.SequenceType unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/Tree.java b/src/uk/ac/vamsas/objects/core/Tree.java index 3b52110..5019ad2 100644 --- a/src/uk/ac/vamsas/objects/core/Tree.java +++ b/src/uk/ac/vamsas/objects/core/Tree.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 Tree. @@ -43,27 +34,27 @@ implements java.io.Serializable private java.lang.String _id; /** - * Field _modifiable + * Field _modifiable. */ private java.lang.String _modifiable; /** - * Field _title + * Field _title. */ private java.lang.String _title; /** - * Field _newickList + * Field _newickList. */ private java.util.Vector _newickList; /** - * Field _propertyList + * Field _propertyList. */ private java.util.Vector _propertyList; /** - * Field _provenance + * Field _provenance. */ private uk.ac.vamsas.objects.core.Provenance _provenance; @@ -72,12 +63,11 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Tree() - { + public Tree() { super(); - _newickList = new Vector(); - _propertyList = new Vector(); - } //-- uk.ac.vamsas.objects.core.Tree() + this._newickList = new java.util.Vector(); + this._propertyList = new java.util.Vector(); + } //-----------/ @@ -85,91 +75,91 @@ implements java.io.Serializable //-----------/ /** - * Method addNewick - * * * * @param vNewick + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addNewick(uk.ac.vamsas.objects.core.Newick vNewick) - throws java.lang.IndexOutOfBoundsException - { - _newickList.addElement(vNewick); - } //-- void addNewick(uk.ac.vamsas.objects.core.Newick) + public void addNewick( + final uk.ac.vamsas.objects.core.Newick vNewick) + throws java.lang.IndexOutOfBoundsException { + this._newickList.addElement(vNewick); + } /** - * Method addNewick - * * * * @param index * @param vNewick + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addNewick(int index, uk.ac.vamsas.objects.core.Newick vNewick) - throws java.lang.IndexOutOfBoundsException - { - _newickList.insertElementAt(vNewick, index); - } //-- void addNewick(int, uk.ac.vamsas.objects.core.Newick) + public void addNewick( + final int index, + final uk.ac.vamsas.objects.core.Newick vNewick) + throws java.lang.IndexOutOfBoundsException { + this._newickList.add(index, vNewick); + } /** - * Method addProperty - * * * * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.addElement(vProperty); - } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + public void addProperty( + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.addElement(vProperty); + } /** - * Method addProperty - * * * * @param index * @param vProperty + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - _propertyList.insertElementAt(vProperty, index); - } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + public void addProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + this._propertyList.add(index, vProperty); + } /** - * Method enumerateNewick - * - * + * Method enumerateNewick. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Newick elements */ - public java.util.Enumeration enumerateNewick() - { - return _newickList.elements(); - } //-- java.util.Enumeration enumerateNewick() + public java.util.Enumeration enumerateNewick( + ) { + return this._newickList.elements(); + } /** - * Method enumerateProperty + * Method enumerateProperty. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Property elements */ - public java.util.Enumeration enumerateProperty() - { - return _propertyList.elements(); - } //-- java.util.Enumeration enumerateProperty() + public java.util.Enumeration enumerateProperty( + ) { + return this._propertyList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -224,243 +214,307 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object * referencing * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** * Returns the value of field 'modifiable'. * - * @return String - * @return the value of field 'modifiable'. + * @return the value of field 'Modifiable'. */ - public java.lang.String getModifiable() - { + public java.lang.String getModifiable( + ) { return this._modifiable; - } //-- java.lang.String getModifiable() + } /** - * Method getNewick - * - * + * Method getNewick. * * @param index - * @return Newick - */ - public uk.ac.vamsas.objects.core.Newick getNewick(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _newickList.size())) { - throw new IndexOutOfBoundsException("getNewick: Index value '"+index+"' not in range [0.."+_newickList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Newick at + * the given index + */ + public uk.ac.vamsas.objects.core.Newick getNewick( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._newickList.size()) { + throw new IndexOutOfBoundsException("getNewick: Index value '" + index + "' not in range [0.." + (this._newickList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Newick) _newickList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Newick getNewick(int) + return (uk.ac.vamsas.objects.core.Newick) _newickList.get(index); + } /** - * Method getNewick - * + * Method getNewick.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return Newick + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Newick[] getNewick() - { - int size = _newickList.size(); - uk.ac.vamsas.objects.core.Newick[] mArray = new uk.ac.vamsas.objects.core.Newick[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Newick) _newickList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Newick[] getNewick() + public uk.ac.vamsas.objects.core.Newick[] getNewick( + ) { + uk.ac.vamsas.objects.core.Newick[] array = new uk.ac.vamsas.objects.core.Newick[0]; + return (uk.ac.vamsas.objects.core.Newick[]) this._newickList.toArray(array); + } /** - * Method getNewickCount - * + * Method getNewickAsReference.Returns a reference to + * '_newickList'. No type checking is performed on any + * modifications to the Vector. * - * - * @return int + * @return a reference to the Vector backing this class */ - public int getNewickCount() - { - return _newickList.size(); - } //-- int getNewickCount() + public java.util.Vector getNewickAsReference( + ) { + return this._newickList; + } /** - * Method getProperty - * + * Method getNewickCount. * + * @return the size of this collection + */ + public int getNewickCount( + ) { + return this._newickList.size(); + } + + /** + * Method getProperty. * * @param index - * @return Property - */ - public uk.ac.vamsas.objects.core.Property getProperty(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Property + * at the given index + */ + public uk.ac.vamsas.objects.core.Property getProperty( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index); + } /** - * Method getProperty - * + * Method getProperty.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return Property + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Property[] getProperty() - { - int size = _propertyList.size(); - uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + public uk.ac.vamsas.objects.core.Property[] getProperty( + ) { + uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0]; + return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array); + } /** - * Method getPropertyCount - * + * Method getPropertyAsReference.Returns a reference to + * '_propertyList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getPropertyAsReference( + ) { + return this._propertyList; + } + + /** + * Method getPropertyCount. * - * @return int + * @return the size of this collection */ - public int getPropertyCount() - { - return _propertyList.size(); - } //-- int getPropertyCount() + public int getPropertyCount( + ) { + return this._propertyList.size(); + } /** * Returns the value of field 'provenance'. * - * @return Provenance - * @return the value of field 'provenance'. + * @return the value of field 'Provenance'. */ - public uk.ac.vamsas.objects.core.Provenance getProvenance() - { + public uk.ac.vamsas.objects.core.Provenance getProvenance( + ) { return this._provenance; - } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + } /** * Returns the value of field 'title'. * - * @return String - * @return the value of field 'title'. + * @return the value of field 'Title'. */ - public java.lang.String getTitle() - { + public java.lang.String getTitle( + ) { return this._title; - } //-- java.lang.String getTitle() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_modifiable != null) { + result = 37 * result + _modifiable.hashCode(); + } + if (_title != null) { + result = 37 * result + _title.hashCode(); + } + if (_newickList != null) { + result = 37 * result + _newickList.hashCode(); + } + if (_propertyList != null) { + result = 37 * result + _propertyList.hashCode(); + } + if (_provenance != null) { + result = 37 * result + _provenance.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAllNewick - * */ - public void removeAllNewick() - { - _newickList.removeAllElements(); - } //-- void removeAllNewick() + public void removeAllNewick( + ) { + this._newickList.clear(); + } /** - * Method removeAllProperty - * */ - public void removeAllProperty() - { - _propertyList.removeAllElements(); - } //-- void removeAllProperty() + public void removeAllProperty( + ) { + this._propertyList.clear(); + } /** - * Method removeNewick - * + * Method removeNewick. * + * @param vNewick + * @return true if the object was removed from the collection. + */ + public boolean removeNewick( + final uk.ac.vamsas.objects.core.Newick vNewick) { + boolean removed = _newickList.remove(vNewick); + return removed; + } + + /** + * Method removeNewickAt. * * @param index - * @return Newick + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Newick removeNewick(int index) - { - java.lang.Object obj = _newickList.elementAt(index); - _newickList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Newick removeNewickAt( + final int index) { + java.lang.Object obj = this._newickList.remove(index); return (uk.ac.vamsas.objects.core.Newick) obj; - } //-- uk.ac.vamsas.objects.core.Newick removeNewick(int) + } /** - * Method removeProperty - * + * Method removeProperty. * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final uk.ac.vamsas.objects.core.Property vProperty) { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. * * @param index - * @return Property + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Property removeProperty(int index) - { - java.lang.Object obj = _propertyList.elementAt(index); - _propertyList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Property removePropertyAt( + final int index) { + java.lang.Object obj = this._propertyList.remove(index); return (uk.ac.vamsas.objects.core.Property) obj; - } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + } /** * Sets the value of field 'id'. The field 'id' has the @@ -469,132 +523,190 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'modifiable'. * * @param modifiable the value of field 'modifiable'. */ - public void setModifiable(java.lang.String modifiable) - { + public void setModifiable( + final java.lang.String modifiable) { this._modifiable = modifiable; - } //-- void setModifiable(java.lang.String) + } /** - * Method setNewick - * * * * @param index * @param vNewick - */ - public void setNewick(int index, uk.ac.vamsas.objects.core.Newick vNewick) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _newickList.size())) { - throw new IndexOutOfBoundsException("setNewick: Index value '"+index+"' not in range [0.."+_newickList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setNewick( + final int index, + final uk.ac.vamsas.objects.core.Newick vNewick) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._newickList.size()) { + throw new IndexOutOfBoundsException("setNewick: Index value '" + index + "' not in range [0.." + (this._newickList.size() - 1) + "]"); } - _newickList.setElementAt(vNewick, index); - } //-- void setNewick(int, uk.ac.vamsas.objects.core.Newick) + + this._newickList.set(index, vNewick); + } /** - * Method setNewick - * * * - * @param newickArray + * @param vNewickArray */ - public void setNewick(uk.ac.vamsas.objects.core.Newick[] newickArray) - { + public void setNewick( + final uk.ac.vamsas.objects.core.Newick[] vNewickArray) { //-- copy array - _newickList.removeAllElements(); - for (int i = 0; i < newickArray.length; i++) { - _newickList.addElement(newickArray[i]); + _newickList.clear(); + + for (int i = 0; i < vNewickArray.length; i++) { + this._newickList.add(vNewickArray[i]); } - } //-- void setNewick(uk.ac.vamsas.objects.core.Newick) + } /** - * Method setProperty + * Sets the value of '_newickList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vNewickList the Vector to copy. + */ + public void setNewick( + final java.util.Vector vNewickList) { + // copy vector + this._newickList.clear(); + + this._newickList.addAll(vNewickList); + } + + /** + * Sets the value of '_newickList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param newickVector the Vector to set. + */ + public void setNewickAsReference( + final java.util.Vector newickVector) { + this._newickList = newickVector; + } + + /** * * * @param index * @param vProperty - */ - public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _propertyList.size())) { - throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setProperty( + final int index, + final uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) { + throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); } - _propertyList.setElementAt(vProperty, index); - } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + this._propertyList.set(index, vProperty); + } /** - * Method setProperty * * - * - * @param propertyArray + * @param vPropertyArray */ - public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) - { + public void setProperty( + final uk.ac.vamsas.objects.core.Property[] vPropertyArray) { //-- copy array - _propertyList.removeAllElements(); - for (int i = 0; i < propertyArray.length; i++) { - _propertyList.addElement(propertyArray[i]); + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) { + this._propertyList.add(vPropertyArray[i]); } - } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + } + + /** + * Sets the value of '_propertyList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vPropertyList the Vector to copy. + */ + public void setProperty( + final java.util.Vector vPropertyList) { + // copy vector + this._propertyList.clear(); + + this._propertyList.addAll(vPropertyList); + } + + /** + * Sets the value of '_propertyList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param propertyVector the Vector to set. + */ + public void setPropertyAsReference( + final java.util.Vector propertyVector) { + this._propertyList = propertyVector; + } /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. */ - public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) - { + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { this._provenance = provenance; - } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + } /** * Sets the value of field 'title'. * * @param title the value of field 'title'. */ - public void setTitle(java.lang.String title) - { + public void setTitle( + final java.lang.String title) { this._title = title; - } //-- void setTitle(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Tree - */ - public static uk.ac.vamsas.objects.core.Tree unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Tree + */ + public static uk.ac.vamsas.objects.core.Tree unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Tree) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Tree.class, reader); - } //-- uk.ac.vamsas.objects.core.Tree unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/User.java b/src/uk/ac/vamsas/objects/core/User.java index 424bb27..50f860e 100644 --- a/src/uk/ac/vamsas/objects/core/User.java +++ b/src/uk/ac/vamsas/objects/core/User.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 User. @@ -36,12 +29,12 @@ implements java.io.Serializable //--------------------------/ /** - * Field _fullname + * Field _fullname. */ private java.lang.String _fullname; /** - * Field _organization + * Field _organization. */ private java.lang.String _organization; @@ -50,10 +43,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public User() - { + public User() { super(); - } //-- uk.ac.vamsas.objects.core.User() + } //-----------/ @@ -61,13 +53,13 @@ implements java.io.Serializable //-----------/ /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -94,119 +86,145 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'fullname'. * - * @return String - * @return the value of field 'fullname'. + * @return the value of field 'Fullname'. */ - public java.lang.String getFullname() - { + public java.lang.String getFullname( + ) { return this._fullname; - } //-- java.lang.String getFullname() + } /** * Returns the value of field 'organization'. * - * @return String - * @return the value of field 'organization'. + * @return the value of field 'Organization'. */ - public java.lang.String getOrganization() - { + public java.lang.String getOrganization( + ) { return this._organization; - } //-- java.lang.String getOrganization() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_fullname != null) { + result = 37 * result + _fullname.hashCode(); + } + if (_organization != null) { + result = 37 * result + _organization.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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 + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final 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) + } /** * Sets the value of field 'fullname'. * * @param fullname the value of field 'fullname'. */ - public void setFullname(java.lang.String fullname) - { + public void setFullname( + final java.lang.String fullname) { this._fullname = fullname; - } //-- void setFullname(java.lang.String) + } /** * Sets the value of field 'organization'. * * @param organization the value of field 'organization'. */ - public void setOrganization(java.lang.String organization) - { + public void setOrganization( + final java.lang.String organization) { this._organization = organization; - } //-- void setOrganization(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return AppData + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.AppData */ - public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (uk.ac.vamsas.objects.core.User) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.User.class, reader); - } //-- uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader) + public static uk.ac.vamsas.objects.core.AppData unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.User.class, reader); + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/VAMSAS.java b/src/uk/ac/vamsas/objects/core/VAMSAS.java index 155e0a4..ba8146f 100644 --- a/src/uk/ac/vamsas/objects/core/VAMSAS.java +++ b/src/uk/ac/vamsas/objects/core/VAMSAS.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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; /** * contains unassociated trees and a number of analysis sets @@ -44,17 +35,17 @@ implements java.io.Serializable private java.lang.String _id; /** - * Field _modifiable + * Field _modifiable. */ private java.lang.String _modifiable; /** - * Field _treeList + * Field _treeList. */ private java.util.Vector _treeList; /** - * Field _dataSetList + * Field _dataSetList. */ private java.util.Vector _dataSetList; @@ -63,12 +54,11 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public VAMSAS() - { + public VAMSAS() { super(); - _treeList = new Vector(); - _dataSetList = new Vector(); - } //-- uk.ac.vamsas.objects.core.VAMSAS() + this._treeList = new java.util.Vector(); + this._dataSetList = new java.util.Vector(); + } //-----------/ @@ -76,91 +66,91 @@ implements java.io.Serializable //-----------/ /** - * Method addDataSet - * * * * @param vDataSet + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addDataSet(uk.ac.vamsas.objects.core.DataSet vDataSet) - throws java.lang.IndexOutOfBoundsException - { - _dataSetList.addElement(vDataSet); - } //-- void addDataSet(uk.ac.vamsas.objects.core.DataSet) + public void addDataSet( + final uk.ac.vamsas.objects.core.DataSet vDataSet) + throws java.lang.IndexOutOfBoundsException { + this._dataSetList.addElement(vDataSet); + } /** - * Method addDataSet - * * * * @param index * @param vDataSet + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addDataSet(int index, uk.ac.vamsas.objects.core.DataSet vDataSet) - throws java.lang.IndexOutOfBoundsException - { - _dataSetList.insertElementAt(vDataSet, index); - } //-- void addDataSet(int, uk.ac.vamsas.objects.core.DataSet) + public void addDataSet( + final int index, + final uk.ac.vamsas.objects.core.DataSet vDataSet) + throws java.lang.IndexOutOfBoundsException { + this._dataSetList.add(index, vDataSet); + } /** - * Method addTree - * * * * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.addElement(vTree); - } //-- void addTree(uk.ac.vamsas.objects.core.Tree) + public void addTree( + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.addElement(vTree); + } /** - * Method addTree - * * * * @param index * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(int index, uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.insertElementAt(vTree, index); - } //-- void addTree(int, uk.ac.vamsas.objects.core.Tree) + public void addTree( + final int index, + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.add(index, vTree); + } /** - * Method enumerateDataSet - * - * + * Method enumerateDataSet. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.DataSet elements */ - public java.util.Enumeration enumerateDataSet() - { - return _dataSetList.elements(); - } //-- java.util.Enumeration enumerateDataSet() + public java.util.Enumeration enumerateDataSet( + ) { + return this._dataSetList.elements(); + } /** - * Method enumerateTree + * Method enumerateTree. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Tree elements */ - public java.util.Enumeration enumerateTree() - { - return _treeList.elements(); - } //-- java.util.Enumeration enumerateTree() + public java.util.Enumeration enumerateTree( + ) { + return this._treeList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -201,255 +191,342 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** - * Method getDataSet - * - * + * Method getDataSet. * * @param index - * @return DataSet - */ - public uk.ac.vamsas.objects.core.DataSet getDataSet(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _dataSetList.size())) { - throw new IndexOutOfBoundsException("getDataSet: Index value '"+index+"' not in range [0.."+_dataSetList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.DataSet + * at the given index + */ + public uk.ac.vamsas.objects.core.DataSet getDataSet( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._dataSetList.size()) { + throw new IndexOutOfBoundsException("getDataSet: Index value '" + index + "' not in range [0.." + (this._dataSetList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.DataSet) _dataSetList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.DataSet getDataSet(int) + return (uk.ac.vamsas.objects.core.DataSet) _dataSetList.get(index); + } /** - * Method getDataSet - * + * Method getDataSet.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * @return DataSet + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.DataSet[] getDataSet() - { - int size = _dataSetList.size(); - uk.ac.vamsas.objects.core.DataSet[] mArray = new uk.ac.vamsas.objects.core.DataSet[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.DataSet) _dataSetList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.DataSet[] getDataSet() + public uk.ac.vamsas.objects.core.DataSet[] getDataSet( + ) { + uk.ac.vamsas.objects.core.DataSet[] array = new uk.ac.vamsas.objects.core.DataSet[0]; + return (uk.ac.vamsas.objects.core.DataSet[]) this._dataSetList.toArray(array); + } /** - * Method getDataSetCount - * + * Method getDataSetAsReference.Returns a reference to + * '_dataSetList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getDataSetAsReference( + ) { + return this._dataSetList; + } + + /** + * Method getDataSetCount. * - * @return int + * @return the size of this collection */ - public int getDataSetCount() - { - return _dataSetList.size(); - } //-- int getDataSetCount() + public int getDataSetCount( + ) { + return this._dataSetList.size(); + } /** * Returns the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object * referencing * - * @return String - * @return the value of field 'id'. + * @return the value of field 'Id'. */ - public java.lang.String getId() - { + public java.lang.String getId( + ) { return this._id; - } //-- java.lang.String getId() + } /** * Returns the value of field 'modifiable'. * - * @return String - * @return the value of field 'modifiable'. + * @return the value of field 'Modifiable'. */ - public java.lang.String getModifiable() - { + public java.lang.String getModifiable( + ) { return this._modifiable; - } //-- java.lang.String getModifiable() + } /** - * Method getTree - * - * + * Method getTree. * * @param index - * @return Tree - */ - public uk.ac.vamsas.objects.core.Tree getTree(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _treeList.size())) { - throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Tree at + * the given index + */ + public uk.ac.vamsas.objects.core.Tree getTree( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) { + throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Tree getTree(int) + return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index); + } /** - * Method getTree - * - * + * Method getTree.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * @return Tree + * @return this collection as an Array */ - public uk.ac.vamsas.objects.core.Tree[] getTree() - { - int size = _treeList.size(); - uk.ac.vamsas.objects.core.Tree[] mArray = new uk.ac.vamsas.objects.core.Tree[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); - } - return mArray; - } //-- uk.ac.vamsas.objects.core.Tree[] getTree() + public uk.ac.vamsas.objects.core.Tree[] getTree( + ) { + uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0]; + return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array); + } /** - * Method getTreeCount - * - * + * Method getTreeAsReference.Returns a reference to + * '_treeList'. No type checking is performed on any + * modifications to the Vector. * - * @return int + * @return a reference to the Vector backing this class */ - public int getTreeCount() - { - return _treeList.size(); - } //-- int getTreeCount() + public java.util.Vector getTreeAsReference( + ) { + return this._treeList; + } /** - * Method isValid + * Method getTreeCount. * + * @return the size of this collection + */ + public int getTreeCount( + ) { + return this._treeList.size(); + } + + /** + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_modifiable != null) { + result = 37 * result + _modifiable.hashCode(); + } + if (_treeList != null) { + result = 37 * result + _treeList.hashCode(); + } + if (_dataSetList != null) { + result = 37 * result + _dataSetList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAllDataSet - * */ - public void removeAllDataSet() - { - _dataSetList.removeAllElements(); - } //-- void removeAllDataSet() + public void removeAllDataSet( + ) { + this._dataSetList.clear(); + } /** - * Method removeAllTree - * */ - public void removeAllTree() - { - _treeList.removeAllElements(); - } //-- void removeAllTree() + public void removeAllTree( + ) { + this._treeList.clear(); + } /** - * Method removeDataSet - * + * Method removeDataSet. * + * @param vDataSet + * @return true if the object was removed from the collection. + */ + public boolean removeDataSet( + final uk.ac.vamsas.objects.core.DataSet vDataSet) { + boolean removed = _dataSetList.remove(vDataSet); + return removed; + } + + /** + * Method removeDataSetAt. * * @param index - * @return DataSet + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.DataSet removeDataSet(int index) - { - java.lang.Object obj = _dataSetList.elementAt(index); - _dataSetList.removeElementAt(index); + public uk.ac.vamsas.objects.core.DataSet removeDataSetAt( + final int index) { + java.lang.Object obj = this._dataSetList.remove(index); return (uk.ac.vamsas.objects.core.DataSet) obj; - } //-- uk.ac.vamsas.objects.core.DataSet removeDataSet(int) + } /** - * Method removeTree - * + * Method removeTree. * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree( + final uk.ac.vamsas.objects.core.Tree vTree) { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. * * @param index - * @return Tree + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Tree removeTree(int index) - { - java.lang.Object obj = _treeList.elementAt(index); - _treeList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Tree removeTreeAt( + final int index) { + java.lang.Object obj = this._treeList.remove(index); return (uk.ac.vamsas.objects.core.Tree) obj; - } //-- uk.ac.vamsas.objects.core.Tree removeTree(int) + } /** - * Method setDataSet - * * * * @param index * @param vDataSet - */ - public void setDataSet(int index, uk.ac.vamsas.objects.core.DataSet vDataSet) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _dataSetList.size())) { - throw new IndexOutOfBoundsException("setDataSet: Index value '"+index+"' not in range [0.."+_dataSetList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setDataSet( + final int index, + final uk.ac.vamsas.objects.core.DataSet vDataSet) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._dataSetList.size()) { + throw new IndexOutOfBoundsException("setDataSet: Index value '" + index + "' not in range [0.." + (this._dataSetList.size() - 1) + "]"); } - _dataSetList.setElementAt(vDataSet, index); - } //-- void setDataSet(int, uk.ac.vamsas.objects.core.DataSet) + + this._dataSetList.set(index, vDataSet); + } /** - * Method setDataSet * * - * - * @param dataSetArray + * @param vDataSetArray */ - public void setDataSet(uk.ac.vamsas.objects.core.DataSet[] dataSetArray) - { + public void setDataSet( + final uk.ac.vamsas.objects.core.DataSet[] vDataSetArray) { //-- copy array - _dataSetList.removeAllElements(); - for (int i = 0; i < dataSetArray.length; i++) { - _dataSetList.addElement(dataSetArray[i]); + _dataSetList.clear(); + + for (int i = 0; i < vDataSetArray.length; i++) { + this._dataSetList.add(vDataSetArray[i]); } - } //-- void setDataSet(uk.ac.vamsas.objects.core.DataSet) + } + + /** + * Sets the value of '_dataSetList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vDataSetList the Vector to copy. + */ + public void setDataSet( + final java.util.Vector vDataSetList) { + // copy vector + this._dataSetList.clear(); + + this._dataSetList.addAll(vDataSetList); + } + + /** + * Sets the value of '_dataSetList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param dataSetVector the Vector to set. + */ + public void setDataSetAsReference( + final java.util.Vector dataSetVector) { + this._dataSetList = dataSetVector; + } /** * Sets the value of field 'id'. The field 'id' has the @@ -458,78 +535,109 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'modifiable'. * * @param modifiable the value of field 'modifiable'. */ - public void setModifiable(java.lang.String modifiable) - { + public void setModifiable( + final java.lang.String modifiable) { this._modifiable = modifiable; - } //-- void setModifiable(java.lang.String) + } /** - * Method setTree - * * * * @param index * @param vTree - */ - public void setTree(int index, uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _treeList.size())) { - throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setTree( + final int index, + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) { + throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); } - _treeList.setElementAt(vTree, index); - } //-- void setTree(int, uk.ac.vamsas.objects.core.Tree) + + this._treeList.set(index, vTree); + } /** - * Method setTree - * * * - * @param treeArray + * @param vTreeArray */ - public void setTree(uk.ac.vamsas.objects.core.Tree[] treeArray) - { + public void setTree( + final uk.ac.vamsas.objects.core.Tree[] vTreeArray) { //-- copy array - _treeList.removeAllElements(); - for (int i = 0; i < treeArray.length; i++) { - _treeList.addElement(treeArray[i]); + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) { + this._treeList.add(vTreeArray[i]); } - } //-- void setTree(uk.ac.vamsas.objects.core.Tree) + } /** - * Method unmarshal + * Sets the value of '_treeList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vTreeList the Vector to copy. + */ + public void setTree( + final java.util.Vector vTreeList) { + // copy vector + this._treeList.clear(); + + this._treeList.addAll(vTreeList); + } + + /** + * Sets the value of '_treeList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated * + * @param treeVector the Vector to set. + */ + public void setTreeAsReference( + final java.util.Vector treeVector) { + this._treeList = treeVector; + } + + /** + * Method unmarshal. * * @param reader - * @return VAMSAS - */ - public static uk.ac.vamsas.objects.core.VAMSAS unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.VAMSAS + */ + public static uk.ac.vamsas.objects.core.VAMSAS unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.VAMSAS) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.VAMSAS.class, reader); - } //-- uk.ac.vamsas.objects.core.VAMSAS unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/VamsasDocument.java b/src/uk/ac/vamsas/objects/core/VamsasDocument.java index 8da041c..1114663 100644 --- a/src/uk/ac/vamsas/objects/core/VamsasDocument.java +++ b/src/uk/ac/vamsas/objects/core/VamsasDocument.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -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 VamsasDocument. @@ -43,14 +34,14 @@ implements java.io.Serializable private java.lang.String _version; /** - * Field _lockFile + * Field _lockFile. */ private uk.ac.vamsas.objects.core.LockFile _lockFile; /** - * Field _provenance + * Field _provenance. */ - private Provenance _provenance; + private uk.ac.vamsas.objects.core.Provenance _provenance; /** * contains unassociated trees and a number of analysis sets @@ -59,12 +50,12 @@ implements java.io.Serializable private java.util.Vector _VAMSASList; /** - * Field _applicationDataList + * Field _applicationDataList. */ private java.util.Vector _applicationDataList; /** - * Field _attachmentList + * Field _attachmentList. */ private java.util.Vector _attachmentList; @@ -73,13 +64,12 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public VamsasDocument() - { + public VamsasDocument() { super(); - _VAMSASList = new Vector(); - _applicationDataList = new Vector(); - _attachmentList = new Vector(); - } //-- uk.ac.vamsas.objects.core.VamsasDocument() + this._VAMSASList = new java.util.Vector(); + this._applicationDataList = new java.util.Vector(); + this._attachmentList = new java.util.Vector(); + } //-----------/ @@ -87,130 +77,130 @@ implements java.io.Serializable //-----------/ /** - * Method addApplicationData - * * * * @param vApplicationData + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addApplicationData(ApplicationData vApplicationData) - throws java.lang.IndexOutOfBoundsException - { - _applicationDataList.addElement(vApplicationData); - } //-- void addApplicationData(ApplicationData) + public void addApplicationData( + final uk.ac.vamsas.objects.core.ApplicationData vApplicationData) + throws java.lang.IndexOutOfBoundsException { + this._applicationDataList.addElement(vApplicationData); + } /** - * Method addApplicationData - * * * * @param index * @param vApplicationData + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addApplicationData(int index, ApplicationData vApplicationData) - throws java.lang.IndexOutOfBoundsException - { - _applicationDataList.insertElementAt(vApplicationData, index); - } //-- void addApplicationData(int, ApplicationData) + public void addApplicationData( + final int index, + final uk.ac.vamsas.objects.core.ApplicationData vApplicationData) + throws java.lang.IndexOutOfBoundsException { + this._applicationDataList.add(index, vApplicationData); + } /** - * Method addAttachment - * * * * @param vAttachment + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAttachment(Attachment vAttachment) - throws java.lang.IndexOutOfBoundsException - { - _attachmentList.addElement(vAttachment); - } //-- void addAttachment(Attachment) + public void addAttachment( + final uk.ac.vamsas.objects.core.Attachment vAttachment) + throws java.lang.IndexOutOfBoundsException { + this._attachmentList.addElement(vAttachment); + } /** - * Method addAttachment - * * * * @param index * @param vAttachment + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAttachment(int index, Attachment vAttachment) - throws java.lang.IndexOutOfBoundsException - { - _attachmentList.insertElementAt(vAttachment, index); - } //-- void addAttachment(int, Attachment) + public void addAttachment( + final int index, + final uk.ac.vamsas.objects.core.Attachment vAttachment) + throws java.lang.IndexOutOfBoundsException { + this._attachmentList.add(index, vAttachment); + } /** - * Method addVAMSAS - * * * * @param vVAMSAS + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addVAMSAS(VAMSAS vVAMSAS) - throws java.lang.IndexOutOfBoundsException - { - _VAMSASList.addElement(vVAMSAS); - } //-- void addVAMSAS(VAMSAS) + public void addVAMSAS( + final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS) + throws java.lang.IndexOutOfBoundsException { + this._VAMSASList.addElement(vVAMSAS); + } /** - * Method addVAMSAS - * * * * @param index * @param vVAMSAS + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addVAMSAS(int index, VAMSAS vVAMSAS) - throws java.lang.IndexOutOfBoundsException - { - _VAMSASList.insertElementAt(vVAMSAS, index); - } //-- void addVAMSAS(int, VAMSAS) + public void addVAMSAS( + final int index, + final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS) + throws java.lang.IndexOutOfBoundsException { + this._VAMSASList.add(index, vVAMSAS); + } /** - * Method enumerateApplicationData - * - * + * Method enumerateApplicationData. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.ApplicationData elements */ - public java.util.Enumeration enumerateApplicationData() - { - return _applicationDataList.elements(); - } //-- java.util.Enumeration enumerateApplicationData() + public java.util.Enumeration enumerateApplicationData( + ) { + return this._applicationDataList.elements(); + } /** - * Method enumerateAttachment + * Method enumerateAttachment. * - * - * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Attachment elements */ - public java.util.Enumeration enumerateAttachment() - { - return _attachmentList.elements(); - } //-- java.util.Enumeration enumerateAttachment() + public java.util.Enumeration enumerateAttachment( + ) { + return this._attachmentList.elements(); + } /** - * Method enumerateVAMSAS - * - * + * Method enumerateVAMSAS. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.VAMSAS elements */ - public java.util.Enumeration enumerateVAMSAS() - { - return _VAMSASList.elements(); - } //-- java.util.Enumeration enumerateVAMSAS() + public java.util.Enumeration enumerateVAMSAS( + ) { + return this._VAMSASList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -265,426 +255,589 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** - * Method getApplicationData - * - * + * Method getApplicationData. * * @param index - * @return ApplicationData - */ - public ApplicationData getApplicationData(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _applicationDataList.size())) { - throw new IndexOutOfBoundsException("getApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * uk.ac.vamsas.objects.core.ApplicationData at the given index + */ + public uk.ac.vamsas.objects.core.ApplicationData getApplicationData( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._applicationDataList.size()) { + throw new IndexOutOfBoundsException("getApplicationData: Index value '" + index + "' not in range [0.." + (this._applicationDataList.size() - 1) + "]"); } - return (ApplicationData) _applicationDataList.elementAt(index); - } //-- ApplicationData getApplicationData(int) + return (uk.ac.vamsas.objects.core.ApplicationData) _applicationDataList.get(index); + } /** - * Method getApplicationData - * + * Method getApplicationData.Returns the contents of the + * collection in an Array.

Note: Just in case the + * collection contents are changing in another thread, we pass + * a 0-length Array of the correct type into the API call. + * This way we know that the Array returned is of + * exactly the correct length. * - * - * @return ApplicationData + * @return this collection as an Array */ - public ApplicationData[] getApplicationData() - { - int size = _applicationDataList.size(); - ApplicationData[] mArray = new ApplicationData[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (ApplicationData) _applicationDataList.elementAt(index); - } - return mArray; - } //-- ApplicationData[] getApplicationData() + public uk.ac.vamsas.objects.core.ApplicationData[] getApplicationData( + ) { + uk.ac.vamsas.objects.core.ApplicationData[] array = new uk.ac.vamsas.objects.core.ApplicationData[0]; + return (uk.ac.vamsas.objects.core.ApplicationData[]) this._applicationDataList.toArray(array); + } /** - * Method getApplicationDataCount - * - * + * Method getApplicationDataAsReference.Returns a reference to + * '_applicationDataList'. No type checking is performed on any + * modifications to the Vector. * - * @return int + * @return a reference to the Vector backing this class */ - public int getApplicationDataCount() - { - return _applicationDataList.size(); - } //-- int getApplicationDataCount() + public java.util.Vector getApplicationDataAsReference( + ) { + return this._applicationDataList; + } /** - * Method getAttachment - * + * Method getApplicationDataCount. * + * @return the size of this collection + */ + public int getApplicationDataCount( + ) { + return this._applicationDataList.size(); + } + + /** + * Method getAttachment. * * @param index - * @return Attachment - */ - public Attachment getAttachment(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _attachmentList.size())) { - throw new IndexOutOfBoundsException("getAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * uk.ac.vamsas.objects.core.Attachment at the given index + */ + public uk.ac.vamsas.objects.core.Attachment getAttachment( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._attachmentList.size()) { + throw new IndexOutOfBoundsException("getAttachment: Index value '" + index + "' not in range [0.." + (this._attachmentList.size() - 1) + "]"); } - return (Attachment) _attachmentList.elementAt(index); - } //-- Attachment getAttachment(int) + return (uk.ac.vamsas.objects.core.Attachment) _attachmentList.get(index); + } /** - * Method getAttachment + * Method getAttachment.Returns the contents of the collection + * in an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * - * - * @return Attachment + * @return this collection as an Array */ - public Attachment[] getAttachment() - { - int size = _attachmentList.size(); - Attachment[] mArray = new Attachment[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (Attachment) _attachmentList.elementAt(index); - } - return mArray; - } //-- Attachment[] getAttachment() + public uk.ac.vamsas.objects.core.Attachment[] getAttachment( + ) { + uk.ac.vamsas.objects.core.Attachment[] array = new uk.ac.vamsas.objects.core.Attachment[0]; + return (uk.ac.vamsas.objects.core.Attachment[]) this._attachmentList.toArray(array); + } /** - * Method getAttachmentCount - * + * Method getAttachmentAsReference.Returns a reference to + * '_attachmentList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getAttachmentAsReference( + ) { + return this._attachmentList; + } + + /** + * Method getAttachmentCount. * - * @return int + * @return the size of this collection */ - public int getAttachmentCount() - { - return _attachmentList.size(); - } //-- int getAttachmentCount() + public int getAttachmentCount( + ) { + return this._attachmentList.size(); + } /** * Returns the value of field 'lockFile'. * - * @return LockFile - * @return the value of field 'lockFile'. + * @return the value of field 'LockFile'. */ - public uk.ac.vamsas.objects.core.LockFile getLockFile() - { + public uk.ac.vamsas.objects.core.LockFile getLockFile( + ) { return this._lockFile; - } //-- uk.ac.vamsas.objects.core.LockFile getLockFile() + } /** * Returns the value of field 'provenance'. * - * @return Provenance - * @return the value of field 'provenance'. + * @return the value of field 'Provenance'. */ - public Provenance getProvenance() - { + public uk.ac.vamsas.objects.core.Provenance getProvenance( + ) { return this._provenance; - } //-- Provenance getProvenance() + } /** - * Method getVAMSAS - * - * + * Method getVAMSAS. * * @param index - * @return VAMSAS - */ - public VAMSAS getVAMSAS(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _VAMSASList.size())) { - throw new IndexOutOfBoundsException("getVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.VAMSAS at + * the given index + */ + public uk.ac.vamsas.objects.core.VAMSAS getVAMSAS( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._VAMSASList.size()) { + throw new IndexOutOfBoundsException("getVAMSAS: Index value '" + index + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]"); } - return (VAMSAS) _VAMSASList.elementAt(index); - } //-- VAMSAS getVAMSAS(int) + return (uk.ac.vamsas.objects.core.VAMSAS) _VAMSASList.get(index); + } /** - * Method getVAMSAS - * - * + * Method getVAMSAS.Returns the contents of the collection in + * an Array.

Note: Just in case the collection contents + * are changing in another thread, we pass a 0-length Array of + * the correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. * - * @return VAMSAS + * @return this collection as an Array */ - public VAMSAS[] getVAMSAS() - { - int size = _VAMSASList.size(); - VAMSAS[] mArray = new VAMSAS[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (VAMSAS) _VAMSASList.elementAt(index); - } - return mArray; - } //-- VAMSAS[] getVAMSAS() + public uk.ac.vamsas.objects.core.VAMSAS[] getVAMSAS( + ) { + uk.ac.vamsas.objects.core.VAMSAS[] array = new uk.ac.vamsas.objects.core.VAMSAS[0]; + return (uk.ac.vamsas.objects.core.VAMSAS[]) this._VAMSASList.toArray(array); + } /** - * Method getVAMSASCount - * + * Method getVAMSASAsReference.Returns a reference to + * '_VAMSASList'. No type checking is performed on any + * modifications to the Vector. * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getVAMSASAsReference( + ) { + return this._VAMSASList; + } + + /** + * Method getVAMSASCount. * - * @return int + * @return the size of this collection */ - public int getVAMSASCount() - { - return _VAMSASList.size(); - } //-- int getVAMSASCount() + public int getVAMSASCount( + ) { + return this._VAMSASList.size(); + } /** * Returns the value of field 'version'. The field 'version' * has the following description: Vamsas Document Version * Number * - * @return String - * @return the value of field 'version'. + * @return the value of field 'Version'. */ - public java.lang.String getVersion() - { + public java.lang.String getVersion( + ) { return this._version; - } //-- java.lang.String getVersion() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_version != null) { + result = 37 * result + _version.hashCode(); + } + if (_lockFile != null) { + result = 37 * result + _lockFile.hashCode(); + } + if (_provenance != null) { + result = 37 * result + _provenance.hashCode(); + } + if (_VAMSASList != null) { + result = 37 * result + _VAMSASList.hashCode(); + } + if (_applicationDataList != null) { + result = 37 * result + _applicationDataList.hashCode(); + } + if (_attachmentList != null) { + result = 37 * result + _attachmentList.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } 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 - { - + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final 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 - { - + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final 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 removeAllApplicationData - * */ - public void removeAllApplicationData() - { - _applicationDataList.removeAllElements(); - } //-- void removeAllApplicationData() + public void removeAllApplicationData( + ) { + this._applicationDataList.clear(); + } /** - * Method removeAllAttachment - * */ - public void removeAllAttachment() - { - _attachmentList.removeAllElements(); - } //-- void removeAllAttachment() + public void removeAllAttachment( + ) { + this._attachmentList.clear(); + } /** - * Method removeAllVAMSAS - * */ - public void removeAllVAMSAS() - { - _VAMSASList.removeAllElements(); - } //-- void removeAllVAMSAS() + public void removeAllVAMSAS( + ) { + this._VAMSASList.clear(); + } /** - * Method removeApplicationData - * + * Method removeApplicationData. * + * @param vApplicationData + * @return true if the object was removed from the collection. + */ + public boolean removeApplicationData( + final uk.ac.vamsas.objects.core.ApplicationData vApplicationData) { + boolean removed = _applicationDataList.remove(vApplicationData); + return removed; + } + + /** + * Method removeApplicationDataAt. * * @param index - * @return ApplicationData + * @return the element removed from the collection */ - public ApplicationData removeApplicationData(int index) - { - java.lang.Object obj = _applicationDataList.elementAt(index); - _applicationDataList.removeElementAt(index); - return (ApplicationData) obj; - } //-- ApplicationData removeApplicationData(int) + public uk.ac.vamsas.objects.core.ApplicationData removeApplicationDataAt( + final int index) { + java.lang.Object obj = this._applicationDataList.remove(index); + return (uk.ac.vamsas.objects.core.ApplicationData) obj; + } /** - * Method removeAttachment - * + * Method removeAttachment. * + * @param vAttachment + * @return true if the object was removed from the collection. + */ + public boolean removeAttachment( + final uk.ac.vamsas.objects.core.Attachment vAttachment) { + boolean removed = _attachmentList.remove(vAttachment); + return removed; + } + + /** + * Method removeAttachmentAt. * * @param index - * @return Attachment + * @return the element removed from the collection */ - public Attachment removeAttachment(int index) - { - java.lang.Object obj = _attachmentList.elementAt(index); - _attachmentList.removeElementAt(index); - return (Attachment) obj; - } //-- Attachment removeAttachment(int) + public uk.ac.vamsas.objects.core.Attachment removeAttachmentAt( + final int index) { + java.lang.Object obj = this._attachmentList.remove(index); + return (uk.ac.vamsas.objects.core.Attachment) obj; + } /** - * Method removeVAMSAS - * + * Method removeVAMSAS. * + * @param vVAMSAS + * @return true if the object was removed from the collection. + */ + public boolean removeVAMSAS( + final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS) { + boolean removed = _VAMSASList.remove(vVAMSAS); + return removed; + } + + /** + * Method removeVAMSASAt. * * @param index - * @return VAMSAS + * @return the element removed from the collection */ - public VAMSAS removeVAMSAS(int index) - { - java.lang.Object obj = _VAMSASList.elementAt(index); - _VAMSASList.removeElementAt(index); - return (VAMSAS) obj; - } //-- VAMSAS removeVAMSAS(int) + public uk.ac.vamsas.objects.core.VAMSAS removeVAMSASAt( + final int index) { + java.lang.Object obj = this._VAMSASList.remove(index); + return (uk.ac.vamsas.objects.core.VAMSAS) obj; + } /** - * Method setApplicationData - * * * * @param index * @param vApplicationData - */ - public void setApplicationData(int index, ApplicationData vApplicationData) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _applicationDataList.size())) { - throw new IndexOutOfBoundsException("setApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setApplicationData( + final int index, + final uk.ac.vamsas.objects.core.ApplicationData vApplicationData) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._applicationDataList.size()) { + throw new IndexOutOfBoundsException("setApplicationData: Index value '" + index + "' not in range [0.." + (this._applicationDataList.size() - 1) + "]"); } - _applicationDataList.setElementAt(vApplicationData, index); - } //-- void setApplicationData(int, ApplicationData) + + this._applicationDataList.set(index, vApplicationData); + } /** - * Method setApplicationData * * - * - * @param applicationDataArray + * @param vApplicationDataArray */ - public void setApplicationData(ApplicationData[] applicationDataArray) - { + public void setApplicationData( + final uk.ac.vamsas.objects.core.ApplicationData[] vApplicationDataArray) { //-- copy array - _applicationDataList.removeAllElements(); - for (int i = 0; i < applicationDataArray.length; i++) { - _applicationDataList.addElement(applicationDataArray[i]); + _applicationDataList.clear(); + + for (int i = 0; i < vApplicationDataArray.length; i++) { + this._applicationDataList.add(vApplicationDataArray[i]); } - } //-- void setApplicationData(ApplicationData) + } /** - * Method setAttachment + * Sets the value of '_applicationDataList' by copying the + * given Vector. All elements will be checked for type safety. * + * @param vApplicationDataList the Vector to copy. + */ + public void setApplicationData( + final java.util.Vector vApplicationDataList) { + // copy vector + this._applicationDataList.clear(); + + this._applicationDataList.addAll(vApplicationDataList); + } + + /** + * Sets the value of '_applicationDataList' by setting it to + * the given Vector. No type checking is performed. + * @deprecated + * + * @param applicationDataVector the Vector to set. + */ + public void setApplicationDataAsReference( + final java.util.Vector applicationDataVector) { + this._applicationDataList = applicationDataVector; + } + + /** * * * @param index * @param vAttachment - */ - public void setAttachment(int index, Attachment vAttachment) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _attachmentList.size())) { - throw new IndexOutOfBoundsException("setAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setAttachment( + final int index, + final uk.ac.vamsas.objects.core.Attachment vAttachment) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._attachmentList.size()) { + throw new IndexOutOfBoundsException("setAttachment: Index value '" + index + "' not in range [0.." + (this._attachmentList.size() - 1) + "]"); } - _attachmentList.setElementAt(vAttachment, index); - } //-- void setAttachment(int, Attachment) + + this._attachmentList.set(index, vAttachment); + } /** - * Method setAttachment - * * * - * @param attachmentArray + * @param vAttachmentArray */ - public void setAttachment(Attachment[] attachmentArray) - { + public void setAttachment( + final uk.ac.vamsas.objects.core.Attachment[] vAttachmentArray) { //-- copy array - _attachmentList.removeAllElements(); - for (int i = 0; i < attachmentArray.length; i++) { - _attachmentList.addElement(attachmentArray[i]); + _attachmentList.clear(); + + for (int i = 0; i < vAttachmentArray.length; i++) { + this._attachmentList.add(vAttachmentArray[i]); } - } //-- void setAttachment(Attachment) + } + + /** + * Sets the value of '_attachmentList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vAttachmentList the Vector to copy. + */ + public void setAttachment( + final java.util.Vector vAttachmentList) { + // copy vector + this._attachmentList.clear(); + + this._attachmentList.addAll(vAttachmentList); + } + + /** + * Sets the value of '_attachmentList' by setting it to the + * given Vector. No type checking is performed. + * @deprecated + * + * @param attachmentVector the Vector to set. + */ + public void setAttachmentAsReference( + final java.util.Vector attachmentVector) { + this._attachmentList = attachmentVector; + } /** * Sets the value of field 'lockFile'. * * @param lockFile the value of field 'lockFile'. */ - public void setLockFile(uk.ac.vamsas.objects.core.LockFile lockFile) - { + public void setLockFile( + final uk.ac.vamsas.objects.core.LockFile lockFile) { this._lockFile = lockFile; - } //-- void setLockFile(uk.ac.vamsas.objects.core.LockFile) + } /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. */ - public void setProvenance(Provenance provenance) - { + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { this._provenance = provenance; - } //-- void setProvenance(Provenance) + } /** - * Method setVAMSAS - * * * * @param index * @param vVAMSAS - */ - public void setVAMSAS(int index, VAMSAS vVAMSAS) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _VAMSASList.size())) { - throw new IndexOutOfBoundsException("setVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setVAMSAS( + final int index, + final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._VAMSASList.size()) { + throw new IndexOutOfBoundsException("setVAMSAS: Index value '" + index + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]"); } - _VAMSASList.setElementAt(vVAMSAS, index); - } //-- void setVAMSAS(int, VAMSAS) + + this._VAMSASList.set(index, vVAMSAS); + } /** - * Method setVAMSAS * * - * - * @param VAMSASArray + * @param vVAMSASArray */ - public void setVAMSAS(VAMSAS[] VAMSASArray) - { + public void setVAMSAS( + final uk.ac.vamsas.objects.core.VAMSAS[] vVAMSASArray) { //-- copy array - _VAMSASList.removeAllElements(); - for (int i = 0; i < VAMSASArray.length; i++) { - _VAMSASList.addElement(VAMSASArray[i]); + _VAMSASList.clear(); + + for (int i = 0; i < vVAMSASArray.length; i++) { + this._VAMSASList.add(vVAMSASArray[i]); } - } //-- void setVAMSAS(VAMSAS) + } + + /** + * Sets the value of '_VAMSASList' by copying the given Vector. + * All elements will be checked for type safety. + * + * @param vVAMSASList the Vector to copy. + */ + public void setVAMSAS( + final java.util.Vector vVAMSASList) { + // copy vector + this._VAMSASList.clear(); + + this._VAMSASList.addAll(vVAMSASList); + } + + /** + * Sets the value of '_VAMSASList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param VAMSASVector the Vector to set. + */ + public void setVAMSASAsReference( + final java.util.Vector VAMSASVector) { + this._VAMSASList = VAMSASVector; + } /** * Sets the value of field 'version'. The field 'version' has @@ -692,34 +845,39 @@ implements java.io.Serializable * * @param version the value of field 'version'. */ - public void setVersion(java.lang.String version) - { + public void setVersion( + final java.lang.String version) { this._version = version; - } //-- void setVersion(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return VamsasDocument - */ - public static uk.ac.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled + * uk.ac.vamsas.objects.core.VamsasDocument + */ + public static uk.ac.vamsas.objects.core.VamsasDocument unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.VamsasDocument.class, reader); - } //-- uk.ac.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + 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() + } } diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java new file mode 100644 index 0000000..f1d89d8 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java @@ -0,0 +1,245 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.AlignmentAnnotation; + +/** + * Class AlignmentAnnotationDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AlignmentAnnotationDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentAnnotationDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "AlignmentAnnotation"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _graph + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_graph", "graph", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AlignmentAnnotation target = (AlignmentAnnotation) object; + if (!target.hasGraph()) { return null; } + return (target.getGraph() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentAnnotation target = (AlignmentAnnotation) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setGraph( ((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _graph + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _provenance + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AlignmentAnnotation target = (AlignmentAnnotation) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentAnnotation target = (AlignmentAnnotation) object; + target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Provenance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _provenance + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.AlignmentAnnotation.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java new file mode 100644 index 0000000..2c67213 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java @@ -0,0 +1,522 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Alignment; + +/** + * Class AlignmentDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "Alignment"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _gapChar + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_gapChar", "gapChar", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getGapChar(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.setGapChar( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _gapChar + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _aligned + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_aligned", "aligned", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + if (!target.hasAligned()) { return null; } + return (target.getAligned() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteAligned(); + return; + } + target.setAligned( ((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _aligned + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.setModifiable( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _alignmentAnnotationList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AlignmentAnnotation.class, "_alignmentAnnotationList", "AlignmentAnnotation", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getAlignmentAnnotation(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.addAlignmentAnnotation( (uk.ac.vamsas.objects.core.AlignmentAnnotation) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Alignment target = (Alignment) object; + target.removeAllAlignmentAnnotation(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.AlignmentAnnotation(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _alignmentAnnotationList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _treeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Tree.class, "_treeList", "Tree", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getTree(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.addTree( (uk.ac.vamsas.objects.core.Tree) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Alignment target = (Alignment) object; + target.removeAllTree(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Tree(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _treeList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _alignmentSequenceList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AlignmentSequence.class, "_alignmentSequenceList", "alignmentSequence", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getAlignmentSequence(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.addAlignmentSequence( (uk.ac.vamsas.objects.core.AlignmentSequence) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Alignment target = (Alignment) object; + target.removeAllAlignmentSequence(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.AlignmentSequence(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _alignmentSequenceList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Alignment target = (Alignment) object; + target.removeAllProperty(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _propertyList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _provenance + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Provenance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _provenance + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Alignment.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java new file mode 100644 index 0000000..1f52e65 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java @@ -0,0 +1,245 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation; + +/** + * Class AlignmentSequenceAnnotationDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AlignmentSequenceAnnotationDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentSequenceAnnotationDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "AlignmentSequenceAnnotation"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _graph + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_graph", "graph", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object; + if (!target.hasGraph()) { return null; } + return (target.getGraph() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setGraph( ((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _graph + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _provenance + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object; + target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Provenance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _provenance + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java new file mode 100644 index 0000000..526c7f0 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java @@ -0,0 +1,285 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.AlignmentSequence; + +/** + * Class AlignmentSequenceDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AlignmentSequenceDescriptor extends uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentSequenceDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "alignmentSequence"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AlignmentSequence target = (AlignmentSequence) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentSequence target = (AlignmentSequence) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _refid + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_refid", "refid", org.exolab.castor.xml.NodeType.Attribute); + desc.setReference(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AlignmentSequence target = (AlignmentSequence) object; + return target.getRefid(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentSequence target = (AlignmentSequence) object; + target.setRefid( (java.lang.Object) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.Object(); + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _refid + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.IdRefValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdRefValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _alignmentSequenceAnnotationList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, "_alignmentSequenceAnnotationList", "AlignmentSequenceAnnotation", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AlignmentSequence target = (AlignmentSequence) object; + return target.getAlignmentSequenceAnnotation(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentSequence target = (AlignmentSequence) object; + target.addAlignmentSequenceAnnotation( (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + AlignmentSequence target = (AlignmentSequence) object; + target.removeAllAlignmentSequenceAnnotation(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _alignmentSequenceAnnotationList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.AlignmentSequence.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java new file mode 100644 index 0000000..68ab2fb --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java @@ -0,0 +1,413 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.AnnotationElement; + +/** + * Class AnnotationElementDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AnnotationElementDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AnnotationElementDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "annotationElement"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _position + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_position", "position", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + if (!target.hasPosition()) { return null; } + return new java.lang.Long(target.getPosition()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setPosition( ((java.lang.Long) value).longValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _position + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _after + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_after", "after", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + if (!target.hasAfter()) { return null; } + return (target.getAfter() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteAfter(); + return; + } + target.setAfter( ((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _after + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _description + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + return target.getDescription(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + target.setDescription( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _description + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _glyphList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Glyph.class, "_glyphList", "glyph", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + return target.getGlyph(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + target.addGlyph( (uk.ac.vamsas.objects.core.Glyph) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + AnnotationElement target = (AnnotationElement) object; + target.removeAllGlyph(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Glyph(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _glyphList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _valueList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_valueList", "value", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + return target.getValue(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.addValue( ((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + AnnotationElement target = (AnnotationElement) object; + target.removeAllValue(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _valueList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.AnnotationElement.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java new file mode 100644 index 0000000..248fe43 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java @@ -0,0 +1,240 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.AppData; + +/** + * Class AppDataDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AppDataDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AppDataDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "appData"; + _elementDefinition = false; + + //-- set grouping compositor + setCompositorAsChoice(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _data + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(byte[].class, "_data", "data", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AppData target = (AppData) object; + return target.getData(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AppData target = (AppData) object; + target.setData( (byte[]) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _data + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _dataReference + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dataReference", "dataReference", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AppData target = (AppData) object; + return target.getDataReference(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AppData target = (AppData) object; + target.setDataReference( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _dataReference + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.AppData.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java new file mode 100644 index 0000000..7465b32 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java @@ -0,0 +1,364 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.ApplicationData; + +/** + * Class ApplicationDataDescriptor. + * + * @version $Revision$ $Date$ + */ +public class ApplicationDataDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public ApplicationDataDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "ApplicationData"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _version + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ApplicationData target = (ApplicationData) object; + return target.getVersion(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) object; + target.setVersion( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _version + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ApplicationData target = (ApplicationData) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) object; + target.setName( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _userList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.User.class, "_userList", "User", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ApplicationData target = (ApplicationData) object; + return target.getUser(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) object; + target.addUser( (uk.ac.vamsas.objects.core.User) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + ApplicationData target = (ApplicationData) object; + target.removeAllUser(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.User(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _userList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _common + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Common.class, "_common", "Common", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ApplicationData target = (ApplicationData) object; + return target.getCommon(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) object; + target.setCommon( (uk.ac.vamsas.objects.core.Common) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Common(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _common + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _instanceList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Instance.class, "_instanceList", "Instance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ApplicationData target = (ApplicationData) object; + return target.getInstance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) object; + target.addInstance( (uk.ac.vamsas.objects.core.Instance) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + ApplicationData target = (ApplicationData) object; + target.removeAllInstance(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Instance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _instanceList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.ApplicationData.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java new file mode 100644 index 0000000..449d40d --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java @@ -0,0 +1,320 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Attachment; + +/** + * Class AttachmentDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AttachmentDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AttachmentDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "Attachment"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _compressed + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_compressed", "compressed", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Attachment target = (Attachment) object; + if (!target.hasCompressed()) { return null; } + return (target.getCompressed() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Attachment target = (Attachment) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteCompressed(); + return; + } + target.setCompressed( ((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _compressed + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Attachment target = (Attachment) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Attachment target = (Attachment) object; + target.setType( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _type + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _objectref + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_objectref", "objectref", org.exolab.castor.xml.NodeType.Attribute); + desc.setReference(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Attachment target = (Attachment) object; + return target.getObjectref(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Attachment target = (Attachment) object; + target.setObjectref( (java.lang.Object) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.Object(); + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _objectref + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.IdRefValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdRefValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Attachment target = (Attachment) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Attachment target = (Attachment) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Attachment.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java new file mode 100644 index 0000000..81bd029 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java @@ -0,0 +1,159 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Common; + +/** + * Class CommonDescriptor. + * + * @version $Revision$ $Date$ + */ +public class CommonDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public CommonDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "Common"; + _elementDefinition = true; + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Common.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java new file mode 100644 index 0000000..9207d74 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java @@ -0,0 +1,242 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.DataSetAnnotations; + +/** + * Class DataSetAnnotationsDescriptor. + * + * @version $Revision$ $Date$ + */ +public class DataSetAnnotationsDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public DataSetAnnotationsDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "DataSetAnnotations"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _seqRef + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_seqRef", "seqRef", org.exolab.castor.xml.NodeType.Attribute); + desc.setReference(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DataSetAnnotations target = (DataSetAnnotations) object; + return target.getSeqRef(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSetAnnotations target = (DataSetAnnotations) object; + target.setSeqRef( (java.lang.Object) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.Object(); + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _seqRef + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.IdRefValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdRefValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _provenance + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DataSetAnnotations target = (DataSetAnnotations) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSetAnnotations target = (DataSetAnnotations) object; + target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Provenance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _provenance + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.DataSetAnnotations.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java new file mode 100644 index 0000000..01b4887 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java @@ -0,0 +1,405 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.DataSet; + +/** + * Class DataSetDescriptor. + * + * @version $Revision$ $Date$ + */ +public class DataSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public DataSetDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "DataSet"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DataSet target = (DataSet) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _sequenceList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Sequence.class, "_sequenceList", "Sequence", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DataSet target = (DataSet) object; + return target.getSequence(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.addSequence( (uk.ac.vamsas.objects.core.Sequence) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + DataSet target = (DataSet) object; + target.removeAllSequence(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Sequence(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _sequenceList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _dataSetAnnotationsList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.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 + { + DataSet target = (DataSet) object; + return target.getDataSetAnnotations(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.addDataSetAnnotations( (uk.ac.vamsas.objects.core.DataSetAnnotations) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + DataSet target = (DataSet) object; + target.removeAllDataSetAnnotations(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.DataSetAnnotations(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _dataSetAnnotationsList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _alignmentList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Alignment.class, "_alignmentList", "Alignment", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DataSet target = (DataSet) object; + return target.getAlignment(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.addAlignment( (uk.ac.vamsas.objects.core.Alignment) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + DataSet target = (DataSet) object; + target.removeAllAlignment(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Alignment(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _alignmentList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _treeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Tree.class, "_treeList", "Tree", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DataSet target = (DataSet) object; + return target.getTree(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.addTree( (uk.ac.vamsas.objects.core.Tree) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + DataSet target = (DataSet) object; + target.removeAllTree(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Tree(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _treeList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _provenance + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DataSet target = (DataSet) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Provenance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _provenance + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.DataSet.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java new file mode 100644 index 0000000..762b51a --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java @@ -0,0 +1,444 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.DbRef; + +/** + * Class DbRefDescriptor. + * + * @version $Revision$ $Date$ + */ +public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public DbRefDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "dbRef"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _source + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_source", "source", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DbRef target = (DbRef) object; + return target.getSource(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.setSource( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _source + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _version + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DbRef target = (DbRef) object; + return target.getVersion(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.setVersion( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _version + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _accessionId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_accessionId", "accessionId", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DbRef target = (DbRef) object; + return target.getAccessionId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.setAccessionId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _accessionId + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DbRef target = (DbRef) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _mapList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Map.class, "_mapList", "map", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DbRef target = (DbRef) object; + return target.getMap(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.addMap( (uk.ac.vamsas.objects.core.Map) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + DbRef target = (DbRef) object; + target.removeAllMap(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Map(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _mapList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _linkList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Link.class, "_linkList", "link", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DbRef target = (DbRef) object; + return target.getLink(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.addLink( (uk.ac.vamsas.objects.core.Link) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + DbRef target = (DbRef) object; + target.removeAllLink(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Link(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _linkList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DbRef target = (DbRef) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + DbRef target = (DbRef) object; + target.removeAllProperty(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _propertyList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.DbRef.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java new file mode 100644 index 0000000..d6175c1 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java @@ -0,0 +1,485 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Entry; + +/** + * Class EntryDescriptor. + * + * @version $Revision$ $Date$ + */ +public class EntryDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public EntryDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "entry"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _user + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_user", "User", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getUser(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.setUser( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _user + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _app + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_app", "App", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getApp(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.setApp( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _app + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _action + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_action", "Action", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getAction(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.setAction( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _action + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _date + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.types.Date.class, "_date", "Date", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getDate(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.setDate( (org.exolab.castor.types.Date) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new org.exolab.castor.types.Date(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _date + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.DateTimeValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.DateTimeValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Entry target = (Entry) object; + target.removeAllProperty(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _propertyList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _paramList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Param.class, "_paramList", "param", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getParam(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.addParam( (uk.ac.vamsas.objects.core.Param) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Entry target = (Entry) object; + target.removeAllParam(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Param(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _paramList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _inputList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Input.class, "_inputList", "input", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getInput(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.addInput( (uk.ac.vamsas.objects.core.Input) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Entry target = (Entry) object; + target.removeAllInput(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Input(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _inputList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Entry.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java new file mode 100644 index 0000000..da9afa4 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java @@ -0,0 +1,235 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Glyph; + +/** + * Class GlyphDescriptor. + * + * @version $Revision$ $Date$ + */ +public class GlyphDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public GlyphDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "glyph"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Glyph target = (Glyph) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Glyph target = (Glyph) object; + target.setContent( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- _dict + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dict", "dict", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Glyph target = (Glyph) object; + return target.getDict(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Glyph target = (Glyph) object; + target.setDict( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _dict + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Glyph.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java new file mode 100644 index 0000000..b477deb --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java @@ -0,0 +1,241 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Input; + +/** + * Class InputDescriptor. + * + * @version $Revision$ $Date$ + */ +public class InputDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public InputDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "input"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Input target = (Input) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Input target = (Input) object; + target.setName( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _objRef + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_objRef", "objRef", org.exolab.castor.xml.NodeType.Attribute); + desc.setReference(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Input target = (Input) object; + return target.getObjRef(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Input target = (Input) object; + target.setObjRef( (java.lang.Object) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.Object(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _objRef + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdRefValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdRefValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Input.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java new file mode 100644 index 0000000..68631e5 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java @@ -0,0 +1,205 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Instance; + +/** + * Class InstanceDescriptor. + * + * @version $Revision$ $Date$ + */ +public class InstanceDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public InstanceDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "Instance"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _urn + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_urn", "urn", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Instance target = (Instance) object; + return target.getUrn(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Instance target = (Instance) object; + target.setUrn( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _urn + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Instance.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java new file mode 100644 index 0000000..ba1f82b --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java @@ -0,0 +1,230 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Link; + +/** + * Class LinkDescriptor. + * + * @version $Revision$ $Date$ + */ +public class LinkDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public LinkDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "link"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Link target = (Link) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Link target = (Link) object; + target.setContent( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- _href + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_href", "href", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Link target = (Link) object; + return target.getHref(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Link target = (Link) object; + target.setHref( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _href + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Link.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java new file mode 100644 index 0000000..68e512f --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java @@ -0,0 +1,198 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.LockFile; + +/** + * Class LockFileDescriptor. + * + * @version $Revision$ $Date$ + */ +public class LockFileDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public LockFileDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument"; + _xmlName = "LockFile"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + LockFile target = (LockFile) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + LockFile target = (LockFile) object; + target.setContent( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.LockFile.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java new file mode 100644 index 0000000..94e54bb --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java @@ -0,0 +1,159 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Map; + +/** + * Class MapDescriptor. + * + * @version $Revision$ $Date$ + */ +public class MapDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapListDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public MapDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapListDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "map"; + _elementDefinition = true; + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Map.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MapListDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MapListDescriptor.java new file mode 100644 index 0000000..542a713 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/MapListDescriptor.java @@ -0,0 +1,326 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.MapList; + +/** + * Class MapListDescriptor. + * + * @version $Revision$ $Date$ + */ +public class MapListDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public MapListDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "mapList"; + _elementDefinition = false; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _from + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_from", "from", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + MapList target = (MapList) object; + if (!target.hasFrom()) { return null; } + return new java.lang.Long(target.getFrom()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + MapList target = (MapList) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteFrom(); + return; + } + target.setFrom( ((java.lang.Long) value).longValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _from + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _to + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_to", "to", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + MapList target = (MapList) object; + if (!target.hasTo()) { return null; } + return new java.lang.Long(target.getTo()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + MapList target = (MapList) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteTo(); + return; + } + target.setTo( ((java.lang.Long) value).longValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _to + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + MapList target = (MapList) object; + if (!target.hasStart()) { return null; } + return new java.lang.Long(target.getStart()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + MapList target = (MapList) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setStart( ((java.lang.Long) value).longValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + MapList target = (MapList) object; + if (!target.hasEnd()) { return null; } + return new java.lang.Long(target.getEnd()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + MapList target = (MapList) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setEnd( ((java.lang.Long) value).longValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.MapList.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MappingDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MappingDescriptor.java new file mode 100644 index 0000000..a369678 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/MappingDescriptor.java @@ -0,0 +1,204 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Mapping; + +/** + * Class MappingDescriptor. + * + * @version $Revision$ $Date$ + */ +public class MappingDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapListDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public MappingDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapListDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "mapping"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _onto + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_onto", "onto", org.exolab.castor.xml.NodeType.Attribute); + desc.setReference(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Mapping target = (Mapping) object; + return target.getOnto(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Mapping target = (Mapping) object; + target.setOnto( (java.lang.Object) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.Object(); + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _onto + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.IdRefValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdRefValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Mapping.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java new file mode 100644 index 0000000..757db07 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java @@ -0,0 +1,308 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Newick; + +/** + * Class NewickDescriptor. + * + * @version $Revision$ $Date$ + */ +public class NewickDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public NewickDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "newick"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Newick target = (Newick) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Newick target = (Newick) object; + target.setContent( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Newick target = (Newick) object; + return target.getTitle(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Newick target = (Newick) object; + target.setTitle( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _title + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Newick target = (Newick) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Newick target = (Newick) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Newick target = (Newick) object; + return target.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Newick target = (Newick) object; + target.setModifiable( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Newick.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java new file mode 100644 index 0000000..86d432e --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java @@ -0,0 +1,276 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Param; + +/** + * Class ParamDescriptor. + * + * @version $Revision$ $Date$ + */ +public class ParamDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public ParamDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "param"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Param target = (Param) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Param target = (Param) object; + target.setContent( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Param target = (Param) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Param target = (Param) object; + target.setName( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Param target = (Param) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Param target = (Param) object; + target.setType( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _type + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Param.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java new file mode 100644 index 0000000..9973982 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java @@ -0,0 +1,205 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Pos; + +/** + * Class PosDescriptor. + * + * @version $Revision$ $Date$ + */ +public class PosDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public PosDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "pos"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _i + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_i", "i", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Pos target = (Pos) object; + if (!target.hasI()) { return null; } + return new java.lang.Integer(target.getI()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Pos target = (Pos) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setI( ((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _i + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Pos.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java new file mode 100644 index 0000000..e9346ad --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java @@ -0,0 +1,276 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Property; + +/** + * Class PropertyDescriptor. + * + * @version $Revision$ $Date$ + */ +public class PropertyDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public PropertyDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "property"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Property target = (Property) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Property target = (Property) object; + target.setContent( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Property target = (Property) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Property target = (Property) object; + target.setName( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Property target = (Property) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Property target = (Property) object; + target.setType( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _type + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Property.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java new file mode 100644 index 0000000..d5f6d45 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java @@ -0,0 +1,208 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Provenance; + +/** + * Class ProvenanceDescriptor. + * + * @version $Revision$ $Date$ + */ +public class ProvenanceDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public ProvenanceDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "Provenance"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _entryList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Entry.class, "_entryList", "entry", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Provenance target = (Provenance) object; + return target.getEntry(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Provenance target = (Provenance) object; + target.addEntry( (uk.ac.vamsas.objects.core.Entry) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Provenance target = (Provenance) object; + target.removeAllEntry(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Entry(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _entryList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Provenance.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java new file mode 100644 index 0000000..1184f06 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java @@ -0,0 +1,600 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.RangeAnnotation; + +/** + * Class RangeAnnotationDescriptor. + * + * @version $Revision$ $Date$ + */ +public class RangeAnnotationDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public RangeAnnotationDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "rangeAnnotation"; + _elementDefinition = false; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.setModifiable( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _group + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_group", "group", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getGroup(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.setGroup( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _group + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.setType( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _type + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _label + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_label", "label", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getLabel(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.setLabel( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _label + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _description + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getDescription(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.setDescription( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _description + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _status + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_status", "status", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getStatus(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.setStatus( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _status + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _annotationElementList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AnnotationElement.class, "_annotationElementList", "annotationElement", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getAnnotationElement(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.addAnnotationElement( (uk.ac.vamsas.objects.core.AnnotationElement) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.removeAllAnnotationElement(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.AnnotationElement(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _annotationElementList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _scoreList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Score.class, "_scoreList", "score", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getScore(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.addScore( (uk.ac.vamsas.objects.core.Score) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.removeAllScore(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Score(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _scoreList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _linkList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Link.class, "_linkList", "link", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getLink(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.addLink( (uk.ac.vamsas.objects.core.Link) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.removeAllLink(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Link(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _linkList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.removeAllProperty(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _propertyList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.RangeAnnotation.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java new file mode 100644 index 0000000..987c829 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java @@ -0,0 +1,251 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.RangeType; + +/** + * Class RangeTypeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class RangeTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public RangeTypeDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "rangeType"; + _elementDefinition = false; + + //-- set grouping compositor + setCompositorAsChoice(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _posList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Pos.class, "_posList", "pos", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeType target = (RangeType) object; + return target.getPos(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeType target = (RangeType) object; + target.addPos( (uk.ac.vamsas.objects.core.Pos) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + RangeType target = (RangeType) object; + target.removeAllPos(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Pos(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _posList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _segList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Seg.class, "_segList", "seg", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeType target = (RangeType) object; + return target.getSeg(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeType target = (RangeType) object; + target.addSeg( (uk.ac.vamsas.objects.core.Seg) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + RangeType target = (RangeType) object; + target.removeAllSeg(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Seg(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _segList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.RangeType.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java new file mode 100644 index 0000000..c44c201 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java @@ -0,0 +1,241 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Score; + +/** + * Class ScoreDescriptor. + * + * @version $Revision$ $Date$ + */ +public class ScoreDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public ScoreDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "score"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Score target = (Score) object; + if (!target.hasContent()) { return null; } + return new java.lang.Float(target.getContent()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Score target = (Score) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteContent(); + return; + } + target.setContent( ((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Score target = (Score) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Score target = (Score) object; + target.setName( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Score.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java new file mode 100644 index 0000000..8158517 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java @@ -0,0 +1,289 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Seg; + +/** + * Class SegDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SegDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SegDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "seg"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Seg target = (Seg) object; + if (!target.hasStart()) { return null; } + return new java.lang.Integer(target.getStart()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Seg target = (Seg) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setStart( ((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Seg target = (Seg) object; + if (!target.hasEnd()) { return null; } + return new java.lang.Integer(target.getEnd()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Seg target = (Seg) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setEnd( ((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _inclusive + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_inclusive", "inclusive", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Seg target = (Seg) object; + if (!target.hasInclusive()) { return null; } + return (target.getInclusive() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Seg target = (Seg) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setInclusive( ((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _inclusive + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Seg.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java new file mode 100644 index 0000000..2cf4e01 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java @@ -0,0 +1,286 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Sequence; + +/** + * Class SequenceDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SequenceDescriptor extends uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "Sequence"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Sequence target = (Sequence) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Sequence target = (Sequence) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _dictionary + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dictionary", "dictionary", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Sequence target = (Sequence) object; + return target.getDictionary(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Sequence target = (Sequence) object; + target.setDictionary( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _dictionary + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _dbRefList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.DbRef.class, "_dbRefList", "dbRef", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Sequence target = (Sequence) object; + return target.getDbRef(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Sequence target = (Sequence) object; + target.addDbRef( (uk.ac.vamsas.objects.core.DbRef) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Sequence target = (Sequence) object; + target.removeAllDbRef(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.DbRef(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _dbRefList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Sequence.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java new file mode 100644 index 0000000..aed534e --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java @@ -0,0 +1,449 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.SequenceType; + +/** + * Class SequenceTypeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SequenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceTypeDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "SequenceType"; + _elementDefinition = false; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + if (!target.hasStart()) { return null; } + return new java.lang.Long(target.getStart()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setStart( ((java.lang.Long) value).longValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + if (!target.hasEnd()) { return null; } + return new java.lang.Long(target.getEnd()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + // ignore null values for non optional primitives + if (value == null) { return; } + + target.setEnd( ((java.lang.Long) value).longValue()); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _sequence + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_sequence", "sequence", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + return target.getSequence(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + target.setSequence( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _sequence + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + target.setName( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _description + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + return target.getDescription(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + target.setDescription( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _description + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + SequenceType target = (SequenceType) object; + target.removeAllProperty(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _propertyList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _mappingList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Mapping.class, "_mappingList", "mapping", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + return target.getMapping(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + target.addMapping( (uk.ac.vamsas.objects.core.Mapping) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + SequenceType target = (SequenceType) object; + target.removeAllMapping(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Mapping(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _mappingList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.SequenceType.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java new file mode 100644 index 0000000..364fdfe --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java @@ -0,0 +1,396 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Tree; + +/** + * Class TreeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class TreeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public TreeDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "Tree"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + return target.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.setModifiable( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + return target.getTitle(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.setTitle( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _title + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _newickList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Newick.class, "_newickList", "newick", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + return target.getNewick(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.addNewick( (uk.ac.vamsas.objects.core.Newick) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Tree target = (Tree) object; + target.removeAllNewick(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Newick(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _newickList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + Tree target = (Tree) object; + target.removeAllProperty(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _propertyList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _provenance + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Provenance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _provenance + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Tree.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java new file mode 100644 index 0000000..fd16249 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java @@ -0,0 +1,244 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.User; + +/** + * Class UserDescriptor. + * + * @version $Revision$ $Date$ + */ +public class UserDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public UserDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "User"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _fullname + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_fullname", "fullname", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + User target = (User) object; + return target.getFullname(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + User target = (User) object; + target.setFullname( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _fullname + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _organization + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_organization", "organization", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + User target = (User) object; + return target.getOrganization(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + User target = (User) object; + target.setOrganization( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _organization + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + if (_identity == null) { + return super.getIdentity(); + } + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.User.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java new file mode 100644 index 0000000..59f8995 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java @@ -0,0 +1,322 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.VAMSAS; + +/** + * Class VAMSASDescriptor. + * + * @version $Revision$ $Date$ + */ +public class VAMSASDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public VAMSASDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "VAMSAS"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VAMSAS target = (VAMSAS) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + target.setId( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VAMSAS target = (VAMSAS) object; + return target.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + target.setModifiable( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _treeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Tree.class, "_treeList", "Tree", 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.getTree(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + target.addTree( (uk.ac.vamsas.objects.core.Tree) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + VAMSAS target = (VAMSAS) object; + target.removeAllTree(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Tree(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _treeList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _dataSetList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.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.getDataSet(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + target.addDataSet( (uk.ac.vamsas.objects.core.DataSet) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + VAMSAS target = (VAMSAS) object; + target.removeAllDataSet(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.DataSet(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _dataSetList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.VAMSAS.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java new file mode 100644 index 0000000..856736e --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java @@ -0,0 +1,398 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.VamsasDocument; + +/** + * Class VamsasDocumentDescriptor. + * + * @version $Revision$ $Date$ + */ +public class VamsasDocumentDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + /** + * Field _identity. + */ + private org.exolab.castor.xml.XMLFieldDescriptor _identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public VamsasDocumentDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument"; + _xmlName = "VamsasDocument"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _version + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "Version", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getVersion(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.setVersion( (java.lang.String) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _version + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + //-- _lockFile + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.LockFile.class, "_lockFile", "LockFile", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getLockFile(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.setLockFile( (uk.ac.vamsas.objects.core.LockFile) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.LockFile(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _lockFile + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _provenance + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Provenance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _provenance + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _VAMSASList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.VAMSAS.class, "_VAMSASList", "VAMSAS", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getVAMSAS(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.addVAMSAS( (uk.ac.vamsas.objects.core.VAMSAS) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + VamsasDocument target = (VamsasDocument) object; + target.removeAllVAMSAS(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.VAMSAS(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _VAMSASList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _applicationDataList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.ApplicationData.class, "_applicationDataList", "ApplicationData", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getApplicationData(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.addApplicationData( (uk.ac.vamsas.objects.core.ApplicationData) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + VamsasDocument target = (VamsasDocument) object; + target.removeAllApplicationData(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.ApplicationData(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _applicationDataList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _attachmentList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Attachment.class, "_attachmentList", "Attachment", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getAttachment(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.addAttachment( (uk.ac.vamsas.objects.core.Attachment) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + VamsasDocument target = (VamsasDocument) object; + target.removeAllAttachment(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Attachment(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _attachmentList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.VamsasDocument.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} -- 1.7.10.2