From: jprocter Date: Thu, 28 Jun 2007 13:51:44 +0000 (+0000) Subject: sequence mappings and DbRef mapping objects unified and source binding for castor... X-Git-Tag: Release_0.2~113 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1890f014c0a312a7a2203c878e4802e3eb914e47;p=vamsas.git sequence mappings and DbRef mapping objects unified and source binding for castor-1.1-cycle-xml.jar dependency git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@407 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/schemas/vamsas.xsd b/schemas/vamsas.xsd index cdbc003..946b609 100644 --- a/schemas/vamsas.xsd +++ b/schemas/vamsas.xsd @@ -1,7 +1,10 @@ - + Vorba ID - Vamsas Object Request Broker Address ID (name needs to be worked on): Suggest it could be of the form documentRoot/datasetName/SequenceUID for a @@ -60,28 +63,27 @@ - - node identity and mapping data between tree representations and vamsas document objects - + node identity and mapping data between tree + representations and vamsas document objects - - reference to one or more trees containing the node being described. - + reference to one or more trees containing + the node being described. - - String uniquely identifying a particular node in the referenced tree according to the format of the tree representation that is referenced. + String uniquely identifying a particular + node in the referenced tree according to the format of + the tree representation that is referenced. - + @@ -99,25 +101,25 @@ - - base type for citing arbitrary links between vamsas objects + base type for citing arbitrary links between vamsas objects - - Optional human readable description of the relationship + Optional human readable description of the relationship - Primary Key for vamsas object referencing + Primary Key for vamsas object referencing + - List of one or more vamsas object references + List of one or more vamsas object + references @@ -137,7 +139,8 @@ - Direct associations between this node and any vamsas objects + Direct associations between this node and any vamsas + objects @@ -266,7 +269,8 @@ - + @@ -374,7 +378,7 @@ Did what - + When @@ -410,7 +414,11 @@ - A collection of sequences, alignments, trees and other things. + A collection of sequences, alignments, trees and other things. + TODO: Add a title field and properties for programs that can + present the user with different distinct datasets For the moment, the program + just presents them as a list and perhaps lets the user work out which dataset it + wants based on the alignments that it contains. (Dominik and Jim 7th June 2007) @@ -433,47 +441,56 @@ - - - From: Offset to first - position in dataset sequence record that - this database entry maps to To: Offset - to last position in dataset sequence - record that this database entry maps to - Start: Offset to first last position in - database entry that first (or offset) - position in sequence maps to End: Offset - to last position in database entry that - last (offset) position in sequence maps - to - - - - - - + + + + the local mapType maps from the parent + sequence coordinate frame to the reference + frame defined by the dbRef element. + The mapped mapType is the mapped range defined + on the dbRef element's reference frame. + Conventionally, the unit attribute defaults to 1, or + will be inferred from the local sequence's + dictionary type and any dictionary type associated + with the database being mapped to. + However, it may be used to avoid ambiguity. + + + + + + + + + - - + + - + - TODO Database Naming + TODO Database Naming Convention: either start using LSID (so change type to URI) or leave this as an uncontrolled/unspecified string ID - + - Version must be specified - + Version must be specified - - + - TODO: make some specification + TODO: make some specification of the database field from which this accessionId is taken from - should that be a special property of the dbRef object ? @@ -482,17 +499,17 @@ - Primary Key for vamsas object + Primary Key for vamsas object referencing - + - - explicitly named cross reference to other objects in the document. - + explicitly named cross reference to + other objects in the document. @@ -514,20 +531,33 @@ - - - - - - - - - - - - - - + + + A mapping between the specified 'local' and 'mapped' sequence coordinate frames. + The step size between each coordinate frame depends on the sequence + dictionary types, or alternatively specified in the optional unit + attribute on each range element. + + + + + + + + + Object on which the local + range is defined. + + + + + Object on which the mapped + range is defined. + + + + + @@ -554,7 +584,8 @@ - + This is annotation over the coordinate frame defined by all the columns in the alignment. @@ -566,21 +597,24 @@ - + - TODO: decide if this flag is + TODO: decide if this flag is redundant - when true it would suggest that the annotationElement values together form a graph - + - annotation is associated with a - range on a particular group of alignment sequences + annotation is associated with + a range on a particular group of alignment + sequences - + @@ -591,34 +625,38 @@ - - - - Annotate over + + + + Annotate over positions and regions of the ungapped sequence in the context of the alignment - - - - - - - - - - TODO: + + + + + + + + + + TODO: decide if this flag is redundant - when true it would suggest that the annotationElement values together form a graph - - - - - - + - Primary Key for vamsas object + Primary Key for vamsas object referencing - + - Dataset Sequence from which + Dataset Sequence from which this alignment sequence is taken from @@ -699,7 +738,8 @@ - + specifies the symbol dictionary for this glyph - eg utf8 (the default), aasecstr_3 or @@ -776,8 +816,10 @@ Data available to just a particular user - - + + @@ -865,42 +907,53 @@ - - - - Offset to first position in dataset sequence record that start - position on 'onto' maps to - - - - - Offset to last position in dataset sequence record that end - position on 'onto' maps to - - - - - Offset to first position in database entry that first (or offset) - position in sequence maps to - - - - - Offset to last position in database entry that last (offset) - position in sequence maps to - - + + + Two sets of ranges defined between objects - usually sequences, indicating which + regions on each are mapped. + + + + + + + + + + + + + + + + + + + + + + + + + number of dictionary symbol widths involved in each + mapped position on this sequence (for example, 3 for a dna sequence exon + region that is being mapped to a protein sequence). This is optional, + since the unit can be usually be inferred from the dictionary type of + each sequence involved in the mapping. + + + + + - - Contains lock information: - locktype:ApplicationHandle - locktype is 'local' or 'full' - A lock is only valid if the ApplicationHandle resolves to a living application in the vamsas session. - A local lock means that the application has locked changes to all local properties on the object. - A full lock means that the application has locked changes to all properties on the object, and any objects that it holds references to. - + Contains lock information: locktype:ApplicationHandle locktype is + 'local' or 'full' A lock is only valid if the ApplicationHandle resolves to a living + application in the vamsas session. A local lock means that the application has + locked changes to all local properties on the object. A full lock means that the + application has locked changes to all properties on the object, and any objects that + it holds references to. diff --git a/src/uk/ac/vamsas/objects/EmptyDocumentUpdater.java b/src/uk/ac/vamsas/objects/EmptyDocumentUpdater.java index b5a7168..fdcb297 100644 --- a/src/uk/ac/vamsas/objects/EmptyDocumentUpdater.java +++ b/src/uk/ac/vamsas/objects/EmptyDocumentUpdater.java @@ -40,7 +40,7 @@ public class EmptyDocumentUpdater implements IDocumentUpdater public void update(Map vobj) {} - public void update(MapList vobj) {} + // TODO: replace with mapRangeType handler public void update(MapList vobj) {} public void update(SequenceMapping vobj) {} diff --git a/src/uk/ac/vamsas/objects/IDocumentUpdater.java b/src/uk/ac/vamsas/objects/IDocumentUpdater.java index 579e4b5..bb8e2ae 100644 --- a/src/uk/ac/vamsas/objects/IDocumentUpdater.java +++ b/src/uk/ac/vamsas/objects/IDocumentUpdater.java @@ -40,7 +40,7 @@ public interface IDocumentUpdater public void update(Map vobj); - public void update(MapList vobj); + // TODO: replace with mapRangeType handler public void update(MapList vobj) {} public void update(SequenceMapping vobj); diff --git a/src/uk/ac/vamsas/objects/core/.castor.cdr b/src/uk/ac/vamsas/objects/core/.castor.cdr index e9fc12e..6847de4 100644 --- a/src/uk/ac/vamsas/objects/core/.castor.cdr +++ b/src/uk/ac/vamsas/objects/core/.castor.cdr @@ -1,4 +1,4 @@ -#Tue May 22 14:53:59 BST 2007 +#Thu Jun 21 15:41:21 BST 2007 uk.ac.vamsas.objects.core.Vref=uk.ac.vamsas.objects.core.descriptors.VrefDescriptor uk.ac.vamsas.objects.core.ReferenceType=uk.ac.vamsas.objects.core.descriptors.ReferenceTypeDescriptor uk.ac.vamsas.objects.core.SequenceType=uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor @@ -6,6 +6,7 @@ uk.ac.vamsas.objects.core.DbRef=uk.ac.vamsas.objects.core.descriptors.DbRefDescr 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.MapType=uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor uk.ac.vamsas.objects.core.Treenode=uk.ac.vamsas.objects.core.descriptors.TreenodeDescriptor 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 @@ -16,6 +17,7 @@ uk.ac.vamsas.objects.core.User=uk.ac.vamsas.objects.core.descriptors.UserDescrip 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.Vxref=uk.ac.vamsas.objects.core.descriptors.VxrefDescriptor +uk.ac.vamsas.objects.core.Local=uk.ac.vamsas.objects.core.descriptors.LocalDescriptor uk.ac.vamsas.objects.core.NodeType=uk.ac.vamsas.objects.core.descriptors.NodeTypeDescriptor uk.ac.vamsas.objects.core.SequenceMapping=uk.ac.vamsas.objects.core.descriptors.SequenceMappingDescriptor uk.ac.vamsas.objects.core.Newick=uk.ac.vamsas.objects.core.descriptors.NewickDescriptor @@ -31,6 +33,7 @@ uk.ac.vamsas.objects.core.MapList=uk.ac.vamsas.objects.core.descriptors.MapListD 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.MapRangeType=uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor uk.ac.vamsas.objects.core.Seg=uk.ac.vamsas.objects.core.descriptors.SegDescriptor uk.ac.vamsas.objects.core.Docxrefs=uk.ac.vamsas.objects.core.descriptors.DocxrefsDescriptor uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation=uk.ac.vamsas.objects.core.descriptors.AlignmentSequenceAnnotationDescriptor @@ -39,6 +42,7 @@ uk.ac.vamsas.objects.core.DataSetAnnotations=uk.ac.vamsas.objects.core.descripto uk.ac.vamsas.objects.core.Score=uk.ac.vamsas.objects.core.descriptors.ScoreDescriptor uk.ac.vamsas.objects.core.VamsasDocument=uk.ac.vamsas.objects.core.descriptors.VamsasDocumentDescriptor --=listing properties -- +uk.ac.vamsas.objects.core.Mapped=uk.ac.vamsas.objects.core.descriptors.MappedDescriptor 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 diff --git a/src/uk/ac/vamsas/objects/core/Alignment.java b/src/uk/ac/vamsas/objects/core/Alignment.java index 277be27..ffafc47 100644 --- a/src/uk/ac/vamsas/objects/core/Alignment.java +++ b/src/uk/ac/vamsas/objects/core/Alignment.java @@ -280,12 +280,29 @@ implements java.io.Serializable if (obj instanceof Alignment) { Alignment temp = (Alignment)obj; + boolean thcycle; + boolean tmcycle; if (this._gapChar != null) { if (temp._gapChar == null) return false; - else if (!(this._gapChar.equals(temp._gapChar))) - return false; - } - else if (temp._gapChar != null) + if (this._gapChar != temp._gapChar) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._gapChar); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._gapChar); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar); }; + return false; + } + if (!thcycle) { + if (!this._gapChar.equals(temp._gapChar)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar); + } + } + } else if (temp._gapChar != null) return false; if (this._aligned != temp._aligned) return false; @@ -293,52 +310,157 @@ implements java.io.Serializable return false; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._modifiable != null) { if (temp._modifiable == null) return false; - else if (!(this._modifiable.equals(temp._modifiable))) - return false; - } - else if (temp._modifiable != null) + if (this._modifiable != temp._modifiable) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); }; + return false; + } + if (!thcycle) { + if (!this._modifiable.equals(temp._modifiable)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + } + } + } else if (temp._modifiable != null) return false; if (this._alignmentAnnotationList != null) { if (temp._alignmentAnnotationList == null) return false; - else if (!(this._alignmentAnnotationList.equals(temp._alignmentAnnotationList))) - return false; - } - else if (temp._alignmentAnnotationList != null) + if (this._alignmentAnnotationList != temp._alignmentAnnotationList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentAnnotationList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentAnnotationList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList); }; + return false; + } + if (!thcycle) { + if (!this._alignmentAnnotationList.equals(temp._alignmentAnnotationList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList); + } + } + } else if (temp._alignmentAnnotationList != null) return false; if (this._treeList != null) { if (temp._treeList == null) return false; - else if (!(this._treeList.equals(temp._treeList))) - return false; - } - else if (temp._treeList != null) + if (this._treeList != temp._treeList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); }; + return false; + } + if (!thcycle) { + if (!this._treeList.equals(temp._treeList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); + } + } + } else if (temp._treeList != null) return false; if (this._alignmentSequenceList != null) { if (temp._alignmentSequenceList == null) return false; - else if (!(this._alignmentSequenceList.equals(temp._alignmentSequenceList))) - return false; - } - else if (temp._alignmentSequenceList != null) + if (this._alignmentSequenceList != temp._alignmentSequenceList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentSequenceList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentSequenceList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList); }; + return false; + } + if (!thcycle) { + if (!this._alignmentSequenceList.equals(temp._alignmentSequenceList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList); + } + } + } else if (temp._alignmentSequenceList != null) return false; if (this._propertyList != null) { if (temp._propertyList == null) return false; - else if (!(this._propertyList.equals(temp._propertyList))) - return false; - } - else if (temp._propertyList != null) + if (this._propertyList != temp._propertyList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); }; + return false; + } + if (!thcycle) { + if (!this._propertyList.equals(temp._propertyList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + } + } + } else if (temp._propertyList != null) return false; if (this._provenance != null) { if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) + if (this._provenance != temp._provenance) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); }; + return false; + } + if (!thcycle) { + if (!this._provenance.equals(temp._provenance)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + } + } + } else if (temp._provenance != null) return false; return true; } @@ -652,30 +774,46 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_gapChar != null) { + if (_gapChar != null + && !org.castor.util.CycleBreaker.startingToCycle(_gapChar)) { result = 37 * result + _gapChar.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_gapChar); } result = 37 * result + (_aligned?0:1); - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_modifiable != null) { + if (_modifiable != null + && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) { result = 37 * result + _modifiable.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable); } - if (_alignmentAnnotationList != null) { + if (_alignmentAnnotationList != null + && !org.castor.util.CycleBreaker.startingToCycle(_alignmentAnnotationList)) { result = 37 * result + _alignmentAnnotationList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentAnnotationList); } - if (_treeList != null) { + if (_treeList != null + && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) { result = 37 * result + _treeList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_treeList); } - if (_alignmentSequenceList != null) { + if (_alignmentSequenceList != null + && !org.castor.util.CycleBreaker.startingToCycle(_alignmentSequenceList)) { result = 37 * result + _alignmentSequenceList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentSequenceList); } - if (_propertyList != null) { + if (_propertyList != null + && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) { result = 37 * result + _propertyList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList); } - if (_provenance != null) { + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); } return result; diff --git a/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java b/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java index 0ffea12..b6c544c 100644 --- a/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java +++ b/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java @@ -44,8 +44,9 @@ implements java.io.Serializable private boolean _has_graph; /** - * annotation is associated with a - * range on a particular group of alignment sequences + * annotation is associated with + * a range on a particular group of alignment + * sequences */ private java.util.Vector _seqrefs; @@ -131,23 +132,55 @@ implements java.io.Serializable if (obj instanceof AlignmentAnnotation) { AlignmentAnnotation temp = (AlignmentAnnotation)obj; + boolean thcycle; + boolean tmcycle; if (this._graph != temp._graph) return false; if (this._has_graph != temp._has_graph) return false; if (this._seqrefs != null) { if (temp._seqrefs == null) return false; - else if (!(this._seqrefs.equals(temp._seqrefs))) - return false; - } - else if (temp._seqrefs != null) + if (this._seqrefs != temp._seqrefs) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._seqrefs); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._seqrefs); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._seqrefs); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqrefs); }; + return false; + } + if (!thcycle) { + if (!this._seqrefs.equals(temp._seqrefs)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._seqrefs); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqrefs); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._seqrefs); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqrefs); + } + } + } else if (temp._seqrefs != null) return false; if (this._provenance != null) { if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) + if (this._provenance != temp._provenance) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); }; + return false; + } + if (!thcycle) { + if (!this._provenance.equals(temp._provenance)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + } + } + } else if (temp._provenance != null) return false; return true; } @@ -258,11 +291,15 @@ implements java.io.Serializable long tmp; result = 37 * result + (_graph?0:1); - if (_seqrefs != null) { + if (_seqrefs != null + && !org.castor.util.CycleBreaker.startingToCycle(_seqrefs)) { result = 37 * result + _seqrefs.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_seqrefs); } - if (_provenance != null) { + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); } return result; diff --git a/src/uk/ac/vamsas/objects/core/AlignmentSequence.java b/src/uk/ac/vamsas/objects/core/AlignmentSequence.java index a476961..8192795 100644 --- a/src/uk/ac/vamsas/objects/core/AlignmentSequence.java +++ b/src/uk/ac/vamsas/objects/core/AlignmentSequence.java @@ -117,26 +117,73 @@ implements java.io.Serializable if (obj instanceof AlignmentSequence) { AlignmentSequence temp = (AlignmentSequence)obj; + boolean thcycle; + boolean tmcycle; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._refid != null) { if (temp._refid == null) return false; - else if (!(this._refid.equals(temp._refid))) - return false; - } - else if (temp._refid != null) + if (this._refid != temp._refid) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._refid); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._refid); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._refid); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._refid); }; + return false; + } + if (!thcycle) { + if (!this._refid.equals(temp._refid)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._refid); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._refid); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._refid); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._refid); + } + } + } else if (temp._refid != null) return false; if (this._alignmentSequenceAnnotationList != null) { if (temp._alignmentSequenceAnnotationList == null) return false; - else if (!(this._alignmentSequenceAnnotationList.equals(temp._alignmentSequenceAnnotationList))) - return false; - } - else if (temp._alignmentSequenceAnnotationList != null) + if (this._alignmentSequenceAnnotationList != temp._alignmentSequenceAnnotationList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentSequenceAnnotationList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentSequenceAnnotationList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceAnnotationList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceAnnotationList); }; + return false; + } + if (!thcycle) { + if (!this._alignmentSequenceAnnotationList.equals(temp._alignmentSequenceAnnotationList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceAnnotationList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceAnnotationList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceAnnotationList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceAnnotationList); + } + } + } else if (temp._alignmentSequenceAnnotationList != null) return false; return true; } @@ -240,14 +287,20 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_refid != null) { + if (_refid != null + && !org.castor.util.CycleBreaker.startingToCycle(_refid)) { result = 37 * result + _refid.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_refid); } - if (_alignmentSequenceAnnotationList != null) { + if (_alignmentSequenceAnnotationList != null + && !org.castor.util.CycleBreaker.startingToCycle(_alignmentSequenceAnnotationList)) { result = 37 * result + _alignmentSequenceAnnotationList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentSequenceAnnotationList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java index 64417fe..7494819 100644 --- a/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java +++ b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java @@ -87,16 +87,33 @@ implements java.io.Serializable if (obj instanceof AlignmentSequenceAnnotation) { AlignmentSequenceAnnotation temp = (AlignmentSequenceAnnotation)obj; + boolean thcycle; + boolean tmcycle; if (this._graph != temp._graph) return false; if (this._has_graph != temp._has_graph) return false; if (this._provenance != null) { if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) + if (this._provenance != temp._provenance) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); }; + return false; + } + if (!thcycle) { + if (!this._provenance.equals(temp._provenance)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + } + } + } else if (temp._provenance != null) return false; return true; } @@ -154,8 +171,10 @@ implements java.io.Serializable long tmp; result = 37 * result + (_graph?0:1); - if (_provenance != null) { + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); } return result; diff --git a/src/uk/ac/vamsas/objects/core/AnnotationElement.java b/src/uk/ac/vamsas/objects/core/AnnotationElement.java index a53f1ee..05aec77 100644 --- a/src/uk/ac/vamsas/objects/core/AnnotationElement.java +++ b/src/uk/ac/vamsas/objects/core/AnnotationElement.java @@ -201,6 +201,8 @@ implements java.io.Serializable if (obj instanceof AnnotationElement) { AnnotationElement temp = (AnnotationElement)obj; + boolean thcycle; + boolean tmcycle; if (this._position != temp._position) return false; if (this._has_position != temp._has_position) @@ -211,31 +213,91 @@ implements java.io.Serializable return false; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._description != null) { if (temp._description == null) return false; - else if (!(this._description.equals(temp._description))) - return false; - } - else if (temp._description != null) + if (this._description != temp._description) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._description); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._description); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._description); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); }; + return false; + } + if (!thcycle) { + if (!this._description.equals(temp._description)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._description); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._description); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); + } + } + } else if (temp._description != null) return false; if (this._glyphList != null) { if (temp._glyphList == null) return false; - else if (!(this._glyphList.equals(temp._glyphList))) - return false; - } - else if (temp._glyphList != null) + if (this._glyphList != temp._glyphList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._glyphList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._glyphList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._glyphList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._glyphList); }; + return false; + } + if (!thcycle) { + if (!this._glyphList.equals(temp._glyphList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._glyphList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._glyphList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._glyphList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._glyphList); + } + } + } else if (temp._glyphList != null) return false; if (this._valueList != null) { if (temp._valueList == null) return false; - else if (!(this._valueList.equals(temp._valueList))) - return false; - } - else if (temp._valueList != null) + if (this._valueList != temp._valueList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._valueList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._valueList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._valueList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._valueList); }; + return false; + } + if (!thcycle) { + if (!this._valueList.equals(temp._valueList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._valueList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._valueList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._valueList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._valueList); + } + } + } else if (temp._valueList != null) return false; return true; } @@ -442,17 +504,25 @@ implements java.io.Serializable long tmp; result = 37 * result + (int)(_position^(_position>>>32)); result = 37 * result + (_after?0:1); - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_description != null) { + if (_description != null + && !org.castor.util.CycleBreaker.startingToCycle(_description)) { result = 37 * result + _description.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_description); } - if (_glyphList != null) { + if (_glyphList != null + && !org.castor.util.CycleBreaker.startingToCycle(_glyphList)) { result = 37 * result + _glyphList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_glyphList); } - if (_valueList != null) { + if (_valueList != null + && !org.castor.util.CycleBreaker.startingToCycle(_valueList)) { result = 37 * result + _valueList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_valueList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/AppData.java b/src/uk/ac/vamsas/objects/core/AppData.java index 90235c3..d54bca7 100644 --- a/src/uk/ac/vamsas/objects/core/AppData.java +++ b/src/uk/ac/vamsas/objects/core/AppData.java @@ -74,26 +74,73 @@ implements java.io.Serializable if (obj instanceof AppData) { AppData temp = (AppData)obj; + boolean thcycle; + boolean tmcycle; if (this._choiceValue != null) { if (temp._choiceValue == null) return false; - else if (!(this._choiceValue.equals(temp._choiceValue))) - return false; - } - else if (temp._choiceValue != null) + if (this._choiceValue != temp._choiceValue) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._choiceValue); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._choiceValue); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); }; + return false; + } + if (!thcycle) { + if (!this._choiceValue.equals(temp._choiceValue)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); + } + } + } else if (temp._choiceValue != null) return false; if (this._data != null) { if (temp._data == null) return false; - else if (!(java.util.Arrays.equals(this._data, temp._data))) - return false; - } - else if (temp._data != null) + if (this._data != temp._data) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._data); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._data); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._data); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._data); }; + return false; + } + if (!thcycle) { + if (!java.util.Arrays.equals(this._data, temp._data)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._data); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._data); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._data); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._data); + } + } + } else if (temp._data != null) return false; if (this._dataReference != null) { if (temp._dataReference == null) return false; - else if (!(this._dataReference.equals(temp._dataReference))) - return false; - } - else if (temp._dataReference != null) + if (this._dataReference != temp._dataReference) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataReference); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataReference); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference); }; + return false; + } + if (!thcycle) { + if (!this._dataReference.equals(temp._dataReference)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference); + } + } + } else if (temp._dataReference != null) return false; return true; } @@ -145,14 +192,20 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_choiceValue != null) { + if (_choiceValue != null + && !org.castor.util.CycleBreaker.startingToCycle(_choiceValue)) { result = 37 * result + _choiceValue.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_choiceValue); } - if (_data != null) { + if (_data != null + && !org.castor.util.CycleBreaker.startingToCycle(_data)) { result = 37 * result + _data.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_data); } - if (_dataReference != null) { + if (_dataReference != null + && !org.castor.util.CycleBreaker.startingToCycle(_dataReference)) { result = 37 * result + _dataReference.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_dataReference); } return result; diff --git a/src/uk/ac/vamsas/objects/core/ApplicationData.java b/src/uk/ac/vamsas/objects/core/ApplicationData.java index ff0b5d0..ea61bca 100644 --- a/src/uk/ac/vamsas/objects/core/ApplicationData.java +++ b/src/uk/ac/vamsas/objects/core/ApplicationData.java @@ -165,40 +165,117 @@ implements java.io.Serializable if (obj instanceof ApplicationData) { ApplicationData temp = (ApplicationData)obj; + boolean thcycle; + boolean tmcycle; if (this._version != null) { if (temp._version == null) return false; - else if (!(this._version.equals(temp._version))) - return false; - } - else if (temp._version != null) + if (this._version != temp._version) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._version); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._version); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._version); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); }; + return false; + } + if (!thcycle) { + if (!this._version.equals(temp._version)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._version); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._version); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); + } + } + } else if (temp._version != null) return false; if (this._name != null) { if (temp._name == null) return false; - else if (!(this._name.equals(temp._name))) - return false; - } - else if (temp._name != null) + if (this._name != temp._name) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); }; + return false; + } + if (!thcycle) { + if (!this._name.equals(temp._name)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + } + } + } else if (temp._name != null) return false; if (this._userList != null) { if (temp._userList == null) return false; - else if (!(this._userList.equals(temp._userList))) - return false; - } - else if (temp._userList != null) + if (this._userList != temp._userList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._userList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._userList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._userList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._userList); }; + return false; + } + if (!thcycle) { + if (!this._userList.equals(temp._userList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._userList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._userList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._userList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._userList); + } + } + } else if (temp._userList != null) return false; if (this._common != null) { if (temp._common == null) return false; - else if (!(this._common.equals(temp._common))) - return false; - } - else if (temp._common != null) + if (this._common != temp._common) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._common); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._common); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._common); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._common); }; + return false; + } + if (!thcycle) { + if (!this._common.equals(temp._common)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._common); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._common); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._common); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._common); + } + } + } else if (temp._common != null) return false; if (this._instanceList != null) { if (temp._instanceList == null) return false; - else if (!(this._instanceList.equals(temp._instanceList))) - return false; - } - else if (temp._instanceList != null) + if (this._instanceList != temp._instanceList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._instanceList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._instanceList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._instanceList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._instanceList); }; + return false; + } + if (!thcycle) { + if (!this._instanceList.equals(temp._instanceList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._instanceList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._instanceList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._instanceList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._instanceList); + } + } + } else if (temp._instanceList != null) return false; return true; } @@ -366,20 +443,30 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_version != null) { + if (_version != null + && !org.castor.util.CycleBreaker.startingToCycle(_version)) { result = 37 * result + _version.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_version); } - if (_name != null) { + if (_name != null + && !org.castor.util.CycleBreaker.startingToCycle(_name)) { result = 37 * result + _name.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_name); } - if (_userList != null) { + if (_userList != null + && !org.castor.util.CycleBreaker.startingToCycle(_userList)) { result = 37 * result + _userList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_userList); } - if (_common != null) { + if (_common != null + && !org.castor.util.CycleBreaker.startingToCycle(_common)) { result = 37 * result + _common.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_common); } - if (_instanceList != null) { + if (_instanceList != null + && !org.castor.util.CycleBreaker.startingToCycle(_instanceList)) { result = 37 * result + _instanceList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_instanceList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Attachment.java b/src/uk/ac/vamsas/objects/core/Attachment.java index 7b6fcc4..b7c741f 100644 --- a/src/uk/ac/vamsas/objects/core/Attachment.java +++ b/src/uk/ac/vamsas/objects/core/Attachment.java @@ -95,30 +95,77 @@ implements java.io.Serializable if (obj instanceof Attachment) { Attachment temp = (Attachment)obj; + boolean thcycle; + boolean tmcycle; if (this._compressed != temp._compressed) return false; if (this._has_compressed != temp._has_compressed) return false; if (this._type != null) { if (temp._type == null) return false; - else if (!(this._type.equals(temp._type))) - return false; - } - else if (temp._type != null) + if (this._type != temp._type) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); }; + return false; + } + if (!thcycle) { + if (!this._type.equals(temp._type)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + } + } + } else if (temp._type != null) return false; if (this._objectref != null) { if (temp._objectref == null) return false; - else if (!(this._objectref.equals(temp._objectref))) - return false; - } - else if (temp._objectref != null) + if (this._objectref != temp._objectref) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._objectref); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._objectref); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._objectref); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._objectref); }; + return false; + } + if (!thcycle) { + if (!this._objectref.equals(temp._objectref)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._objectref); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._objectref); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._objectref); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._objectref); + } + } + } else if (temp._objectref != null) return false; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; return true; } @@ -201,14 +248,20 @@ implements java.io.Serializable long tmp; result = 37 * result + (_compressed?0:1); - if (_type != null) { + if (_type != null + && !org.castor.util.CycleBreaker.startingToCycle(_type)) { result = 37 * result + _type.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_type); } - if (_objectref != null) { + if (_objectref != null + && !org.castor.util.CycleBreaker.startingToCycle(_objectref)) { result = 37 * result + _objectref.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_objectref); } - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } return result; diff --git a/src/uk/ac/vamsas/objects/core/DataSet.java b/src/uk/ac/vamsas/objects/core/DataSet.java index cdc1dc1..ae4506b 100644 --- a/src/uk/ac/vamsas/objects/core/DataSet.java +++ b/src/uk/ac/vamsas/objects/core/DataSet.java @@ -294,54 +294,161 @@ implements java.io.Serializable if (obj instanceof DataSet) { DataSet temp = (DataSet)obj; + boolean thcycle; + boolean tmcycle; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._sequenceList != null) { if (temp._sequenceList == null) return false; - else if (!(this._sequenceList.equals(temp._sequenceList))) - return false; - } - else if (temp._sequenceList != null) + if (this._sequenceList != temp._sequenceList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequenceList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequenceList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList); }; + return false; + } + if (!thcycle) { + if (!this._sequenceList.equals(temp._sequenceList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList); + } + } + } else if (temp._sequenceList != null) return false; if (this._sequenceMappingList != null) { if (temp._sequenceMappingList == null) return false; - else if (!(this._sequenceMappingList.equals(temp._sequenceMappingList))) - return false; - } - else if (temp._sequenceMappingList != null) + if (this._sequenceMappingList != temp._sequenceMappingList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequenceMappingList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequenceMappingList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList); }; + return false; + } + if (!thcycle) { + if (!this._sequenceMappingList.equals(temp._sequenceMappingList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList); + } + } + } else if (temp._sequenceMappingList != null) return false; if (this._dataSetAnnotationsList != null) { if (temp._dataSetAnnotationsList == null) return false; - else if (!(this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList))) - return false; - } - else if (temp._dataSetAnnotationsList != null) + if (this._dataSetAnnotationsList != temp._dataSetAnnotationsList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataSetAnnotationsList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataSetAnnotationsList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList); }; + return false; + } + if (!thcycle) { + if (!this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList); + } + } + } else if (temp._dataSetAnnotationsList != null) return false; if (this._alignmentList != null) { if (temp._alignmentList == null) return false; - else if (!(this._alignmentList.equals(temp._alignmentList))) - return false; - } - else if (temp._alignmentList != null) + if (this._alignmentList != temp._alignmentList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList); }; + return false; + } + if (!thcycle) { + if (!this._alignmentList.equals(temp._alignmentList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList); + } + } + } else if (temp._alignmentList != null) return false; if (this._treeList != null) { if (temp._treeList == null) return false; - else if (!(this._treeList.equals(temp._treeList))) - return false; - } - else if (temp._treeList != null) + if (this._treeList != temp._treeList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); }; + return false; + } + if (!thcycle) { + if (!this._treeList.equals(temp._treeList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); + } + } + } else if (temp._treeList != null) return false; if (this._provenance != null) { if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) + if (this._provenance != temp._provenance) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); }; + return false; + } + if (!thcycle) { + if (!this._provenance.equals(temp._provenance)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + } + } + } else if (temp._provenance != null) return false; return true; } @@ -671,26 +778,40 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_sequenceList != null) { + if (_sequenceList != null + && !org.castor.util.CycleBreaker.startingToCycle(_sequenceList)) { result = 37 * result + _sequenceList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceList); } - if (_sequenceMappingList != null) { + if (_sequenceMappingList != null + && !org.castor.util.CycleBreaker.startingToCycle(_sequenceMappingList)) { result = 37 * result + _sequenceMappingList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceMappingList); } - if (_dataSetAnnotationsList != null) { + if (_dataSetAnnotationsList != null + && !org.castor.util.CycleBreaker.startingToCycle(_dataSetAnnotationsList)) { result = 37 * result + _dataSetAnnotationsList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_dataSetAnnotationsList); } - if (_alignmentList != null) { + if (_alignmentList != null + && !org.castor.util.CycleBreaker.startingToCycle(_alignmentList)) { result = 37 * result + _alignmentList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentList); } - if (_treeList != null) { + if (_treeList != null + && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) { result = 37 * result + _treeList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_treeList); } - if (_provenance != null) { + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); } return result; diff --git a/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java index 39aa939..861f0fe 100644 --- a/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java +++ b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java @@ -109,19 +109,51 @@ implements java.io.Serializable if (obj instanceof DataSetAnnotations) { DataSetAnnotations temp = (DataSetAnnotations)obj; + boolean thcycle; + boolean tmcycle; if (this._seqRef != null) { if (temp._seqRef == null) return false; - else if (!(this._seqRef.equals(temp._seqRef))) - return false; - } - else if (temp._seqRef != null) + if (this._seqRef != temp._seqRef) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._seqRef); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._seqRef); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef); }; + return false; + } + if (!thcycle) { + if (!this._seqRef.equals(temp._seqRef)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef); + } + } + } else if (temp._seqRef != null) return false; if (this._provenance != null) { if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) + if (this._provenance != temp._provenance) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); }; + return false; + } + if (!thcycle) { + if (!this._provenance.equals(temp._provenance)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + } + } + } else if (temp._provenance != null) return false; return true; } @@ -207,11 +239,15 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_seqRef != null) { + if (_seqRef != null + && !org.castor.util.CycleBreaker.startingToCycle(_seqRef)) { result = 37 * result + _seqRef.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_seqRef); } - if (_provenance != null) { + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); } return result; diff --git a/src/uk/ac/vamsas/objects/core/DbRef.java b/src/uk/ac/vamsas/objects/core/DbRef.java index a228591..54dfa2c 100644 --- a/src/uk/ac/vamsas/objects/core/DbRef.java +++ b/src/uk/ac/vamsas/objects/core/DbRef.java @@ -61,19 +61,19 @@ implements java.io.Serializable private java.lang.String _id; /** - * From: Offset to first - * position in dataset sequence record that - * this database entry maps to To: Offset - * to last position in dataset sequence - * record that this database entry maps to - * Start: Offset to first last position in - * database entry that first (or offset) - * position in sequence maps to End: Offset - * to last position in database entry that - * last (offset) position in sequence maps - * to + * the local mapType maps from the parent + * sequence coordinate frame to the reference + * frame defined by the dbRef element. + * The mapped mapType is the mapped range defined + * on the dbRef element's reference frame. + * Conventionally, the unit attribute defaults to 1, or + * will be inferred from the local sequence's + * dictionary type and any dictionary type associated + * with the database being mapped to. + * However, it may be used to avoid ambiguity. + * */ - private java.util.Vector _mapList; + private uk.ac.vamsas.objects.core.Map _map; /** * Field _linkList. @@ -92,7 +92,6 @@ implements java.io.Serializable public DbRef() { super(); - this._mapList = new java.util.Vector(); this._linkList = new java.util.Vector(); this._propertyList = new java.util.Vector(); } @@ -133,34 +132,6 @@ implements java.io.Serializable /** * * - * @param vMap - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addMap( - final uk.ac.vamsas.objects.core.Map vMap) - throws java.lang.IndexOutOfBoundsException { - this._mapList.addElement(vMap); - } - - /** - * - * - * @param index - * @param vMap - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addMap( - final int index, - final uk.ac.vamsas.objects.core.Map vMap) - throws java.lang.IndexOutOfBoundsException { - this._mapList.add(index, vMap); - } - - /** - * - * * @param vProperty * @throws java.lang.IndexOutOfBoundsException if the index * given is outside the bounds of the collection @@ -198,17 +169,6 @@ implements java.io.Serializable } /** - * Method enumerateMap. - * - * @return an Enumeration over all - * uk.ac.vamsas.objects.core.Map elements - */ - public java.util.Enumeration enumerateMap( - ) { - return this._mapList.elements(); - } - - /** * Method enumerateProperty. * * @return an Enumeration over all @@ -236,54 +196,161 @@ implements java.io.Serializable if (obj instanceof DbRef) { DbRef temp = (DbRef)obj; + boolean thcycle; + boolean tmcycle; if (this._source != null) { if (temp._source == null) return false; - else if (!(this._source.equals(temp._source))) - return false; - } - else if (temp._source != null) + if (this._source != temp._source) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._source); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._source); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._source); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._source); }; + return false; + } + if (!thcycle) { + if (!this._source.equals(temp._source)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._source); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._source); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._source); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._source); + } + } + } else if (temp._source != null) return false; if (this._version != null) { if (temp._version == null) return false; - else if (!(this._version.equals(temp._version))) - return false; - } - else if (temp._version != null) + if (this._version != temp._version) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._version); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._version); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._version); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); }; + return false; + } + if (!thcycle) { + if (!this._version.equals(temp._version)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._version); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._version); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); + } + } + } else if (temp._version != null) return false; if (this._accessionId != null) { if (temp._accessionId == null) return false; - else if (!(this._accessionId.equals(temp._accessionId))) - return false; - } - else if (temp._accessionId != null) + if (this._accessionId != temp._accessionId) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._accessionId); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._accessionId); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId); }; + return false; + } + if (!thcycle) { + if (!this._accessionId.equals(temp._accessionId)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId); + } + } + } else if (temp._accessionId != null) return false; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; - if (this._mapList != null) { - if (temp._mapList == null) return false; - else if (!(this._mapList.equals(temp._mapList))) - return false; - } - else if (temp._mapList != null) + if (this._map != null) { + if (temp._map == null) return false; + if (this._map != temp._map) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._map); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._map); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._map); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._map); }; + return false; + } + if (!thcycle) { + if (!this._map.equals(temp._map)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._map); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._map); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._map); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._map); + } + } + } else if (temp._map != null) return false; if (this._linkList != null) { if (temp._linkList == null) return false; - else if (!(this._linkList.equals(temp._linkList))) - return false; - } - else if (temp._linkList != null) + if (this._linkList != temp._linkList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._linkList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._linkList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); }; + return false; + } + if (!thcycle) { + if (!this._linkList.equals(temp._linkList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); + } + } + } else if (temp._linkList != null) return false; if (this._propertyList != null) { if (temp._propertyList == null) return false; - else if (!(this._propertyList.equals(temp._propertyList))) - return false; - } - else if (temp._propertyList != null) + if (this._propertyList != temp._propertyList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); }; + return false; + } + if (!thcycle) { + if (!this._propertyList.equals(temp._propertyList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + } + } + } else if (temp._propertyList != null) return false; return true; } @@ -376,60 +443,25 @@ implements java.io.Serializable } /** - * Method getMap. + * Returns the value of field 'map'. The field 'map' has the + * following description: the local mapType maps from the + * parent + * sequence coordinate frame to the reference + * frame defined by the dbRef element. + * The mapped mapType is the mapped range defined + * on the dbRef element's reference frame. + * Conventionally, the unit attribute defaults to 1, or + * will be inferred from the local sequence's + * dictionary type and any dictionary type associated + * with the database being mapped to. + * However, it may be used to avoid ambiguity. + * * - * @param index - * @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 + * @return the value of field 'Map'. */ 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.get(index); - } - - /** - * 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 this collection as an Array - */ - 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 getMapAsReference.Returns a reference to '_mapList'. - * No type checking is performed on any modifications to the - * Vector. - * - * @return a reference to the Vector backing this class - */ - public java.util.Vector getMapAsReference( - ) { - return this._mapList; - } - - /** - * Method getMapCount. - * - * @return the size of this collection - */ - public int getMapCount( ) { - return this._mapList.size(); + return this._map; } /** @@ -529,26 +561,40 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_source != null) { + if (_source != null + && !org.castor.util.CycleBreaker.startingToCycle(_source)) { result = 37 * result + _source.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_source); } - if (_version != null) { + if (_version != null + && !org.castor.util.CycleBreaker.startingToCycle(_version)) { result = 37 * result + _version.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_version); } - if (_accessionId != null) { + if (_accessionId != null + && !org.castor.util.CycleBreaker.startingToCycle(_accessionId)) { result = 37 * result + _accessionId.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_accessionId); } - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_mapList != null) { - result = 37 * result + _mapList.hashCode(); + if (_map != null + && !org.castor.util.CycleBreaker.startingToCycle(_map)) { + result = 37 * result + _map.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_map); } - if (_linkList != null) { + if (_linkList != null + && !org.castor.util.CycleBreaker.startingToCycle(_linkList)) { result = 37 * result + _linkList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_linkList); } - if (_propertyList != null) { + if (_propertyList != null + && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) { result = 37 * result + _propertyList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList); } return result; @@ -610,13 +656,6 @@ implements java.io.Serializable /** */ - public void removeAllMap( - ) { - this._mapList.clear(); - } - - /** - */ public void removeAllProperty( ) { this._propertyList.clear(); @@ -647,30 +686,6 @@ implements java.io.Serializable } /** - * 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 the element removed from the collection - */ - 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; - } - - /** * Method removeProperty. * * @param vProperty @@ -784,64 +799,25 @@ implements java.io.Serializable } /** + * Sets the value of field 'map'. The field 'map' has the + * following description: the local mapType maps from the + * parent + * sequence coordinate frame to the reference + * frame defined by the dbRef element. + * The mapped mapType is the mapped range defined + * on the dbRef element's reference frame. + * Conventionally, the unit attribute defaults to 1, or + * will be inferred from the local sequence's + * dictionary type and any dictionary type associated + * with the database being mapped to. + * However, it may be used to avoid ambiguity. + * * - * - * @param index - * @param vMap - * @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) + "]"); - } - - this._mapList.set(index, vMap); - } - - /** - * - * - * @param vMapArray - */ - public void setMap( - final uk.ac.vamsas.objects.core.Map[] vMapArray) { - //-- copy array - _mapList.clear(); - - for (int i = 0; i < vMapArray.length; i++) { - this._mapList.add(vMapArray[i]); - } - } - - /** - * Sets the value of '_mapList' by copying the given Vector. - * All elements will be checked for type safety. - * - * @param vMapList the Vector to copy. + * @param map the value of field 'map'. */ 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; + final uk.ac.vamsas.objects.core.Map map) { + this._map = map; } /** diff --git a/src/uk/ac/vamsas/objects/core/Entry.java b/src/uk/ac/vamsas/objects/core/Entry.java index 8cdd864..3415765 100644 --- a/src/uk/ac/vamsas/objects/core/Entry.java +++ b/src/uk/ac/vamsas/objects/core/Entry.java @@ -221,61 +221,183 @@ implements java.io.Serializable if (obj instanceof Entry) { Entry temp = (Entry)obj; + boolean thcycle; + boolean tmcycle; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._user != null) { if (temp._user == null) return false; - else if (!(this._user.equals(temp._user))) - return false; - } - else if (temp._user != null) + if (this._user != temp._user) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._user); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._user); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._user); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._user); }; + return false; + } + if (!thcycle) { + if (!this._user.equals(temp._user)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._user); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._user); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._user); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._user); + } + } + } else if (temp._user != null) return false; if (this._app != null) { if (temp._app == null) return false; - else if (!(this._app.equals(temp._app))) - return false; - } - else if (temp._app != null) + if (this._app != temp._app) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._app); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._app); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._app); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._app); }; + return false; + } + if (!thcycle) { + if (!this._app.equals(temp._app)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._app); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._app); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._app); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._app); + } + } + } else if (temp._app != null) return false; if (this._action != null) { if (temp._action == null) return false; - else if (!(this._action.equals(temp._action))) - return false; - } - else if (temp._action != null) + if (this._action != temp._action) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._action); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._action); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._action); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._action); }; + return false; + } + if (!thcycle) { + if (!this._action.equals(temp._action)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._action); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._action); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._action); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._action); + } + } + } else if (temp._action != null) return false; if (this._date != null) { if (temp._date == null) return false; - else if (!(this._date.equals(temp._date))) - return false; - } - else if (temp._date != null) + if (this._date != temp._date) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._date); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._date); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._date); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._date); }; + return false; + } + if (!thcycle) { + if (!this._date.equals(temp._date)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._date); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._date); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._date); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._date); + } + } + } else if (temp._date != null) return false; if (this._propertyList != null) { if (temp._propertyList == null) return false; - else if (!(this._propertyList.equals(temp._propertyList))) - return false; - } - else if (temp._propertyList != null) + if (this._propertyList != temp._propertyList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); }; + return false; + } + if (!thcycle) { + if (!this._propertyList.equals(temp._propertyList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + } + } + } else if (temp._propertyList != null) return false; if (this._paramList != null) { if (temp._paramList == null) return false; - else if (!(this._paramList.equals(temp._paramList))) - return false; - } - else if (temp._paramList != null) + if (this._paramList != temp._paramList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._paramList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._paramList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList); }; + return false; + } + if (!thcycle) { + if (!this._paramList.equals(temp._paramList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList); + } + } + } else if (temp._paramList != null) return false; if (this._inputList != null) { if (temp._inputList == null) return false; - else if (!(this._inputList.equals(temp._inputList))) - return false; - } - else if (temp._inputList != null) + if (this._inputList != temp._inputList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._inputList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._inputList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList); }; + return false; + } + if (!thcycle) { + if (!this._inputList.equals(temp._inputList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList); + } + } + } else if (temp._inputList != null) return false; return true; } @@ -523,29 +645,45 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_user != null) { + if (_user != null + && !org.castor.util.CycleBreaker.startingToCycle(_user)) { result = 37 * result + _user.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_user); } - if (_app != null) { + if (_app != null + && !org.castor.util.CycleBreaker.startingToCycle(_app)) { result = 37 * result + _app.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_app); } - if (_action != null) { + if (_action != null + && !org.castor.util.CycleBreaker.startingToCycle(_action)) { result = 37 * result + _action.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_action); } - if (_date != null) { + if (_date != null + && !org.castor.util.CycleBreaker.startingToCycle(_date)) { result = 37 * result + _date.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_date); } - if (_propertyList != null) { + if (_propertyList != null + && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) { result = 37 * result + _propertyList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList); } - if (_paramList != null) { + if (_paramList != null + && !org.castor.util.CycleBreaker.startingToCycle(_paramList)) { result = 37 * result + _paramList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_paramList); } - if (_inputList != null) { + if (_inputList != null + && !org.castor.util.CycleBreaker.startingToCycle(_inputList)) { result = 37 * result + _inputList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_inputList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Glyph.java b/src/uk/ac/vamsas/objects/core/Glyph.java index ae91252..e96b4fd 100644 --- a/src/uk/ac/vamsas/objects/core/Glyph.java +++ b/src/uk/ac/vamsas/objects/core/Glyph.java @@ -76,19 +76,51 @@ implements java.io.Serializable if (obj instanceof Glyph) { Glyph temp = (Glyph)obj; + boolean thcycle; + boolean tmcycle; if (this._content != null) { if (temp._content == null) return false; - else if (!(this._content.equals(temp._content))) - return false; - } - else if (temp._content != null) + if (this._content != temp._content) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); }; + return false; + } + if (!thcycle) { + if (!this._content.equals(temp._content)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + } + } + } else if (temp._content != null) return false; if (this._dict != null) { if (temp._dict == null) return false; - else if (!(this._dict.equals(temp._dict))) - return false; - } - else if (temp._dict != null) + if (this._dict != temp._dict) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dict); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dict); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dict); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict); }; + return false; + } + if (!thcycle) { + if (!this._dict.equals(temp._dict)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._dict); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._dict); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict); + } + } + } else if (temp._dict != null) return false; return true; } @@ -135,11 +167,15 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_content != null) { + if (_content != null + && !org.castor.util.CycleBreaker.startingToCycle(_content)) { result = 37 * result + _content.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_content); } - if (_dict != null) { + if (_dict != null + && !org.castor.util.CycleBreaker.startingToCycle(_dict)) { result = 37 * result + _dict.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_dict); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Input.java b/src/uk/ac/vamsas/objects/core/Input.java index 3ad7a8e..b5b2de9 100644 --- a/src/uk/ac/vamsas/objects/core/Input.java +++ b/src/uk/ac/vamsas/objects/core/Input.java @@ -109,19 +109,51 @@ implements java.io.Serializable if (obj instanceof Input) { Input temp = (Input)obj; + boolean thcycle; + boolean tmcycle; if (this._name != null) { if (temp._name == null) return false; - else if (!(this._name.equals(temp._name))) - return false; - } - else if (temp._name != null) + if (this._name != temp._name) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); }; + return false; + } + if (!thcycle) { + if (!this._name.equals(temp._name)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + } + } + } else if (temp._name != null) return false; if (this._objRef != null) { if (temp._objRef == null) return false; - else if (!(this._objRef.equals(temp._objRef))) - return false; - } - else if (temp._objRef != null) + if (this._objRef != temp._objRef) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._objRef); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._objRef); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef); }; + return false; + } + if (!thcycle) { + if (!this._objRef.equals(temp._objRef)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef); + } + } + } else if (temp._objRef != null) return false; return true; } @@ -207,11 +239,15 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_name != null) { + if (_name != null + && !org.castor.util.CycleBreaker.startingToCycle(_name)) { result = 37 * result + _name.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_name); } - if (_objRef != null) { + if (_objRef != null + && !org.castor.util.CycleBreaker.startingToCycle(_objRef)) { result = 37 * result + _objRef.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_objRef); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Instance.java b/src/uk/ac/vamsas/objects/core/Instance.java index 6cfeec0..9ffd596 100644 --- a/src/uk/ac/vamsas/objects/core/Instance.java +++ b/src/uk/ac/vamsas/objects/core/Instance.java @@ -64,12 +64,29 @@ implements java.io.Serializable if (obj instanceof Instance) { Instance temp = (Instance)obj; + boolean thcycle; + boolean tmcycle; if (this._urn != null) { if (temp._urn == null) return false; - else if (!(this._urn.equals(temp._urn))) - return false; - } - else if (temp._urn != null) + if (this._urn != temp._urn) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._urn); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._urn); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._urn); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._urn); }; + return false; + } + if (!thcycle) { + if (!this._urn.equals(temp._urn)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._urn); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._urn); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._urn); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._urn); + } + } + } else if (temp._urn != null) return false; return true; } @@ -99,8 +116,10 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_urn != null) { + if (_urn != null + && !org.castor.util.CycleBreaker.startingToCycle(_urn)) { result = 37 * result + _urn.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_urn); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Link.java b/src/uk/ac/vamsas/objects/core/Link.java index aea537d..17633cf 100644 --- a/src/uk/ac/vamsas/objects/core/Link.java +++ b/src/uk/ac/vamsas/objects/core/Link.java @@ -70,19 +70,51 @@ implements java.io.Serializable if (obj instanceof Link) { Link temp = (Link)obj; + boolean thcycle; + boolean tmcycle; if (this._content != null) { if (temp._content == null) return false; - else if (!(this._content.equals(temp._content))) - return false; - } - else if (temp._content != null) + if (this._content != temp._content) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); }; + return false; + } + if (!thcycle) { + if (!this._content.equals(temp._content)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + } + } + } else if (temp._content != null) return false; if (this._href != null) { if (temp._href == null) return false; - else if (!(this._href.equals(temp._href))) - return false; - } - else if (temp._href != null) + if (this._href != temp._href) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._href); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._href); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._href); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._href); }; + return false; + } + if (!thcycle) { + if (!this._href.equals(temp._href)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._href); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._href); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._href); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._href); + } + } + } else if (temp._href != null) return false; return true; } @@ -124,11 +156,15 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_content != null) { + if (_content != null + && !org.castor.util.CycleBreaker.startingToCycle(_content)) { result = 37 * result + _content.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_content); } - if (_href != null) { + if (_href != null + && !org.castor.util.CycleBreaker.startingToCycle(_href)) { result = 37 * result + _href.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_href); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Local.java b/src/uk/ac/vamsas/objects/core/Local.java new file mode 100644 index 0000000..8b58b7c --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Local.java @@ -0,0 +1,154 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; + +/** + * + * + * @version $Revision$ $Date$ + */ +public class Local extends MapRangeType +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Local() { + super(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Overrides the java.lang.Object.equals method. + * + * @param obj + * @return true if the objects are equal. + */ + public boolean equals( + final java.lang.Object obj) { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Local) { + + return true; + } + return false; + } + + /** + * 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 true if this object is valid according to the schema + */ + public boolean isValid( + ) { + try { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } + + /** + * + * + * @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( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, out); + } + + /** + * + * + * @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( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, handler); + } + + /** + * Method unmarshal. + * + * @param reader + * @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( + 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.Local.class, reader); + } + + /** + * + * + * @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 { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } + +} diff --git a/src/uk/ac/vamsas/objects/core/LockFile.java b/src/uk/ac/vamsas/objects/core/LockFile.java index 915bd07..cb41ef9 100644 --- a/src/uk/ac/vamsas/objects/core/LockFile.java +++ b/src/uk/ac/vamsas/objects/core/LockFile.java @@ -65,12 +65,29 @@ implements java.io.Serializable if (obj instanceof LockFile) { LockFile temp = (LockFile)obj; + boolean thcycle; + boolean tmcycle; if (this._content != null) { if (temp._content == null) return false; - else if (!(this._content.equals(temp._content))) - return false; - } - else if (temp._content != null) + if (this._content != temp._content) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); }; + return false; + } + if (!thcycle) { + if (!this._content.equals(temp._content)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + } + } + } else if (temp._content != null) return false; return true; } @@ -101,8 +118,10 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_content != null) { + if (_content != null + && !org.castor.util.CycleBreaker.startingToCycle(_content)) { result = 37 * result + _content.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_content); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Map.java b/src/uk/ac/vamsas/objects/core/Map.java index 5d5668d..561589c 100644 --- a/src/uk/ac/vamsas/objects/core/Map.java +++ b/src/uk/ac/vamsas/objects/core/Map.java @@ -15,25 +15,35 @@ import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; /** - * From: Offset to first - * position in dataset sequence record that - * this database entry maps to To: Offset - * to last position in dataset sequence - * record that this database entry maps to - * Start: Offset to first last position in - * database entry that first (or offset) - * position in sequence maps to End: Offset - * to last position in database entry that - * last (offset) position in sequence maps - * to + * the local mapType maps from the parent + * sequence coordinate frame to the reference + * frame defined by the dbRef element. + * The mapped mapType is the mapped range defined + * on the dbRef element's reference frame. + * Conventionally, the unit attribute defaults to 1, or + * will be inferred from the local sequence's + * dictionary type and any dictionary type associated + * with the database being mapped to. + * However, it may be used to avoid ambiguity. + * * * @version $Revision$ $Date$ */ -public class Map extends uk.ac.vamsas.objects.core.MapList +public class Map extends uk.ac.vamsas.objects.core.MapType implements java.io.Serializable { + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _id. + */ + private java.lang.String _id; + + //----------------/ //- Constructors -/ //----------------/ @@ -63,9 +73,44 @@ implements java.io.Serializable if (obj instanceof Map) { - return true; + Map temp = (Map)obj; + boolean thcycle; + boolean tmcycle; + if (this._id != null) { + if (temp._id == null) return false; + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) + return false; + return true; + } + return false; } - return false; + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId( + ) { + return this._id; } /** @@ -81,6 +126,11 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { + result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); + } return result; } @@ -133,6 +183,16 @@ implements java.io.Serializable } /** + * Sets the value of field 'id'. + * + * @param id the value of field 'id'. + */ + public void setId( + final java.lang.String id) { + this._id = id; + } + + /** * Method unmarshal. * * @param reader @@ -140,12 +200,12 @@ implements java.io.Serializable * 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 + * @return the unmarshaled uk.ac.vamsas.objects.core.MapType */ - public static uk.ac.vamsas.objects.core.MapList unmarshal( + public static uk.ac.vamsas.objects.core.MapType 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); + return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Map.class, reader); } /** diff --git a/src/uk/ac/vamsas/objects/core/MapRangeType.java b/src/uk/ac/vamsas/objects/core/MapRangeType.java new file mode 100644 index 0000000..c390687 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/MapRangeType.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; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; + +/** + * Class MapRangeType. + * + * @version $Revision$ $Date$ + */ +public class MapRangeType extends uk.ac.vamsas.objects.core.RangeType +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * number of dictionary symbol widths involved in each + * mapped position on this sequence (for example, 3 for a dna + * sequence exon + * region that is being mapped to a protein sequence). This is + * optional, + * since the unit can be usually be inferred from the + * dictionary type of + * each sequence involved in the mapping. + */ + private long _unit; + + /** + * keeps track of state for field: _unit + */ + private boolean _has_unit; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public MapRangeType() { + super(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + */ + public void deleteUnit( + ) { + this._has_unit= false; + } + + /** + * Overrides the java.lang.Object.equals method. + * + * @param obj + * @return true if the objects are equal. + */ + public boolean equals( + final java.lang.Object obj) { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof MapRangeType) { + + MapRangeType temp = (MapRangeType)obj; + boolean thcycle; + boolean tmcycle; + if (this._unit != temp._unit) + return false; + if (this._has_unit != temp._has_unit) + return false; + return true; + } + return false; + } + + /** + * Returns the value of field 'unit'. The field 'unit' has the + * following description: number of dictionary symbol widths + * involved in each + * mapped position on this sequence (for example, 3 for a dna + * sequence exon + * region that is being mapped to a protein sequence). This is + * optional, + * since the unit can be usually be inferred from the + * dictionary type of + * each sequence involved in the mapping. + * + * @return the value of field 'Unit'. + */ + public long getUnit( + ) { + return this._unit; + } + + /** + * Method hasUnit. + * + * @return true if at least one Unit has been added + */ + public boolean hasUnit( + ) { + return this._has_unit; + } + + /** + * 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)(_unit^(_unit>>>32)); + + return result; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid( + ) { + try { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } + + /** + * + * + * @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( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, out); + } + + /** + * + * + * @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( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'unit'. The field 'unit' has the + * following description: number of dictionary symbol widths + * involved in each + * mapped position on this sequence (for example, 3 for a dna + * sequence exon + * region that is being mapped to a protein sequence). This is + * optional, + * since the unit can be usually be inferred from the + * dictionary type of + * each sequence involved in the mapping. + * + * @param unit the value of field 'unit'. + */ + public void setUnit( + final long unit) { + this._unit = unit; + this._has_unit = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @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( + 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.MapRangeType.class, reader); + } + + /** + * + * + * @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 { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } + +} diff --git a/src/uk/ac/vamsas/objects/core/MapType.java b/src/uk/ac/vamsas/objects/core/MapType.java new file mode 100644 index 0000000..130f17d --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/MapType.java @@ -0,0 +1,266 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; + +/** + * Two sets of ranges defined between objects - usually sequences, + * indicating which + * regions on each are mapped. + * + * @version $Revision$ $Date$ + */ +public class MapType extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + */ + private uk.ac.vamsas.objects.core.Local _local; + + /** + */ + private uk.ac.vamsas.objects.core.Mapped _mapped; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public MapType() { + super(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Overrides the java.lang.Object.equals method. + * + * @param obj + * @return true if the objects are equal. + */ + public boolean equals( + final java.lang.Object obj) { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof MapType) { + + MapType temp = (MapType)obj; + boolean thcycle; + boolean tmcycle; + if (this._local != null) { + if (temp._local == null) return false; + if (this._local != temp._local) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._local); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._local); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._local); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._local); }; + return false; + } + if (!thcycle) { + if (!this._local.equals(temp._local)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._local); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._local); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._local); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._local); + } + } + } else if (temp._local != null) + return false; + if (this._mapped != null) { + if (temp._mapped == null) return false; + if (this._mapped != temp._mapped) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._mapped); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._mapped); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped); }; + return false; + } + if (!thcycle) { + if (!this._mapped.equals(temp._mapped)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped); + } + } + } else if (temp._mapped != null) + return false; + return true; + } + return false; + } + + /** + * Returns the value of field 'local'. + * + * @return the value of field 'Local'. + */ + public uk.ac.vamsas.objects.core.Local getLocal( + ) { + return this._local; + } + + /** + * Returns the value of field 'mapped'. + * + * @return the value of field 'Mapped'. + */ + public uk.ac.vamsas.objects.core.Mapped getMapped( + ) { + return this._mapped; + } + + /** + * 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 (_local != null + && !org.castor.util.CycleBreaker.startingToCycle(_local)) { + result = 37 * result + _local.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_local); + } + if (_mapped != null + && !org.castor.util.CycleBreaker.startingToCycle(_mapped)) { + result = 37 * result + _mapped.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_mapped); + } + + return result; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid( + ) { + try { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } + + /** + * + * + * @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( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, out); + } + + /** + * + * + * @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( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'local'. + * + * @param local the value of field 'local'. + */ + public void setLocal( + final uk.ac.vamsas.objects.core.Local local) { + this._local = local; + } + + /** + * Sets the value of field 'mapped'. + * + * @param mapped the value of field 'mapped'. + */ + public void setMapped( + final uk.ac.vamsas.objects.core.Mapped mapped) { + this._mapped = mapped; + } + + /** + * Method unmarshal. + * + * @param reader + * @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.MapType + */ + public static uk.ac.vamsas.objects.core.MapType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapType.class, reader); + } + + /** + * + * + * @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 { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } + +} diff --git a/src/uk/ac/vamsas/objects/core/Mapped.java b/src/uk/ac/vamsas/objects/core/Mapped.java new file mode 100644 index 0000000..4d3161f --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Mapped.java @@ -0,0 +1,154 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; + +/** + * + * + * @version $Revision$ $Date$ + */ +public class Mapped extends MapRangeType +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Mapped() { + super(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Overrides the java.lang.Object.equals method. + * + * @param obj + * @return true if the objects are equal. + */ + public boolean equals( + final java.lang.Object obj) { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Mapped) { + + return true; + } + return false; + } + + /** + * 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 true if this object is valid according to the schema + */ + public boolean isValid( + ) { + try { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } + + /** + * + * + * @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( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, out); + } + + /** + * + * + * @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( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, handler); + } + + /** + * Method unmarshal. + * + * @param reader + * @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( + 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.Mapped.class, reader); + } + + /** + * + * + * @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 { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } + +} diff --git a/src/uk/ac/vamsas/objects/core/Newick.java b/src/uk/ac/vamsas/objects/core/Newick.java index 23d4f82..2813c56 100644 --- a/src/uk/ac/vamsas/objects/core/Newick.java +++ b/src/uk/ac/vamsas/objects/core/Newick.java @@ -81,33 +81,95 @@ implements java.io.Serializable if (obj instanceof Newick) { Newick temp = (Newick)obj; + boolean thcycle; + boolean tmcycle; if (this._content != null) { if (temp._content == null) return false; - else if (!(this._content.equals(temp._content))) - return false; - } - else if (temp._content != null) + if (this._content != temp._content) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); }; + return false; + } + if (!thcycle) { + if (!this._content.equals(temp._content)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + } + } + } else if (temp._content != null) return false; if (this._title != null) { if (temp._title == null) return false; - else if (!(this._title.equals(temp._title))) - return false; - } - else if (temp._title != null) + if (this._title != temp._title) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._title); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._title); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._title); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); }; + return false; + } + if (!thcycle) { + if (!this._title.equals(temp._title)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._title); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._title); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); + } + } + } else if (temp._title != null) return false; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._modifiable != null) { if (temp._modifiable == null) return false; - else if (!(this._modifiable.equals(temp._modifiable))) - return false; - } - else if (temp._modifiable != null) + if (this._modifiable != temp._modifiable) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); }; + return false; + } + if (!thcycle) { + if (!this._modifiable.equals(temp._modifiable)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + } + } + } else if (temp._modifiable != null) return false; return true; } @@ -171,17 +233,25 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_content != null) { + if (_content != null + && !org.castor.util.CycleBreaker.startingToCycle(_content)) { result = 37 * result + _content.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_content); } - if (_title != null) { + if (_title != null + && !org.castor.util.CycleBreaker.startingToCycle(_title)) { result = 37 * result + _title.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_title); } - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_modifiable != null) { + if (_modifiable != null + && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) { result = 37 * result + _modifiable.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable); } return result; diff --git a/src/uk/ac/vamsas/objects/core/NodeType.java b/src/uk/ac/vamsas/objects/core/NodeType.java index 7f480d1..488c0ee 100644 --- a/src/uk/ac/vamsas/objects/core/NodeType.java +++ b/src/uk/ac/vamsas/objects/core/NodeType.java @@ -49,7 +49,8 @@ implements java.io.Serializable private java.lang.String _description; /** - * Direct associations between this node and any vamsas objects + * Direct associations between this node and any vamsas + * objects */ private java.util.Vector _vrefList; @@ -169,47 +170,139 @@ implements java.io.Serializable if (obj instanceof NodeType) { NodeType temp = (NodeType)obj; + boolean thcycle; + boolean tmcycle; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._modifiable != null) { if (temp._modifiable == null) return false; - else if (!(this._modifiable.equals(temp._modifiable))) - return false; - } - else if (temp._modifiable != null) + if (this._modifiable != temp._modifiable) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); }; + return false; + } + if (!thcycle) { + if (!this._modifiable.equals(temp._modifiable)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + } + } + } else if (temp._modifiable != null) return false; if (this._name != null) { if (temp._name == null) return false; - else if (!(this._name.equals(temp._name))) - return false; - } - else if (temp._name != null) + if (this._name != temp._name) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); }; + return false; + } + if (!thcycle) { + if (!this._name.equals(temp._name)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + } + } + } else if (temp._name != null) return false; if (this._description != null) { if (temp._description == null) return false; - else if (!(this._description.equals(temp._description))) - return false; - } - else if (temp._description != null) + if (this._description != temp._description) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._description); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._description); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._description); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); }; + return false; + } + if (!thcycle) { + if (!this._description.equals(temp._description)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._description); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._description); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); + } + } + } else if (temp._description != null) return false; if (this._vrefList != null) { if (temp._vrefList == null) return false; - else if (!(this._vrefList.equals(temp._vrefList))) - return false; - } - else if (temp._vrefList != null) + if (this._vrefList != temp._vrefList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._vrefList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._vrefList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList); }; + return false; + } + if (!thcycle) { + if (!this._vrefList.equals(temp._vrefList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList); + } + } + } else if (temp._vrefList != null) return false; if (this._propertyList != null) { if (temp._propertyList == null) return false; - else if (!(this._propertyList.equals(temp._propertyList))) - return false; - } - else if (temp._propertyList != null) + if (this._propertyList != temp._propertyList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); }; + return false; + } + if (!thcycle) { + if (!this._propertyList.equals(temp._propertyList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + } + } + } else if (temp._propertyList != null) return false; return true; } @@ -388,23 +481,35 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_modifiable != null) { + if (_modifiable != null + && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) { result = 37 * result + _modifiable.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable); } - if (_name != null) { + if (_name != null + && !org.castor.util.CycleBreaker.startingToCycle(_name)) { result = 37 * result + _name.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_name); } - if (_description != null) { + if (_description != null + && !org.castor.util.CycleBreaker.startingToCycle(_description)) { result = 37 * result + _description.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_description); } - if (_vrefList != null) { + if (_vrefList != null + && !org.castor.util.CycleBreaker.startingToCycle(_vrefList)) { result = 37 * result + _vrefList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_vrefList); } - if (_propertyList != null) { + if (_propertyList != null + && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) { result = 37 * result + _propertyList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Param.java b/src/uk/ac/vamsas/objects/core/Param.java index 744dba5..e9cece2 100644 --- a/src/uk/ac/vamsas/objects/core/Param.java +++ b/src/uk/ac/vamsas/objects/core/Param.java @@ -78,26 +78,73 @@ implements java.io.Serializable if (obj instanceof Param) { Param temp = (Param)obj; + boolean thcycle; + boolean tmcycle; if (this._content != null) { if (temp._content == null) return false; - else if (!(this._content.equals(temp._content))) - return false; - } - else if (temp._content != null) + if (this._content != temp._content) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); }; + return false; + } + if (!thcycle) { + if (!this._content.equals(temp._content)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + } + } + } else if (temp._content != null) return false; if (this._name != null) { if (temp._name == null) return false; - else if (!(this._name.equals(temp._name))) - return false; - } - else if (temp._name != null) + if (this._name != temp._name) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); }; + return false; + } + if (!thcycle) { + if (!this._name.equals(temp._name)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + } + } + } else if (temp._name != null) return false; if (this._type != null) { if (temp._type == null) return false; - else if (!(this._type.equals(temp._type))) - return false; - } - else if (temp._type != null) + if (this._type != temp._type) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); }; + return false; + } + if (!thcycle) { + if (!this._type.equals(temp._type)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + } + } + } else if (temp._type != null) return false; return true; } @@ -153,14 +200,20 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_content != null) { + if (_content != null + && !org.castor.util.CycleBreaker.startingToCycle(_content)) { result = 37 * result + _content.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_content); } - if (_name != null) { + if (_name != null + && !org.castor.util.CycleBreaker.startingToCycle(_name)) { result = 37 * result + _name.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_name); } - if (_type != null) { + if (_type != null + && !org.castor.util.CycleBreaker.startingToCycle(_type)) { result = 37 * result + _type.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_type); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Pos.java b/src/uk/ac/vamsas/objects/core/Pos.java index 7a98276..3877be5 100644 --- a/src/uk/ac/vamsas/objects/core/Pos.java +++ b/src/uk/ac/vamsas/objects/core/Pos.java @@ -77,6 +77,8 @@ implements java.io.Serializable if (obj instanceof Pos) { Pos temp = (Pos)obj; + boolean thcycle; + boolean tmcycle; if (this._i != temp._i) return false; if (this._has_i != temp._has_i) diff --git a/src/uk/ac/vamsas/objects/core/Property.java b/src/uk/ac/vamsas/objects/core/Property.java index 8161092..bccf4bd 100644 --- a/src/uk/ac/vamsas/objects/core/Property.java +++ b/src/uk/ac/vamsas/objects/core/Property.java @@ -78,26 +78,73 @@ implements java.io.Serializable if (obj instanceof Property) { Property temp = (Property)obj; + boolean thcycle; + boolean tmcycle; if (this._content != null) { if (temp._content == null) return false; - else if (!(this._content.equals(temp._content))) - return false; - } - else if (temp._content != null) + if (this._content != temp._content) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); }; + return false; + } + if (!thcycle) { + if (!this._content.equals(temp._content)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + } + } + } else if (temp._content != null) return false; if (this._name != null) { if (temp._name == null) return false; - else if (!(this._name.equals(temp._name))) - return false; - } - else if (temp._name != null) + if (this._name != temp._name) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); }; + return false; + } + if (!thcycle) { + if (!this._name.equals(temp._name)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + } + } + } else if (temp._name != null) return false; if (this._type != null) { if (temp._type == null) return false; - else if (!(this._type.equals(temp._type))) - return false; - } - else if (temp._type != null) + if (this._type != temp._type) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); }; + return false; + } + if (!thcycle) { + if (!this._type.equals(temp._type)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + } + } + } else if (temp._type != null) return false; return true; } @@ -153,14 +200,20 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_content != null) { + if (_content != null + && !org.castor.util.CycleBreaker.startingToCycle(_content)) { result = 37 * result + _content.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_content); } - if (_name != null) { + if (_name != null + && !org.castor.util.CycleBreaker.startingToCycle(_name)) { result = 37 * result + _name.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_name); } - if (_type != null) { + if (_type != null + && !org.castor.util.CycleBreaker.startingToCycle(_type)) { result = 37 * result + _type.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_type); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Provenance.java b/src/uk/ac/vamsas/objects/core/Provenance.java index 3477b22..12dc17b 100644 --- a/src/uk/ac/vamsas/objects/core/Provenance.java +++ b/src/uk/ac/vamsas/objects/core/Provenance.java @@ -104,12 +104,29 @@ implements java.io.Serializable if (obj instanceof Provenance) { Provenance temp = (Provenance)obj; + boolean thcycle; + boolean tmcycle; if (this._entryList != null) { if (temp._entryList == null) return false; - else if (!(this._entryList.equals(temp._entryList))) - return false; - } - else if (temp._entryList != null) + if (this._entryList != temp._entryList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._entryList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._entryList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._entryList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._entryList); }; + return false; + } + if (!thcycle) { + if (!this._entryList.equals(temp._entryList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._entryList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._entryList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._entryList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._entryList); + } + } + } else if (temp._entryList != null) return false; return true; } @@ -186,8 +203,10 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_entryList != null) { + if (_entryList != null + && !org.castor.util.CycleBreaker.startingToCycle(_entryList)) { result = 37 * result + _entryList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_entryList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/RangeAnnotation.java b/src/uk/ac/vamsas/objects/core/RangeAnnotation.java index 869c4f5..2a2adda 100644 --- a/src/uk/ac/vamsas/objects/core/RangeAnnotation.java +++ b/src/uk/ac/vamsas/objects/core/RangeAnnotation.java @@ -300,82 +300,249 @@ implements java.io.Serializable if (obj instanceof RangeAnnotation) { RangeAnnotation temp = (RangeAnnotation)obj; + boolean thcycle; + boolean tmcycle; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._modifiable != null) { if (temp._modifiable == null) return false; - else if (!(this._modifiable.equals(temp._modifiable))) - return false; - } - else if (temp._modifiable != null) + if (this._modifiable != temp._modifiable) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); }; + return false; + } + if (!thcycle) { + if (!this._modifiable.equals(temp._modifiable)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + } + } + } else if (temp._modifiable != null) return false; if (this._group != null) { if (temp._group == null) return false; - else if (!(this._group.equals(temp._group))) - return false; - } - else if (temp._group != null) + if (this._group != temp._group) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._group); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._group); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._group); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._group); }; + return false; + } + if (!thcycle) { + if (!this._group.equals(temp._group)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._group); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._group); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._group); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._group); + } + } + } else if (temp._group != null) return false; if (this._type != null) { if (temp._type == null) return false; - else if (!(this._type.equals(temp._type))) - return false; - } - else if (temp._type != null) + if (this._type != temp._type) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); }; + return false; + } + if (!thcycle) { + if (!this._type.equals(temp._type)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._type); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); + } + } + } else if (temp._type != null) return false; if (this._label != null) { if (temp._label == null) return false; - else if (!(this._label.equals(temp._label))) - return false; - } - else if (temp._label != null) + if (this._label != temp._label) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._label); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._label); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._label); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._label); }; + return false; + } + if (!thcycle) { + if (!this._label.equals(temp._label)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._label); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._label); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._label); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._label); + } + } + } else if (temp._label != null) return false; if (this._description != null) { if (temp._description == null) return false; - else if (!(this._description.equals(temp._description))) - return false; - } - else if (temp._description != null) + if (this._description != temp._description) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._description); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._description); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._description); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); }; + return false; + } + if (!thcycle) { + if (!this._description.equals(temp._description)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._description); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._description); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); + } + } + } else if (temp._description != null) return false; if (this._status != null) { if (temp._status == null) return false; - else if (!(this._status.equals(temp._status))) - return false; - } - else if (temp._status != null) + if (this._status != temp._status) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._status); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._status); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._status); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._status); }; + return false; + } + if (!thcycle) { + if (!this._status.equals(temp._status)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._status); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._status); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._status); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._status); + } + } + } else if (temp._status != null) return false; if (this._annotationElementList != null) { if (temp._annotationElementList == null) return false; - else if (!(this._annotationElementList.equals(temp._annotationElementList))) - return false; - } - else if (temp._annotationElementList != null) + if (this._annotationElementList != temp._annotationElementList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._annotationElementList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._annotationElementList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._annotationElementList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._annotationElementList); }; + return false; + } + if (!thcycle) { + if (!this._annotationElementList.equals(temp._annotationElementList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._annotationElementList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._annotationElementList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._annotationElementList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._annotationElementList); + } + } + } else if (temp._annotationElementList != null) return false; if (this._scoreList != null) { if (temp._scoreList == null) return false; - else if (!(this._scoreList.equals(temp._scoreList))) - return false; - } - else if (temp._scoreList != null) + if (this._scoreList != temp._scoreList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._scoreList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._scoreList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._scoreList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._scoreList); }; + return false; + } + if (!thcycle) { + if (!this._scoreList.equals(temp._scoreList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._scoreList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._scoreList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._scoreList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._scoreList); + } + } + } else if (temp._scoreList != null) return false; if (this._linkList != null) { if (temp._linkList == null) return false; - else if (!(this._linkList.equals(temp._linkList))) - return false; - } - else if (temp._linkList != null) + if (this._linkList != temp._linkList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._linkList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._linkList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); }; + return false; + } + if (!thcycle) { + if (!this._linkList.equals(temp._linkList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); + } + } + } else if (temp._linkList != null) return false; if (this._propertyList != null) { if (temp._propertyList == null) return false; - else if (!(this._propertyList.equals(temp._propertyList))) - return false; - } - else if (temp._propertyList != null) + if (this._propertyList != temp._propertyList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); }; + return false; + } + if (!thcycle) { + if (!this._propertyList.equals(temp._propertyList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + } + } + } else if (temp._propertyList != null) return false; return true; } @@ -722,38 +889,60 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_modifiable != null) { + if (_modifiable != null + && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) { result = 37 * result + _modifiable.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable); } - if (_group != null) { + if (_group != null + && !org.castor.util.CycleBreaker.startingToCycle(_group)) { result = 37 * result + _group.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_group); } - if (_type != null) { + if (_type != null + && !org.castor.util.CycleBreaker.startingToCycle(_type)) { result = 37 * result + _type.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_type); } - if (_label != null) { + if (_label != null + && !org.castor.util.CycleBreaker.startingToCycle(_label)) { result = 37 * result + _label.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_label); } - if (_description != null) { + if (_description != null + && !org.castor.util.CycleBreaker.startingToCycle(_description)) { result = 37 * result + _description.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_description); } - if (_status != null) { + if (_status != null + && !org.castor.util.CycleBreaker.startingToCycle(_status)) { result = 37 * result + _status.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_status); } - if (_annotationElementList != null) { + if (_annotationElementList != null + && !org.castor.util.CycleBreaker.startingToCycle(_annotationElementList)) { result = 37 * result + _annotationElementList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_annotationElementList); } - if (_scoreList != null) { + if (_scoreList != null + && !org.castor.util.CycleBreaker.startingToCycle(_scoreList)) { result = 37 * result + _scoreList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_scoreList); } - if (_linkList != null) { + if (_linkList != null + && !org.castor.util.CycleBreaker.startingToCycle(_linkList)) { result = 37 * result + _linkList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_linkList); } - if (_propertyList != null) { + if (_propertyList != null + && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) { result = 37 * result + _propertyList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/RangeType.java b/src/uk/ac/vamsas/objects/core/RangeType.java index 91338e2..3e1f6da 100644 --- a/src/uk/ac/vamsas/objects/core/RangeType.java +++ b/src/uk/ac/vamsas/objects/core/RangeType.java @@ -155,26 +155,73 @@ implements java.io.Serializable if (obj instanceof RangeType) { RangeType temp = (RangeType)obj; + boolean thcycle; + boolean tmcycle; if (this._choiceValue != null) { if (temp._choiceValue == null) return false; - else if (!(this._choiceValue.equals(temp._choiceValue))) - return false; - } - else if (temp._choiceValue != null) + if (this._choiceValue != temp._choiceValue) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._choiceValue); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._choiceValue); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); }; + return false; + } + if (!thcycle) { + if (!this._choiceValue.equals(temp._choiceValue)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); + } + } + } else if (temp._choiceValue != null) return false; if (this._posList != null) { if (temp._posList == null) return false; - else if (!(this._posList.equals(temp._posList))) - return false; - } - else if (temp._posList != null) + if (this._posList != temp._posList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._posList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._posList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._posList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._posList); }; + return false; + } + if (!thcycle) { + if (!this._posList.equals(temp._posList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._posList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._posList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._posList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._posList); + } + } + } else if (temp._posList != null) return false; if (this._segList != null) { if (temp._segList == null) return false; - else if (!(this._segList.equals(temp._segList))) - return false; - } - else if (temp._segList != null) + if (this._segList != temp._segList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._segList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._segList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._segList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._segList); }; + return false; + } + if (!thcycle) { + if (!this._segList.equals(temp._segList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._segList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._segList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._segList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._segList); + } + } + } else if (temp._segList != null) return false; return true; } @@ -320,14 +367,20 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_choiceValue != null) { + if (_choiceValue != null + && !org.castor.util.CycleBreaker.startingToCycle(_choiceValue)) { result = 37 * result + _choiceValue.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_choiceValue); } - if (_posList != null) { + if (_posList != null + && !org.castor.util.CycleBreaker.startingToCycle(_posList)) { result = 37 * result + _posList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_posList); } - if (_segList != null) { + if (_segList != null + && !org.castor.util.CycleBreaker.startingToCycle(_segList)) { result = 37 * result + _segList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_segList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/ReferenceType.java b/src/uk/ac/vamsas/objects/core/ReferenceType.java index d25aea9..6c06137 100644 --- a/src/uk/ac/vamsas/objects/core/ReferenceType.java +++ b/src/uk/ac/vamsas/objects/core/ReferenceType.java @@ -16,7 +16,6 @@ import org.exolab.castor.xml.Unmarshaller; /** * base type for citing arbitrary links between vamsas objects - * * Optional human readable description of the relationship * * @@ -37,12 +36,14 @@ implements java.io.Serializable private java.lang.String _content = ""; /** - * Primary Key for vamsas object referencing + * Primary Key for vamsas object referencing + * */ private java.lang.String _id; /** - * List of one or more vamsas object references + * List of one or more vamsas object + * references */ private java.util.Vector _refs; @@ -117,26 +118,73 @@ implements java.io.Serializable if (obj instanceof ReferenceType) { ReferenceType temp = (ReferenceType)obj; + boolean thcycle; + boolean tmcycle; if (this._content != null) { if (temp._content == null) return false; - else if (!(this._content.equals(temp._content))) - return false; - } - else if (temp._content != null) + if (this._content != temp._content) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); }; + return false; + } + if (!thcycle) { + if (!this._content.equals(temp._content)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._content); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); + } + } + } else if (temp._content != null) return false; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._refs != null) { if (temp._refs == null) return false; - else if (!(this._refs.equals(temp._refs))) - return false; - } - else if (temp._refs != null) + if (this._refs != temp._refs) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._refs); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._refs); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._refs); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs); }; + return false; + } + if (!thcycle) { + if (!this._refs.equals(temp._refs)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._refs); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._refs); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs); + } + } + } else if (temp._refs != null) return false; return true; } @@ -157,7 +205,8 @@ implements java.io.Serializable /** * Returns the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object - * referencing + * referencing + * * * @return the value of field 'Id'. */ @@ -235,14 +284,20 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_content != null) { + if (_content != null + && !org.castor.util.CycleBreaker.startingToCycle(_content)) { result = 37 * result + _content.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_content); } - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_refs != null) { + if (_refs != null + && !org.castor.util.CycleBreaker.startingToCycle(_refs)) { result = 37 * result + _refs.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_refs); } return result; @@ -340,7 +395,8 @@ implements java.io.Serializable /** * Sets the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object - * referencing + * referencing + * * * @param id the value of field 'id'. */ diff --git a/src/uk/ac/vamsas/objects/core/Score.java b/src/uk/ac/vamsas/objects/core/Score.java index 8448198..357deb2 100644 --- a/src/uk/ac/vamsas/objects/core/Score.java +++ b/src/uk/ac/vamsas/objects/core/Score.java @@ -83,16 +83,33 @@ implements java.io.Serializable if (obj instanceof Score) { Score temp = (Score)obj; + boolean thcycle; + boolean tmcycle; if (this._content != temp._content) return false; if (this._has_content != temp._has_content) return false; if (this._name != null) { if (temp._name == null) return false; - else if (!(this._name.equals(temp._name))) - return false; - } - else if (temp._name != null) + if (this._name != temp._name) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); }; + return false; + } + if (!thcycle) { + if (!this._name.equals(temp._name)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + } + } + } else if (temp._name != null) return false; return true; } @@ -144,8 +161,10 @@ implements java.io.Serializable long tmp; result = 37 * result + java.lang.Float.floatToIntBits(_content); - if (_name != null) { + if (_name != null + && !org.castor.util.CycleBreaker.startingToCycle(_name)) { result = 37 * result + _name.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_name); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Seg.java b/src/uk/ac/vamsas/objects/core/Seg.java index 4a7c031..5174b80 100644 --- a/src/uk/ac/vamsas/objects/core/Seg.java +++ b/src/uk/ac/vamsas/objects/core/Seg.java @@ -114,6 +114,8 @@ implements java.io.Serializable if (obj instanceof Seg) { Seg temp = (Seg)obj; + boolean thcycle; + boolean tmcycle; if (this._start != temp._start) return false; if (this._has_start != temp._has_start) diff --git a/src/uk/ac/vamsas/objects/core/Sequence.java b/src/uk/ac/vamsas/objects/core/Sequence.java index 03ea13a..519f57a 100644 --- a/src/uk/ac/vamsas/objects/core/Sequence.java +++ b/src/uk/ac/vamsas/objects/core/Sequence.java @@ -48,9 +48,8 @@ implements java.io.Serializable private java.util.Vector _dbRefList; /** - * explicitly named cross reference to other objects in the - * document. - * + * explicitly named cross reference to + * other objects in the document. */ private java.util.Vector _vxrefList; @@ -165,33 +164,95 @@ implements java.io.Serializable if (obj instanceof Sequence) { Sequence temp = (Sequence)obj; + boolean thcycle; + boolean tmcycle; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._dictionary != null) { if (temp._dictionary == null) return false; - else if (!(this._dictionary.equals(temp._dictionary))) - return false; - } - else if (temp._dictionary != null) + if (this._dictionary != temp._dictionary) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dictionary); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dictionary); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dictionary); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dictionary); }; + return false; + } + if (!thcycle) { + if (!this._dictionary.equals(temp._dictionary)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._dictionary); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dictionary); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._dictionary); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dictionary); + } + } + } else if (temp._dictionary != null) return false; if (this._dbRefList != null) { if (temp._dbRefList == null) return false; - else if (!(this._dbRefList.equals(temp._dbRefList))) - return false; - } - else if (temp._dbRefList != null) + if (this._dbRefList != temp._dbRefList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dbRefList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dbRefList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dbRefList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dbRefList); }; + return false; + } + if (!thcycle) { + if (!this._dbRefList.equals(temp._dbRefList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._dbRefList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dbRefList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._dbRefList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dbRefList); + } + } + } else if (temp._dbRefList != null) return false; if (this._vxrefList != null) { if (temp._vxrefList == null) return false; - else if (!(this._vxrefList.equals(temp._vxrefList))) - return false; - } - else if (temp._vxrefList != null) + if (this._vxrefList != temp._vxrefList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._vxrefList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._vxrefList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._vxrefList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._vxrefList); }; + return false; + } + if (!thcycle) { + if (!this._vxrefList.equals(temp._vxrefList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._vxrefList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._vxrefList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._vxrefList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._vxrefList); + } + } + } else if (temp._vxrefList != null) return false; return true; } @@ -351,17 +412,25 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_dictionary != null) { + if (_dictionary != null + && !org.castor.util.CycleBreaker.startingToCycle(_dictionary)) { result = 37 * result + _dictionary.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_dictionary); } - if (_dbRefList != null) { + if (_dbRefList != null + && !org.castor.util.CycleBreaker.startingToCycle(_dbRefList)) { result = 37 * result + _dbRefList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_dbRefList); } - if (_vxrefList != null) { + if (_vxrefList != null + && !org.castor.util.CycleBreaker.startingToCycle(_vxrefList)) { result = 37 * result + _vxrefList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_vxrefList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/SequenceMapping.java b/src/uk/ac/vamsas/objects/core/SequenceMapping.java index e7776a7..7f7bcb0 100644 --- a/src/uk/ac/vamsas/objects/core/SequenceMapping.java +++ b/src/uk/ac/vamsas/objects/core/SequenceMapping.java @@ -19,7 +19,7 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class SequenceMapping extends uk.ac.vamsas.client.Vobject +public class SequenceMapping extends uk.ac.vamsas.objects.core.MapType implements java.io.Serializable { @@ -29,14 +29,16 @@ implements java.io.Serializable //--------------------------/ /** - * Field _sequenceA. + * Object on which the local + * range is defined. */ - private java.lang.Object _sequenceA; + private java.lang.Object _loc; /** - * Field _sequenceB. + * Object on which the mapped + * range is defined. */ - private java.lang.Object _sequenceB; + private java.lang.Object _map; /** * Field _id. @@ -44,11 +46,6 @@ implements java.io.Serializable private java.lang.String _id; /** - * Field _rangeList. - */ - private java.util.Vector _rangeList; - - /** * Field _provenance. */ private uk.ac.vamsas.objects.core.Provenance _provenance; @@ -60,7 +57,6 @@ implements java.io.Serializable public SequenceMapping() { super(); - this._rangeList = new java.util.Vector(); } @@ -69,45 +65,6 @@ implements java.io.Serializable //-----------/ /** - * - * - * @param vRange - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addRange( - final uk.ac.vamsas.objects.core.Range vRange) - throws java.lang.IndexOutOfBoundsException { - this._rangeList.addElement(vRange); - } - - /** - * - * - * @param index - * @param vRange - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addRange( - final int index, - final uk.ac.vamsas.objects.core.Range vRange) - throws java.lang.IndexOutOfBoundsException { - this._rangeList.add(index, vRange); - } - - /** - * Method enumerateRange. - * - * @return an Enumeration over all - * uk.ac.vamsas.objects.core.Range elements - */ - public java.util.Enumeration enumerateRange( - ) { - return this._rangeList.elements(); - } - - /** * Overrides the java.lang.Object.equals method. * * @param obj @@ -124,40 +81,95 @@ implements java.io.Serializable if (obj instanceof SequenceMapping) { SequenceMapping temp = (SequenceMapping)obj; - if (this._sequenceA != null) { - if (temp._sequenceA == null) return false; - else if (!(this._sequenceA.equals(temp._sequenceA))) - return false; - } - else if (temp._sequenceA != null) + boolean thcycle; + boolean tmcycle; + if (this._loc != null) { + if (temp._loc == null) return false; + if (this._loc != temp._loc) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._loc); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._loc); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._loc); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc); }; + return false; + } + if (!thcycle) { + if (!this._loc.equals(temp._loc)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._loc); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._loc); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc); + } + } + } else if (temp._loc != null) return false; - if (this._sequenceB != null) { - if (temp._sequenceB == null) return false; - else if (!(this._sequenceB.equals(temp._sequenceB))) - return false; - } - else if (temp._sequenceB != null) + if (this._map != null) { + if (temp._map == null) return false; + if (this._map != temp._map) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._map); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._map); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._map); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._map); }; + return false; + } + if (!thcycle) { + if (!this._map.equals(temp._map)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._map); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._map); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._map); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._map); + } + } + } else if (temp._map != null) return false; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) - return false; - if (this._rangeList != null) { - if (temp._rangeList == null) return false; - else if (!(this._rangeList.equals(temp._rangeList))) - return false; - } - else if (temp._rangeList != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._provenance != null) { if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) + if (this._provenance != temp._provenance) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); }; + return false; + } + if (!thcycle) { + if (!this._provenance.equals(temp._provenance)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + } + } + } else if (temp._provenance != null) return false; return true; } @@ -175,90 +187,37 @@ implements java.io.Serializable } /** - * Returns the value of field 'provenance'. - * - * @return the value of field 'Provenance'. - */ - public uk.ac.vamsas.objects.core.Provenance getProvenance( - ) { - return this._provenance; - } - - /** - * Method getRange. - * - * @param index - * @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.Range at - * the given index - */ - public uk.ac.vamsas.objects.core.Range getRange( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._rangeList.size()) { - throw new IndexOutOfBoundsException("getRange: Index value '" + index + "' not in range [0.." + (this._rangeList.size() - 1) + "]"); - } - - return (uk.ac.vamsas.objects.core.Range) _rangeList.get(index); - } - - /** - * Method getRange.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. + * Returns the value of field 'loc'. The field 'loc' has the + * following description: Object on which the local + * range is defined. * - * @return this collection as an Array + * @return the value of field 'Loc'. */ - public uk.ac.vamsas.objects.core.Range[] getRange( + public java.lang.Object getLoc( ) { - uk.ac.vamsas.objects.core.Range[] array = new uk.ac.vamsas.objects.core.Range[0]; - return (uk.ac.vamsas.objects.core.Range[]) this._rangeList.toArray(array); + return this._loc; } /** - * Method getRangeAsReference.Returns a reference to - * '_rangeList'. No type checking is performed on any - * modifications to the Vector. + * Returns the value of field 'map'. The field 'map' has the + * following description: Object on which the mapped + * range is defined. * - * @return a reference to the Vector backing this class + * @return the value of field 'Map'. */ - public java.util.Vector getRangeAsReference( + public java.lang.Object getMap( ) { - return this._rangeList; + return this._map; } /** - * Method getRangeCount. - * - * @return the size of this collection - */ - public int getRangeCount( - ) { - return this._rangeList.size(); - } - - /** - * Returns the value of field 'sequenceA'. - * - * @return the value of field 'SequenceA'. - */ - public java.lang.Object getSequenceA( - ) { - return this._sequenceA; - } - - /** - * Returns the value of field 'sequenceB'. + * Returns the value of field 'provenance'. * - * @return the value of field 'SequenceB'. + * @return the value of field 'Provenance'. */ - public java.lang.Object getSequenceB( + public uk.ac.vamsas.objects.core.Provenance getProvenance( ) { - return this._sequenceB; + return this._provenance; } /** @@ -274,20 +233,25 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_sequenceA != null) { - result = 37 * result + _sequenceA.hashCode(); + if (_loc != null + && !org.castor.util.CycleBreaker.startingToCycle(_loc)) { + result = 37 * result + _loc.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_loc); } - if (_sequenceB != null) { - result = 37 * result + _sequenceB.hashCode(); + if (_map != null + && !org.castor.util.CycleBreaker.startingToCycle(_map)) { + result = 37 * result + _map.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_map); } - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_rangeList != null) { - result = 37 * result + _rangeList.hashCode(); - } - if (_provenance != null) { + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); } return result; @@ -341,37 +305,6 @@ implements java.io.Serializable } /** - */ - public void removeAllRange( - ) { - this._rangeList.clear(); - } - - /** - * Method removeRange. - * - * @param vRange - * @return true if the object was removed from the collection. - */ - public boolean removeRange( - final uk.ac.vamsas.objects.core.Range vRange) { - boolean removed = _rangeList.remove(vRange); - return removed; - } - - /** - * Method removeRangeAt. - * - * @param index - * @return the element removed from the collection - */ - public uk.ac.vamsas.objects.core.Range removeRangeAt( - final int index) { - java.lang.Object obj = this._rangeList.remove(index); - return (uk.ac.vamsas.objects.core.Range) obj; - } - - /** * Sets the value of field 'id'. * * @param id the value of field 'id'. @@ -382,94 +315,37 @@ implements java.io.Serializable } /** - * Sets the value of field 'provenance'. - * - * @param provenance the value of field 'provenance'. - */ - public void setProvenance( - final uk.ac.vamsas.objects.core.Provenance provenance) { - this._provenance = provenance; - } - - /** + * Sets the value of field 'loc'. The field 'loc' has the + * following description: Object on which the local + * range is defined. * - * - * @param index - * @param vRange - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setRange( - final int index, - final uk.ac.vamsas.objects.core.Range vRange) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._rangeList.size()) { - throw new IndexOutOfBoundsException("setRange: Index value '" + index + "' not in range [0.." + (this._rangeList.size() - 1) + "]"); - } - - this._rangeList.set(index, vRange); - } - - /** - * - * - * @param vRangeArray + * @param loc the value of field 'loc'. */ - public void setRange( - final uk.ac.vamsas.objects.core.Range[] vRangeArray) { - //-- copy array - _rangeList.clear(); - - for (int i = 0; i < vRangeArray.length; i++) { - this._rangeList.add(vRangeArray[i]); - } + public void setLoc( + final java.lang.Object loc) { + this._loc = loc; } /** - * Sets the value of '_rangeList' by copying the given Vector. - * All elements will be checked for type safety. + * Sets the value of field 'map'. The field 'map' has the + * following description: Object on which the mapped + * range is defined. * - * @param vRangeList the Vector to copy. + * @param map the value of field 'map'. */ - public void setRange( - final java.util.Vector vRangeList) { - // copy vector - this._rangeList.clear(); - - this._rangeList.addAll(vRangeList); + public void setMap( + final java.lang.Object map) { + this._map = map; } /** - * Sets the value of '_rangeList' by setting it to the given - * Vector. No type checking is performed. - * @deprecated - * - * @param rangeVector the Vector to set. - */ - public void setRangeAsReference( - final java.util.Vector rangeVector) { - this._rangeList = rangeVector; - } - - /** - * Sets the value of field 'sequenceA'. - * - * @param sequenceA the value of field 'sequenceA'. - */ - public void setSequenceA( - final java.lang.Object sequenceA) { - this._sequenceA = sequenceA; - } - - /** - * Sets the value of field 'sequenceB'. + * Sets the value of field 'provenance'. * - * @param sequenceB the value of field 'sequenceB'. + * @param provenance the value of field 'provenance'. */ - public void setSequenceB( - final java.lang.Object sequenceB) { - this._sequenceB = sequenceB; + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { + this._provenance = provenance; } /** @@ -480,13 +356,12 @@ implements java.io.Serializable * 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.SequenceMapping + * @return the unmarshaled uk.ac.vamsas.objects.core.MapType */ - public static uk.ac.vamsas.objects.core.SequenceMapping unmarshal( + public static uk.ac.vamsas.objects.core.MapType unmarshal( final java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (uk.ac.vamsas.objects.core.SequenceMapping) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.SequenceMapping.class, reader); + return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.SequenceMapping.class, reader); } /** diff --git a/src/uk/ac/vamsas/objects/core/SequenceType.java b/src/uk/ac/vamsas/objects/core/SequenceType.java index 6b25c6f..1a89b6c 100644 --- a/src/uk/ac/vamsas/objects/core/SequenceType.java +++ b/src/uk/ac/vamsas/objects/core/SequenceType.java @@ -153,6 +153,8 @@ implements java.io.Serializable if (obj instanceof SequenceType) { SequenceType temp = (SequenceType)obj; + boolean thcycle; + boolean tmcycle; if (this._start != temp._start) return false; if (this._has_start != temp._has_start) @@ -163,31 +165,91 @@ implements java.io.Serializable return false; if (this._sequence != null) { if (temp._sequence == null) return false; - else if (!(this._sequence.equals(temp._sequence))) - return false; - } - else if (temp._sequence != null) + if (this._sequence != temp._sequence) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequence); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequence); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequence); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequence); }; + return false; + } + if (!thcycle) { + if (!this._sequence.equals(temp._sequence)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._sequence); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequence); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._sequence); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequence); + } + } + } else if (temp._sequence != null) return false; if (this._name != null) { if (temp._name == null) return false; - else if (!(this._name.equals(temp._name))) - return false; - } - else if (temp._name != null) + if (this._name != temp._name) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); }; + return false; + } + if (!thcycle) { + if (!this._name.equals(temp._name)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._name); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); + } + } + } else if (temp._name != null) return false; if (this._description != null) { if (temp._description == null) return false; - else if (!(this._description.equals(temp._description))) - return false; - } - else if (temp._description != null) + if (this._description != temp._description) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._description); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._description); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._description); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); }; + return false; + } + if (!thcycle) { + if (!this._description.equals(temp._description)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._description); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._description); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); + } + } + } else if (temp._description != null) return false; if (this._propertyList != null) { if (temp._propertyList == null) return false; - else if (!(this._propertyList.equals(temp._propertyList))) - return false; - } - else if (temp._propertyList != null) + if (this._propertyList != temp._propertyList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); }; + return false; + } + if (!thcycle) { + if (!this._propertyList.equals(temp._propertyList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + } + } + } else if (temp._propertyList != null) return false; return true; } @@ -336,17 +398,25 @@ implements java.io.Serializable long tmp; result = 37 * result + (int)(_start^(_start>>>32)); result = 37 * result + (int)(_end^(_end>>>32)); - if (_sequence != null) { + if (_sequence != null + && !org.castor.util.CycleBreaker.startingToCycle(_sequence)) { result = 37 * result + _sequence.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_sequence); } - if (_name != null) { + if (_name != null + && !org.castor.util.CycleBreaker.startingToCycle(_name)) { result = 37 * result + _name.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_name); } - if (_description != null) { + if (_description != null + && !org.castor.util.CycleBreaker.startingToCycle(_description)) { result = 37 * result + _description.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_description); } - if (_propertyList != null) { + if (_propertyList != null + && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) { result = 37 * result + _propertyList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Tree.java b/src/uk/ac/vamsas/objects/core/Tree.java index 5c0e72a..39eb763 100644 --- a/src/uk/ac/vamsas/objects/core/Tree.java +++ b/src/uk/ac/vamsas/objects/core/Tree.java @@ -49,9 +49,8 @@ implements java.io.Serializable private java.util.Vector _newickList; /** - * node identity and mapping data between tree representations - * and vamsas document objects - * + * node identity and mapping data between tree + * representations and vamsas document objects */ private java.util.Vector _treenodeList; @@ -216,54 +215,161 @@ implements java.io.Serializable if (obj instanceof Tree) { Tree temp = (Tree)obj; + boolean thcycle; + boolean tmcycle; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._modifiable != null) { if (temp._modifiable == null) return false; - else if (!(this._modifiable.equals(temp._modifiable))) - return false; - } - else if (temp._modifiable != null) + if (this._modifiable != temp._modifiable) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); }; + return false; + } + if (!thcycle) { + if (!this._modifiable.equals(temp._modifiable)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + } + } + } else if (temp._modifiable != null) return false; if (this._title != null) { if (temp._title == null) return false; - else if (!(this._title.equals(temp._title))) - return false; - } - else if (temp._title != null) + if (this._title != temp._title) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._title); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._title); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._title); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); }; + return false; + } + if (!thcycle) { + if (!this._title.equals(temp._title)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._title); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._title); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); + } + } + } else if (temp._title != null) return false; if (this._newickList != null) { if (temp._newickList == null) return false; - else if (!(this._newickList.equals(temp._newickList))) - return false; - } - else if (temp._newickList != null) + if (this._newickList != temp._newickList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._newickList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._newickList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList); }; + return false; + } + if (!thcycle) { + if (!this._newickList.equals(temp._newickList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList); + } + } + } else if (temp._newickList != null) return false; if (this._treenodeList != null) { if (temp._treenodeList == null) return false; - else if (!(this._treenodeList.equals(temp._treenodeList))) - return false; - } - else if (temp._treenodeList != null) + if (this._treenodeList != temp._treenodeList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treenodeList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treenodeList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList); }; + return false; + } + if (!thcycle) { + if (!this._treenodeList.equals(temp._treenodeList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList); + } + } + } else if (temp._treenodeList != null) return false; if (this._propertyList != null) { if (temp._propertyList == null) return false; - else if (!(this._propertyList.equals(temp._propertyList))) - return false; - } - else if (temp._propertyList != null) + if (this._propertyList != temp._propertyList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); }; + return false; + } + if (!thcycle) { + if (!this._propertyList.equals(temp._propertyList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); + } + } + } else if (temp._propertyList != null) return false; if (this._provenance != null) { if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) + if (this._provenance != temp._provenance) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); }; + return false; + } + if (!thcycle) { + if (!this._provenance.equals(temp._provenance)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + } + } + } else if (temp._provenance != null) return false; return true; } @@ -496,26 +602,40 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_modifiable != null) { + if (_modifiable != null + && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) { result = 37 * result + _modifiable.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable); } - if (_title != null) { + if (_title != null + && !org.castor.util.CycleBreaker.startingToCycle(_title)) { result = 37 * result + _title.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_title); } - if (_newickList != null) { + if (_newickList != null + && !org.castor.util.CycleBreaker.startingToCycle(_newickList)) { result = 37 * result + _newickList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_newickList); } - if (_treenodeList != null) { + if (_treenodeList != null + && !org.castor.util.CycleBreaker.startingToCycle(_treenodeList)) { result = 37 * result + _treenodeList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_treenodeList); } - if (_propertyList != null) { + if (_propertyList != null + && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) { result = 37 * result + _propertyList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList); } - if (_provenance != null) { + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Treenode.java b/src/uk/ac/vamsas/objects/core/Treenode.java index 320f7de..1a8620e 100644 --- a/src/uk/ac/vamsas/objects/core/Treenode.java +++ b/src/uk/ac/vamsas/objects/core/Treenode.java @@ -15,9 +15,8 @@ import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; /** - * node identity and mapping data between tree representations and - * vamsas document objects - * + * node identity and mapping data between tree + * representations and vamsas document objects * * @version $Revision$ $Date$ */ @@ -31,16 +30,15 @@ implements java.io.Serializable //--------------------------/ /** - * reference to one or more trees containing the node being - * described. - * + * reference to one or more trees containing + * the node being described. */ private java.util.Vector _treeId; /** - * String uniquely identifying a particular node in the - * referenced tree according to the format of the tree - * representation that is referenced. + * String uniquely identifying a particular + * node in the referenced tree according to the format of + * the tree representation that is referenced. * */ private java.lang.String _nodespec; @@ -115,19 +113,51 @@ implements java.io.Serializable if (obj instanceof Treenode) { Treenode temp = (Treenode)obj; + boolean thcycle; + boolean tmcycle; if (this._treeId != null) { if (temp._treeId == null) return false; - else if (!(this._treeId.equals(temp._treeId))) - return false; - } - else if (temp._treeId != null) + if (this._treeId != temp._treeId) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeId); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeId); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeId); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeId); }; + return false; + } + if (!thcycle) { + if (!this._treeId.equals(temp._treeId)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._treeId); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeId); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._treeId); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeId); + } + } + } else if (temp._treeId != null) return false; if (this._nodespec != null) { if (temp._nodespec == null) return false; - else if (!(this._nodespec.equals(temp._nodespec))) - return false; - } - else if (temp._nodespec != null) + if (this._nodespec != temp._nodespec) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._nodespec); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._nodespec); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._nodespec); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._nodespec); }; + return false; + } + if (!thcycle) { + if (!this._nodespec.equals(temp._nodespec)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._nodespec); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._nodespec); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._nodespec); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._nodespec); + } + } + } else if (temp._nodespec != null) return false; return true; } @@ -137,8 +167,9 @@ implements java.io.Serializable /** * Returns the value of field 'nodespec'. The field 'nodespec' * has the following description: String uniquely identifying a - * particular node in the referenced tree according to the - * format of the tree representation that is referenced. + * particular + * node in the referenced tree according to the format of + * the tree representation that is referenced. * * * @return the value of field 'Nodespec'. @@ -217,11 +248,15 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_treeId != null) { + if (_treeId != null + && !org.castor.util.CycleBreaker.startingToCycle(_treeId)) { result = 37 * result + _treeId.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_treeId); } - if (_nodespec != null) { + if (_nodespec != null + && !org.castor.util.CycleBreaker.startingToCycle(_nodespec)) { result = 37 * result + _nodespec.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_nodespec); } return result; @@ -308,8 +343,9 @@ implements java.io.Serializable /** * Sets the value of field 'nodespec'. The field 'nodespec' has * the following description: String uniquely identifying a - * particular node in the referenced tree according to the - * format of the tree representation that is referenced. + * particular + * node in the referenced tree according to the format of + * the tree representation that is referenced. * * * @param nodespec the value of field 'nodespec'. diff --git a/src/uk/ac/vamsas/objects/core/User.java b/src/uk/ac/vamsas/objects/core/User.java index 50f860e..0339959 100644 --- a/src/uk/ac/vamsas/objects/core/User.java +++ b/src/uk/ac/vamsas/objects/core/User.java @@ -69,19 +69,51 @@ implements java.io.Serializable if (obj instanceof User) { User temp = (User)obj; + boolean thcycle; + boolean tmcycle; if (this._fullname != null) { if (temp._fullname == null) return false; - else if (!(this._fullname.equals(temp._fullname))) - return false; - } - else if (temp._fullname != null) + if (this._fullname != temp._fullname) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._fullname); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._fullname); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname); }; + return false; + } + if (!thcycle) { + if (!this._fullname.equals(temp._fullname)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname); + } + } + } else if (temp._fullname != null) return false; if (this._organization != null) { if (temp._organization == null) return false; - else if (!(this._organization.equals(temp._organization))) - return false; - } - else if (temp._organization != null) + if (this._organization != temp._organization) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._organization); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._organization); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._organization); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization); }; + return false; + } + if (!thcycle) { + if (!this._organization.equals(temp._organization)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._organization); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._organization); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization); + } + } + } else if (temp._organization != null) return false; return true; } @@ -121,11 +153,15 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_fullname != null) { + if (_fullname != null + && !org.castor.util.CycleBreaker.startingToCycle(_fullname)) { result = 37 * result + _fullname.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_fullname); } - if (_organization != null) { + if (_organization != null + && !org.castor.util.CycleBreaker.startingToCycle(_organization)) { result = 37 * result + _organization.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_organization); } return result; diff --git a/src/uk/ac/vamsas/objects/core/VAMSAS.java b/src/uk/ac/vamsas/objects/core/VAMSAS.java index ba8146f..a762b20 100644 --- a/src/uk/ac/vamsas/objects/core/VAMSAS.java +++ b/src/uk/ac/vamsas/objects/core/VAMSAS.java @@ -160,33 +160,95 @@ implements java.io.Serializable if (obj instanceof VAMSAS) { VAMSAS temp = (VAMSAS)obj; + boolean thcycle; + boolean tmcycle; if (this._id != null) { if (temp._id == null) return false; - else if (!(this._id.equals(temp._id))) - return false; - } - else if (temp._id != null) + if (this._id != temp._id) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); }; + return false; + } + if (!thcycle) { + if (!this._id.equals(temp._id)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._id); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); + } + } + } else if (temp._id != null) return false; if (this._modifiable != null) { if (temp._modifiable == null) return false; - else if (!(this._modifiable.equals(temp._modifiable))) - return false; - } - else if (temp._modifiable != null) + if (this._modifiable != temp._modifiable) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); }; + return false; + } + if (!thcycle) { + if (!this._modifiable.equals(temp._modifiable)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); + } + } + } else if (temp._modifiable != null) return false; if (this._treeList != null) { if (temp._treeList == null) return false; - else if (!(this._treeList.equals(temp._treeList))) - return false; - } - else if (temp._treeList != null) + if (this._treeList != temp._treeList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); }; + return false; + } + if (!thcycle) { + if (!this._treeList.equals(temp._treeList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); + } + } + } else if (temp._treeList != null) return false; if (this._dataSetList != null) { if (temp._dataSetList == null) return false; - else if (!(this._dataSetList.equals(temp._dataSetList))) - return false; - } - else if (temp._dataSetList != null) + if (this._dataSetList != temp._dataSetList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataSetList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataSetList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetList); }; + return false; + } + if (!thcycle) { + if (!this._dataSetList.equals(temp._dataSetList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetList); + } + } + } else if (temp._dataSetList != null) return false; return true; } @@ -342,17 +404,25 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_id != null) { + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); } - if (_modifiable != null) { + if (_modifiable != null + && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) { result = 37 * result + _modifiable.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable); } - if (_treeList != null) { + if (_treeList != null + && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) { result = 37 * result + _treeList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_treeList); } - if (_dataSetList != null) { + if (_dataSetList != null + && !org.castor.util.CycleBreaker.startingToCycle(_dataSetList)) { result = 37 * result + _dataSetList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_dataSetList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/VamsasDocument.java b/src/uk/ac/vamsas/objects/core/VamsasDocument.java index 1114663..10ee854 100644 --- a/src/uk/ac/vamsas/objects/core/VamsasDocument.java +++ b/src/uk/ac/vamsas/objects/core/VamsasDocument.java @@ -210,47 +210,139 @@ implements java.io.Serializable if (obj instanceof VamsasDocument) { VamsasDocument temp = (VamsasDocument)obj; + boolean thcycle; + boolean tmcycle; if (this._version != null) { if (temp._version == null) return false; - else if (!(this._version.equals(temp._version))) - return false; - } - else if (temp._version != null) + if (this._version != temp._version) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._version); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._version); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._version); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); }; + return false; + } + if (!thcycle) { + if (!this._version.equals(temp._version)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._version); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._version); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); + } + } + } else if (temp._version != null) return false; if (this._lockFile != null) { if (temp._lockFile == null) return false; - else if (!(this._lockFile.equals(temp._lockFile))) - return false; - } - else if (temp._lockFile != null) + if (this._lockFile != temp._lockFile) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._lockFile); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._lockFile); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile); }; + return false; + } + if (!thcycle) { + if (!this._lockFile.equals(temp._lockFile)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile); + } + } + } else if (temp._lockFile != null) return false; if (this._provenance != null) { if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) + if (this._provenance != temp._provenance) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); }; + return false; + } + if (!thcycle) { + if (!this._provenance.equals(temp._provenance)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); + } + } + } else if (temp._provenance != null) return false; if (this._VAMSASList != null) { if (temp._VAMSASList == null) return false; - else if (!(this._VAMSASList.equals(temp._VAMSASList))) - return false; - } - else if (temp._VAMSASList != null) + if (this._VAMSASList != temp._VAMSASList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._VAMSASList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._VAMSASList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList); }; + return false; + } + if (!thcycle) { + if (!this._VAMSASList.equals(temp._VAMSASList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList); + } + } + } else if (temp._VAMSASList != null) return false; if (this._applicationDataList != null) { if (temp._applicationDataList == null) return false; - else if (!(this._applicationDataList.equals(temp._applicationDataList))) - return false; - } - else if (temp._applicationDataList != null) + if (this._applicationDataList != temp._applicationDataList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._applicationDataList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._applicationDataList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._applicationDataList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._applicationDataList); }; + return false; + } + if (!thcycle) { + if (!this._applicationDataList.equals(temp._applicationDataList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._applicationDataList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._applicationDataList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._applicationDataList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._applicationDataList); + } + } + } else if (temp._applicationDataList != null) return false; if (this._attachmentList != null) { if (temp._attachmentList == null) return false; - else if (!(this._attachmentList.equals(temp._attachmentList))) - return false; - } - else if (temp._attachmentList != null) + if (this._attachmentList != temp._attachmentList) { + thcycle=org.castor.util.CycleBreaker.startingToCycle(this._attachmentList); + tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._attachmentList); + if (thcycle!=tmcycle) { + if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._attachmentList); }; + if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._attachmentList); }; + return false; + } + if (!thcycle) { + if (!this._attachmentList.equals(temp._attachmentList)) { + org.castor.util.CycleBreaker.releaseCycleHandle(this._attachmentList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._attachmentList); + return false; + } + org.castor.util.CycleBreaker.releaseCycleHandle(this._attachmentList); + org.castor.util.CycleBreaker.releaseCycleHandle(temp._attachmentList); + } + } + } else if (temp._attachmentList != null) return false; return true; } @@ -474,23 +566,35 @@ implements java.io.Serializable int result = super.hashCode(); long tmp; - if (_version != null) { + if (_version != null + && !org.castor.util.CycleBreaker.startingToCycle(_version)) { result = 37 * result + _version.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_version); } - if (_lockFile != null) { + if (_lockFile != null + && !org.castor.util.CycleBreaker.startingToCycle(_lockFile)) { result = 37 * result + _lockFile.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_lockFile); } - if (_provenance != null) { + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); } - if (_VAMSASList != null) { + if (_VAMSASList != null + && !org.castor.util.CycleBreaker.startingToCycle(_VAMSASList)) { result = 37 * result + _VAMSASList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_VAMSASList); } - if (_applicationDataList != null) { + if (_applicationDataList != null + && !org.castor.util.CycleBreaker.startingToCycle(_applicationDataList)) { result = 37 * result + _applicationDataList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_applicationDataList); } - if (_attachmentList != null) { + if (_attachmentList != null + && !org.castor.util.CycleBreaker.startingToCycle(_attachmentList)) { result = 37 * result + _attachmentList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_attachmentList); } return result; diff --git a/src/uk/ac/vamsas/objects/core/Vref.java b/src/uk/ac/vamsas/objects/core/Vref.java index 3c79e83..87f0444 100644 --- a/src/uk/ac/vamsas/objects/core/Vref.java +++ b/src/uk/ac/vamsas/objects/core/Vref.java @@ -15,7 +15,8 @@ import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; /** - * Direct associations between this node and any vamsas objects + * Direct associations between this node and any vamsas + * objects * * @version $Revision$ $Date$ */ diff --git a/src/uk/ac/vamsas/objects/core/Vxref.java b/src/uk/ac/vamsas/objects/core/Vxref.java index e8e55b9..0614ee1 100644 --- a/src/uk/ac/vamsas/objects/core/Vxref.java +++ b/src/uk/ac/vamsas/objects/core/Vxref.java @@ -15,9 +15,8 @@ import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; /** - * explicitly named cross reference to other objects in the - * document. - * + * explicitly named cross reference to + * other objects in the document. * * @version $Revision$ $Date$ */ diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java index e7c8e9a..3edd3e3 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java @@ -45,11 +45,6 @@ public class AlignmentAnnotationDescriptor extends uk.ac.vamsas.objects.core.des */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -218,10 +213,7 @@ public class AlignmentAnnotationDescriptor extends uk.ac.vamsas.objects.core.des */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java index 2c67213..4d3607e 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java @@ -45,11 +45,6 @@ public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDesc */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -150,7 +145,7 @@ public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDesc 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; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -452,7 +447,7 @@ public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDesc */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java index 1f52e65..44d0c00 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java @@ -45,11 +45,6 @@ public class AlignmentSequenceAnnotationDescriptor extends uk.ac.vamsas.objects. */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -172,10 +167,7 @@ public class AlignmentSequenceAnnotationDescriptor extends uk.ac.vamsas.objects. */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java index 526c7f0..d1b7830 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java @@ -45,11 +45,6 @@ public class AlignmentSequenceDescriptor extends uk.ac.vamsas.objects.core.descr */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -71,7 +66,7 @@ public class AlignmentSequenceDescriptor extends uk.ac.vamsas.objects.core.descr //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - this._identity = desc; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -212,10 +207,7 @@ public class AlignmentSequenceDescriptor extends uk.ac.vamsas.objects.core.descr */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java index 68ab2fb..1e98793 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java @@ -45,11 +45,6 @@ public class AnnotationElementDescriptor extends org.exolab.castor.xml.util.XMLC */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -152,7 +147,7 @@ public class AnnotationElementDescriptor extends org.exolab.castor.xml.util.XMLC 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; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -343,7 +338,7 @@ public class AnnotationElementDescriptor extends org.exolab.castor.xml.util.XMLC */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java index 248fe43..dab611a 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java @@ -45,11 +45,6 @@ public class AppDataDescriptor extends org.exolab.castor.xml.util.XMLClassDescri */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -170,7 +165,7 @@ public class AppDataDescriptor extends org.exolab.castor.xml.util.XMLClassDescri */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java index 7465b32..79c6364 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java @@ -45,11 +45,6 @@ public class ApplicationDataDescriptor extends uk.ac.vamsas.objects.core.descrip */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -291,10 +286,7 @@ public class ApplicationDataDescriptor extends uk.ac.vamsas.objects.core.descrip */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java index 449d40d..d6b5823 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java @@ -45,11 +45,6 @@ public class AttachmentDescriptor extends uk.ac.vamsas.objects.core.descriptors. */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -186,7 +181,7 @@ public class AttachmentDescriptor extends uk.ac.vamsas.objects.core.descriptors. 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; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -247,10 +242,7 @@ public class AttachmentDescriptor extends uk.ac.vamsas.objects.core.descriptors. */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java index 81bd029..d4ec584 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java @@ -45,11 +45,6 @@ public class CommonDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppD */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -86,10 +81,7 @@ public class CommonDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppD */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java index 44090ca..ec113d2 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java @@ -45,11 +45,6 @@ public class DataSetAnnotationsDescriptor extends uk.ac.vamsas.objects.core.desc */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -178,10 +173,7 @@ public class DataSetAnnotationsDescriptor extends uk.ac.vamsas.objects.core.desc */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java index 29c2ead..f677adf 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java @@ -45,11 +45,6 @@ public class DataSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescri */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -70,7 +65,7 @@ public class DataSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescri //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - this._identity = desc; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -377,7 +372,7 @@ public class DataSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescri */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java index 762b51a..ef04791 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java @@ -45,11 +45,6 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -187,7 +182,7 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript 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; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -223,8 +218,8 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript 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); + //-- _map + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Map.class, "_map", "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 @@ -237,15 +232,7 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript { 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(); + target.setMap( (uk.ac.vamsas.objects.core.Map) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } @@ -256,12 +243,11 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript }; desc.setHandler(handler); desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); - desc.setMultivalued(true); + desc.setMultivalued(false); addFieldDescriptor(desc); - //-- validation code for: _mapList + //-- validation code for: _map fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); { //-- local scope } desc.setValidator(fieldValidator); @@ -374,7 +360,7 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java index 0dcf72b..6b3eb45 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java @@ -45,11 +45,6 @@ public class EntryDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -70,7 +65,7 @@ public class EntryDescriptor extends org.exolab.castor.xml.util.XMLClassDescript //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - this._identity = desc; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -417,7 +412,7 @@ public class EntryDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java index da9afa4..0d694f0 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java @@ -45,11 +45,6 @@ public class GlyphDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -165,7 +160,7 @@ public class GlyphDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java index 6c30b35..649ff90 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java @@ -45,11 +45,6 @@ public class InputDescriptor extends uk.ac.vamsas.objects.core.descriptors.Range */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -178,10 +173,7 @@ public class InputDescriptor extends uk.ac.vamsas.objects.core.descriptors.Range */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java index 68631e5..d24131a 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java @@ -45,11 +45,6 @@ public class InstanceDescriptor extends uk.ac.vamsas.objects.core.descriptors.Ap */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -132,10 +127,7 @@ public class InstanceDescriptor extends uk.ac.vamsas.objects.core.descriptors.Ap */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java index ba1f82b..e8c70a5 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java @@ -45,11 +45,6 @@ public class LinkDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -160,7 +155,7 @@ public class LinkDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/LocalDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/LocalDescriptor.java new file mode 100644 index 0000000..409177c --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/LocalDescriptor.java @@ -0,0 +1,151 @@ +/* + * 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.Local; + +/** + * Class LocalDescriptor. + * + * @version $Revision$ $Date$ + */ +public class LocalDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor { + + + //--------------------------/ + //- 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; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public LocalDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "local"; + _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( + ) { + return super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Local.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 index 68e512f..26cd7cc 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java @@ -45,11 +45,6 @@ public class LockFileDescriptor extends org.exolab.castor.xml.util.XMLClassDescr */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -128,7 +123,7 @@ public class LockFileDescriptor extends org.exolab.castor.xml.util.XMLClassDescr */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java index 94e54bb..14efb4b 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java @@ -18,7 +18,7 @@ import uk.ac.vamsas.objects.core.Map; * * @version $Revision$ $Date$ */ -public class MapDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapListDescriptor { +public class MapDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor { //--------------------------/ @@ -45,11 +45,6 @@ public class MapDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapList */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -57,10 +52,53 @@ public class MapDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapList public MapDescriptor() { super(); - setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapListDescriptor()); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor()); _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; _xmlName = "map"; _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 + + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + super.setIdentity(desc); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Map target = (Map) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Map target = (Map) 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 + } @@ -86,10 +124,7 @@ public class MapDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapList */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MapRangeTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MapRangeTypeDescriptor.java new file mode 100644 index 0000000..174449d --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/MapRangeTypeDescriptor.java @@ -0,0 +1,200 @@ +/* + * 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.MapRangeType; + +/** + * Class MapRangeTypeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class MapRangeTypeDescriptor 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; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public MapRangeTypeDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "mapRangeType"; + _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 + + //-- _unit + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_unit", "unit", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + MapRangeType target = (MapRangeType) object; + if (!target.hasUnit()) { return null; } + return new java.lang.Long(target.getUnit()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + MapRangeType target = (MapRangeType) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteUnit(); + return; + } + target.setUnit( ((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: _unit + 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); + typeValidator.setMinInclusive(1L); + } + 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 super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.MapRangeType.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/MapTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MapTypeDescriptor.java new file mode 100644 index 0000000..39ee736 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/MapTypeDescriptor.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.MapType; + +/** + * Class MapTypeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class MapTypeDescriptor 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; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public MapTypeDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "mapType"; + _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 + + //-- initialize element descriptors + + //-- _local + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Local.class, "_local", "local", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + MapType target = (MapType) object; + return target.getLocal(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + MapType target = (MapType) object; + target.setLocal( (uk.ac.vamsas.objects.core.Local) 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.Local(); + } + }; + 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: _local + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _mapped + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Mapped.class, "_mapped", "mapped", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + MapType target = (MapType) object; + return target.getMapped(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + MapType target = (MapType) object; + target.setMapped( (uk.ac.vamsas.objects.core.Mapped) 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.Mapped(); + } + }; + 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: _mapped + 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 super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.MapType.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/MappedDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MappedDescriptor.java new file mode 100644 index 0000000..9162ab5 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/MappedDescriptor.java @@ -0,0 +1,151 @@ +/* + * 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.Mapped; + +/** + * Class MappedDescriptor. + * + * @version $Revision$ $Date$ + */ +public class MappedDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor { + + + //--------------------------/ + //- 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; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public MappedDescriptor() { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor()); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "mapped"; + _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( + ) { + return super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Mapped.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 index 757db07..ba76c79 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java @@ -45,11 +45,6 @@ public class NewickDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -140,7 +135,7 @@ public class NewickDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip 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; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -238,7 +233,7 @@ public class NewickDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/NodeTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/NodeTypeDescriptor.java index 5594c98..88f0791 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/NodeTypeDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/NodeTypeDescriptor.java @@ -45,11 +45,6 @@ public class NodeTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescr */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -70,7 +65,7 @@ public class NodeTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescr //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - this._identity = desc; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -328,7 +323,7 @@ public class NodeTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescr */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java index 86d432e..ce563d4 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java @@ -45,11 +45,6 @@ public class ParamDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -206,7 +201,7 @@ public class ParamDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java index 9973982..5c8c8d8 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java @@ -45,11 +45,6 @@ public class PosDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptor */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -135,7 +130,7 @@ public class PosDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptor */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java index e9346ad..aaf5f97 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java @@ -45,11 +45,6 @@ public class PropertyDescriptor extends org.exolab.castor.xml.util.XMLClassDescr */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -206,7 +201,7 @@ public class PropertyDescriptor extends org.exolab.castor.xml.util.XMLClassDescr */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java index d5f6d45..3572880 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java @@ -45,11 +45,6 @@ public class ProvenanceDescriptor extends org.exolab.castor.xml.util.XMLClassDes */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -138,7 +133,7 @@ public class ProvenanceDescriptor extends org.exolab.castor.xml.util.XMLClassDes */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java index 1184f06..6d3be6a 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java @@ -45,11 +45,6 @@ public class RangeAnnotationDescriptor extends uk.ac.vamsas.objects.core.descrip */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -71,7 +66,7 @@ public class RangeAnnotationDescriptor extends uk.ac.vamsas.objects.core.descrip //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - this._identity = desc; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -527,10 +522,7 @@ public class RangeAnnotationDescriptor extends uk.ac.vamsas.objects.core.descrip */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java index 987c829..41f9da7 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java @@ -45,11 +45,6 @@ public class RangeTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDesc */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -181,7 +176,7 @@ public class RangeTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDesc */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ReferenceTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ReferenceTypeDescriptor.java index 762e3c2..2a7a4b2 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/ReferenceTypeDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/ReferenceTypeDescriptor.java @@ -45,11 +45,6 @@ public class ReferenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClass */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -103,7 +98,7 @@ public class ReferenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClass //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - this._identity = desc; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -210,7 +205,7 @@ public class ReferenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClass */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java index c44c201..06fac17 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java @@ -45,11 +45,6 @@ public class ScoreDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -171,7 +166,7 @@ public class ScoreDescriptor extends org.exolab.castor.xml.util.XMLClassDescript */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java index 8158517..c489fff 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java @@ -45,11 +45,6 @@ public class SegDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptor */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -219,7 +214,7 @@ public class SegDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptor */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java index 047ea50..d18b8c1 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java @@ -45,11 +45,6 @@ public class SequenceDescriptor extends uk.ac.vamsas.objects.core.descriptors.Se */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -71,7 +66,7 @@ public class SequenceDescriptor extends uk.ac.vamsas.objects.core.descriptors.Se //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - this._identity = desc; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -255,10 +250,7 @@ public class SequenceDescriptor extends uk.ac.vamsas.objects.core.descriptors.Se */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java index 69ae934..396515e 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java @@ -18,7 +18,7 @@ import uk.ac.vamsas.objects.core.SequenceMapping; * * @version $Revision$ $Date$ */ -public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { +public class SequenceMappingDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor { //--------------------------/ @@ -45,11 +45,6 @@ public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLCla */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -57,6 +52,7 @@ public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLCla public SequenceMappingDescriptor() { super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor()); _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; _xmlName = "sequenceMapping"; _elementDefinition = true; @@ -68,22 +64,22 @@ public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLCla org.exolab.castor.xml.FieldValidator fieldValidator = null; //-- initialize attribute descriptors - //-- _sequenceA - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_sequenceA", "sequenceA", org.exolab.castor.xml.NodeType.Attribute); + //-- _loc + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_loc", "loc", 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 { SequenceMapping target = (SequenceMapping) object; - return target.getSequenceA(); + return target.getLoc(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { SequenceMapping target = (SequenceMapping) object; - target.setSequenceA( (java.lang.Object) value); + target.setLoc( (java.lang.Object) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } @@ -97,7 +93,7 @@ public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLCla desc.setMultivalued(false); addFieldDescriptor(desc); - //-- validation code for: _sequenceA + //-- validation code for: _loc fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope @@ -106,22 +102,22 @@ public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLCla fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); - //-- _sequenceB - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_sequenceB", "sequenceB", org.exolab.castor.xml.NodeType.Attribute); + //-- _map + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_map", "map", 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 { SequenceMapping target = (SequenceMapping) object; - return target.getSequenceB(); + return target.getMap(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { SequenceMapping target = (SequenceMapping) object; - target.setSequenceB( (java.lang.Object) value); + target.setMap( (java.lang.Object) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } @@ -135,7 +131,7 @@ public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLCla desc.setMultivalued(false); addFieldDescriptor(desc); - //-- validation code for: _sequenceB + //-- validation code for: _map fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope @@ -146,7 +142,7 @@ public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLCla 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; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -182,49 +178,6 @@ public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLCla desc.setValidator(fieldValidator); //-- initialize element descriptors - //-- _rangeList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Range.class, "_rangeList", "range", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SequenceMapping target = (SequenceMapping) object; - return target.getRange(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceMapping target = (SequenceMapping) object; - target.addRange( (uk.ac.vamsas.objects.core.Range) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - SequenceMapping target = (SequenceMapping) object; - target.removeAllRange(); - } 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.Range(); - } - }; - 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: _rangeList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- 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() { @@ -285,7 +238,7 @@ public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLCla */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java index c6e9bf7..7b059e6 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java @@ -45,11 +45,6 @@ public class SequenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClassD */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -337,7 +332,7 @@ public class SequenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClassD */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java index e05b6da..19f0b42 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java @@ -45,11 +45,6 @@ public class TreeDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -70,7 +65,7 @@ public class TreeDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - this._identity = desc; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -368,7 +363,7 @@ public class TreeDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/TreenodeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/TreenodeDescriptor.java index d113459..4108527 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/TreenodeDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/TreenodeDescriptor.java @@ -45,11 +45,6 @@ public class TreenodeDescriptor extends uk.ac.vamsas.objects.core.descriptors.No */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -176,10 +171,7 @@ public class TreenodeDescriptor extends uk.ac.vamsas.objects.core.descriptors.No */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java index fd16249..8a6e724 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java @@ -45,11 +45,6 @@ public class UserDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDat */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -171,10 +166,7 @@ public class UserDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDat */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java index 59f8995..b999ff4 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java @@ -45,11 +45,6 @@ public class VAMSASDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -70,7 +65,7 @@ public class VAMSASDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - this._identity = desc; + super.setIdentity(desc); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -252,7 +247,7 @@ public class VAMSASDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java index 856736e..9c7a594 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java @@ -45,11 +45,6 @@ public class VamsasDocumentDescriptor extends org.exolab.castor.xml.util.XMLClas */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -328,7 +323,7 @@ public class VamsasDocumentDescriptor extends org.exolab.castor.xml.util.XMLClas */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VrefDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VrefDescriptor.java index b150b93..aaf2f6d 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/VrefDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/VrefDescriptor.java @@ -45,11 +45,6 @@ public class VrefDescriptor extends uk.ac.vamsas.objects.core.descriptors.Refere */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -86,10 +81,7 @@ public class VrefDescriptor extends uk.ac.vamsas.objects.core.descriptors.Refere */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /** diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VxrefDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VxrefDescriptor.java index aa83139..86ddb3e 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/VxrefDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/VxrefDescriptor.java @@ -45,11 +45,6 @@ public class VxrefDescriptor extends uk.ac.vamsas.objects.core.descriptors.Refer */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -86,10 +81,7 @@ public class VxrefDescriptor extends uk.ac.vamsas.objects.core.descriptors.Refer */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - if (_identity == null) { - return super.getIdentity(); - } - return _identity; + return super.getIdentity(); } /**