X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FDataSet.java;h=ae4506b4e3775971bf47f2af490ee7d8737442bf;hb=f5306591821b5f6d4e381ff30b647bd149d51f43;hp=2d627e3c4339c56f5d655db364519a1a1f468c1c;hpb=667c5f732b74c1a0e0ac50cd26d93634811663ee;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/core/DataSet.java b/src/uk/ac/vamsas/objects/core/DataSet.java index 2d627e3..ae4506b 100644 --- a/src/uk/ac/vamsas/objects/core/DataSet.java +++ b/src/uk/ac/vamsas/objects/core/DataSet.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,17 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -import java.util.Enumeration; -import java.util.Vector; -import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; -import org.exolab.castor.xml.ValidationException; -import org.xml.sax.ContentHandler; /** * Class DataSet. @@ -43,27 +34,32 @@ implements java.io.Serializable private java.lang.String _id; /** - * Field _sequenceList + * Field _sequenceList. */ private java.util.Vector _sequenceList; /** - * Field _dataSetAnnotationsList + * Field _sequenceMappingList. + */ + private java.util.Vector _sequenceMappingList; + + /** + * Field _dataSetAnnotationsList. */ private java.util.Vector _dataSetAnnotationsList; /** - * Field _alignmentList + * Field _alignmentList. */ private java.util.Vector _alignmentList; /** - * Field _treeList + * Field _treeList. */ private java.util.Vector _treeList; /** - * Field _provenance + * Field _provenance. */ private uk.ac.vamsas.objects.core.Provenance _provenance; @@ -72,14 +68,14 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public DataSet() - { + public DataSet() { super(); - _sequenceList = new Vector(); - _dataSetAnnotationsList = new Vector(); - _alignmentList = new Vector(); - _treeList = new Vector(); - } //-- uk.ac.vamsas.objects.core.DataSet() + this._sequenceList = new java.util.Vector(); + this._sequenceMappingList = new java.util.Vector(); + this._dataSetAnnotationsList = new java.util.Vector(); + this._alignmentList = new java.util.Vector(); + this._treeList = new java.util.Vector(); + } //-----------/ @@ -87,169 +83,208 @@ implements java.io.Serializable //-----------/ /** - * Method addAlignment - * * * * @param vAlignment + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignment(uk.ac.vamsas.objects.core.Alignment vAlignment) - throws java.lang.IndexOutOfBoundsException - { - _alignmentList.addElement(vAlignment); - } //-- void addAlignment(uk.ac.vamsas.objects.core.Alignment) + public void addAlignment( + final uk.ac.vamsas.objects.core.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException { + this._alignmentList.addElement(vAlignment); + } /** - * Method addAlignment - * * * * @param index * @param vAlignment + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addAlignment(int index, uk.ac.vamsas.objects.core.Alignment vAlignment) - throws java.lang.IndexOutOfBoundsException - { - _alignmentList.insertElementAt(vAlignment, index); - } //-- void addAlignment(int, uk.ac.vamsas.objects.core.Alignment) + public void addAlignment( + final int index, + final uk.ac.vamsas.objects.core.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException { + this._alignmentList.add(index, vAlignment); + } /** - * Method addDataSetAnnotations - * * * * @param vDataSetAnnotations + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) - throws java.lang.IndexOutOfBoundsException - { - _dataSetAnnotationsList.addElement(vDataSetAnnotations); - } //-- void addDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations) + public void addDataSetAnnotations( + final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException { + this._dataSetAnnotationsList.addElement(vDataSetAnnotations); + } /** - * Method addDataSetAnnotations - * * * * @param index * @param vDataSetAnnotations + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addDataSetAnnotations(int index, uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) - throws java.lang.IndexOutOfBoundsException - { - _dataSetAnnotationsList.insertElementAt(vDataSetAnnotations, index); - } //-- void addDataSetAnnotations(int, uk.ac.vamsas.objects.core.DataSetAnnotations) + public void addDataSetAnnotations( + final int index, + final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException { + this._dataSetAnnotationsList.add(index, vDataSetAnnotations); + } /** - * Method addSequence - * * * * @param vSequence + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addSequence(uk.ac.vamsas.objects.core.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException - { - _sequenceList.addElement(vSequence); - } //-- void addSequence(uk.ac.vamsas.objects.core.Sequence) + public void addSequence( + final uk.ac.vamsas.objects.core.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException { + this._sequenceList.addElement(vSequence); + } /** - * Method addSequence - * * * * @param index * @param vSequence + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addSequence(int index, uk.ac.vamsas.objects.core.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException - { - _sequenceList.insertElementAt(vSequence, index); - } //-- void addSequence(int, uk.ac.vamsas.objects.core.Sequence) + public void addSequence( + final int index, + final uk.ac.vamsas.objects.core.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException { + this._sequenceList.add(index, vSequence); + } /** - * Method addTree - * * * - * @param vTree + * @param vSequenceMapping + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.addElement(vTree); - } //-- void addTree(uk.ac.vamsas.objects.core.Tree) + public void addSequenceMapping( + final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) + throws java.lang.IndexOutOfBoundsException { + this._sequenceMappingList.addElement(vSequenceMapping); + } /** - * Method addTree - * * * * @param index - * @param vTree + * @param vSequenceMapping + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void addTree(int index, uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - _treeList.insertElementAt(vTree, index); - } //-- void addTree(int, uk.ac.vamsas.objects.core.Tree) + public void addSequenceMapping( + final int index, + final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) + throws java.lang.IndexOutOfBoundsException { + this._sequenceMappingList.add(index, vSequenceMapping); + } /** - * Method enumerateAlignment * * - * - * @return Enumeration + * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public java.util.Enumeration enumerateAlignment() - { - return _alignmentList.elements(); - } //-- java.util.Enumeration enumerateAlignment() + public void addTree( + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.addElement(vTree); + } /** - * Method enumerateDataSetAnnotations * * - * - * @return Enumeration + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public java.util.Enumeration enumerateDataSetAnnotations() - { - return _dataSetAnnotationsList.elements(); - } //-- java.util.Enumeration enumerateDataSetAnnotations() + public void addTree( + final int index, + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + this._treeList.add(index, vTree); + } /** - * Method enumerateSequence - * + * Method enumerateAlignment. * + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Alignment elements + */ + public java.util.Enumeration enumerateAlignment( + ) { + return this._alignmentList.elements(); + } + + /** + * Method enumerateDataSetAnnotations. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.DataSetAnnotations elements */ - public java.util.Enumeration enumerateSequence() - { - return _sequenceList.elements(); - } //-- java.util.Enumeration enumerateSequence() + public java.util.Enumeration enumerateDataSetAnnotations( + ) { + return this._dataSetAnnotationsList.elements(); + } /** - * Method enumerateTree + * Method enumerateSequence. * + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Sequence elements + */ + public java.util.Enumeration enumerateSequence( + ) { + return this._sequenceList.elements(); + } + + /** + * Method enumerateSequenceMapping. * + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.SequenceMapping elements + */ + public java.util.Enumeration enumerateSequenceMapping( + ) { + return this._sequenceMappingList.elements(); + } + + /** + * Method enumerateTree. * - * @return Enumeration + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Tree elements */ - public java.util.Enumeration enumerateTree() - { - return _treeList.elements(); - } //-- java.util.Enumeration enumerateTree() + public java.util.Enumeration enumerateTree( + ) { + return this._treeList.elements(); + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -259,478 +294,852 @@ 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; + 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; } return false; - } //-- boolean equals(java.lang.Object) + } /** - * Method getAlignment - * - * + * Method getAlignment. * * @param index - * @return Alignment - */ - public uk.ac.vamsas.objects.core.Alignment getAlignment(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentList.size())) { - throw new IndexOutOfBoundsException("getAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]"); + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Alignment + * at the given index + */ + public uk.ac.vamsas.objects.core.Alignment getAlignment( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentList.size()) { + throw new IndexOutOfBoundsException("getAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]"); } - return (uk.ac.vamsas.objects.core.Alignment) _alignmentList.elementAt(index); - } //-- uk.ac.vamsas.objects.core.Alignment getAlignment(int) + return (uk.ac.vamsas.objects.core.Alignment) _alignmentList.get(index); + } /** - * Method getAlignment - * + * Method getAlignment.Returns the contents of the collection + * in an Array.

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

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

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

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

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_id != null + && !org.castor.util.CycleBreaker.startingToCycle(_id)) { + result = 37 * result + _id.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_id); + } + if (_sequenceList != null + && !org.castor.util.CycleBreaker.startingToCycle(_sequenceList)) { + result = 37 * result + _sequenceList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceList); + } + if (_sequenceMappingList != null + && !org.castor.util.CycleBreaker.startingToCycle(_sequenceMappingList)) { + result = 37 * result + _sequenceMappingList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceMappingList); + } + if (_dataSetAnnotationsList != null + && !org.castor.util.CycleBreaker.startingToCycle(_dataSetAnnotationsList)) { + result = 37 * result + _dataSetAnnotationsList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_dataSetAnnotationsList); + } + if (_alignmentList != null + && !org.castor.util.CycleBreaker.startingToCycle(_alignmentList)) { + result = 37 * result + _alignmentList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentList); + } + if (_treeList != null + && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) { + result = 37 * result + _treeList.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_treeList); + } + if (_provenance != null + && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) { + result = 37 * result + _provenance.hashCode(); + org.castor.util.CycleBreaker.releaseCycleHandle(_provenance); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); - } //-- void marshal(java.io.Writer) + } /** - * Method marshal - * * * * @param handler + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, handler); - } //-- void marshal(org.xml.sax.ContentHandler) + } /** - * Method removeAlignment - * + * Method removeAlignment. * + * @param vAlignment + * @return true if the object was removed from the collection. + */ + public boolean removeAlignment( + final uk.ac.vamsas.objects.core.Alignment vAlignment) { + boolean removed = _alignmentList.remove(vAlignment); + return removed; + } + + /** + * Method removeAlignmentAt. * * @param index - * @return Alignment + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Alignment removeAlignment(int index) - { - java.lang.Object obj = _alignmentList.elementAt(index); - _alignmentList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Alignment removeAlignmentAt( + final int index) { + java.lang.Object obj = this._alignmentList.remove(index); return (uk.ac.vamsas.objects.core.Alignment) obj; - } //-- uk.ac.vamsas.objects.core.Alignment removeAlignment(int) + } /** - * Method removeAllAlignment - * */ - public void removeAllAlignment() - { - _alignmentList.removeAllElements(); - } //-- void removeAllAlignment() + public void removeAllAlignment( + ) { + this._alignmentList.clear(); + } /** - * Method removeAllDataSetAnnotations - * */ - public void removeAllDataSetAnnotations() - { - _dataSetAnnotationsList.removeAllElements(); - } //-- void removeAllDataSetAnnotations() + public void removeAllDataSetAnnotations( + ) { + this._dataSetAnnotationsList.clear(); + } /** - * Method removeAllSequence - * */ - public void removeAllSequence() - { - _sequenceList.removeAllElements(); - } //-- void removeAllSequence() + public void removeAllSequence( + ) { + this._sequenceList.clear(); + } /** - * Method removeAllTree - * */ - public void removeAllTree() - { - _treeList.removeAllElements(); - } //-- void removeAllTree() + public void removeAllSequenceMapping( + ) { + this._sequenceMappingList.clear(); + } /** - * Method removeDataSetAnnotations - * + */ + public void removeAllTree( + ) { + this._treeList.clear(); + } + + /** + * Method removeDataSetAnnotations. * + * @param vDataSetAnnotations + * @return true if the object was removed from the collection. + */ + public boolean removeDataSetAnnotations( + final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) { + boolean removed = _dataSetAnnotationsList.remove(vDataSetAnnotations); + return removed; + } + + /** + * Method removeDataSetAnnotationsAt. * * @param index - * @return DataSetAnnotations + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int index) - { - java.lang.Object obj = _dataSetAnnotationsList.elementAt(index); - _dataSetAnnotationsList.removeElementAt(index); + public uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotationsAt( + final int index) { + java.lang.Object obj = this._dataSetAnnotationsList.remove(index); return (uk.ac.vamsas.objects.core.DataSetAnnotations) obj; - } //-- uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int) + } /** - * Method removeSequence - * + * Method removeSequence. * + * @param vSequence + * @return true if the object was removed from the collection. + */ + public boolean removeSequence( + final uk.ac.vamsas.objects.core.Sequence vSequence) { + boolean removed = _sequenceList.remove(vSequence); + return removed; + } + + /** + * Method removeSequenceAt. * * @param index - * @return Sequence + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Sequence removeSequence(int index) - { - java.lang.Object obj = _sequenceList.elementAt(index); - _sequenceList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Sequence removeSequenceAt( + final int index) { + java.lang.Object obj = this._sequenceList.remove(index); return (uk.ac.vamsas.objects.core.Sequence) obj; - } //-- uk.ac.vamsas.objects.core.Sequence removeSequence(int) + } /** - * Method removeTree + * Method removeSequenceMapping. * + * @param vSequenceMapping + * @return true if the object was removed from the collection. + */ + public boolean removeSequenceMapping( + final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) { + boolean removed = _sequenceMappingList.remove(vSequenceMapping); + return removed; + } + + /** + * Method removeSequenceMappingAt. * + * @param index + * @return the element removed from the collection + */ + public uk.ac.vamsas.objects.core.SequenceMapping removeSequenceMappingAt( + final int index) { + java.lang.Object obj = this._sequenceMappingList.remove(index); + return (uk.ac.vamsas.objects.core.SequenceMapping) obj; + } + + /** + * Method removeTree. + * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree( + final uk.ac.vamsas.objects.core.Tree vTree) { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. * * @param index - * @return Tree + * @return the element removed from the collection */ - public uk.ac.vamsas.objects.core.Tree removeTree(int index) - { - java.lang.Object obj = _treeList.elementAt(index); - _treeList.removeElementAt(index); + public uk.ac.vamsas.objects.core.Tree removeTreeAt( + final int index) { + java.lang.Object obj = this._treeList.remove(index); return (uk.ac.vamsas.objects.core.Tree) obj; - } //-- uk.ac.vamsas.objects.core.Tree removeTree(int) + } /** - * Method setAlignment - * * * * @param index * @param vAlignment + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setAlignment(int index, uk.ac.vamsas.objects.core.Alignment vAlignment) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _alignmentList.size())) { - throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]"); + public void setAlignment( + final int index, + final uk.ac.vamsas.objects.core.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._alignmentList.size()) { + throw new IndexOutOfBoundsException("setAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]"); } - _alignmentList.setElementAt(vAlignment, index); - } //-- void setAlignment(int, uk.ac.vamsas.objects.core.Alignment) + + this._alignmentList.set(index, vAlignment); + } /** - * Method setAlignment * * - * - * @param alignmentArray + * @param vAlignmentArray */ - public void setAlignment(uk.ac.vamsas.objects.core.Alignment[] alignmentArray) - { + public void setAlignment( + final uk.ac.vamsas.objects.core.Alignment[] vAlignmentArray) { //-- copy array - _alignmentList.removeAllElements(); - for (int i = 0; i < alignmentArray.length; i++) { - _alignmentList.addElement(alignmentArray[i]); + _alignmentList.clear(); + + for (int i = 0; i < vAlignmentArray.length; i++) { + this._alignmentList.add(vAlignmentArray[i]); } - } //-- void setAlignment(uk.ac.vamsas.objects.core.Alignment) + } /** - * Method setDataSetAnnotations + * Sets the value of '_alignmentList' by copying the given + * Vector. All elements will be checked for type safety. * + * @param vAlignmentList the Vector to copy. + */ + public void setAlignment( + final java.util.Vector vAlignmentList) { + // copy vector + this._alignmentList.clear(); + + this._alignmentList.addAll(vAlignmentList); + } + + /** + * Sets the value of '_alignmentList' by setting it to the + * given Vector. No type checking is performed. + * @deprecated + * + * @param alignmentVector the Vector to set. + */ + public void setAlignmentAsReference( + final java.util.Vector alignmentVector) { + this._alignmentList = alignmentVector; + } + + /** * * * @param index * @param vDataSetAnnotations + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setDataSetAnnotations(int index, uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _dataSetAnnotationsList.size())) { - throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]"); + public void setDataSetAnnotations( + final int index, + final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._dataSetAnnotationsList.size()) { + throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '" + index + "' not in range [0.." + (this._dataSetAnnotationsList.size() - 1) + "]"); } - _dataSetAnnotationsList.setElementAt(vDataSetAnnotations, index); - } //-- void setDataSetAnnotations(int, uk.ac.vamsas.objects.core.DataSetAnnotations) + + this._dataSetAnnotationsList.set(index, vDataSetAnnotations); + } /** - * Method setDataSetAnnotations - * * * - * @param dataSetAnnotationsArray + * @param vDataSetAnnotationsArray */ - public void setDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations[] dataSetAnnotationsArray) - { + public void setDataSetAnnotations( + final uk.ac.vamsas.objects.core.DataSetAnnotations[] vDataSetAnnotationsArray) { //-- copy array - _dataSetAnnotationsList.removeAllElements(); - for (int i = 0; i < dataSetAnnotationsArray.length; i++) { - _dataSetAnnotationsList.addElement(dataSetAnnotationsArray[i]); + _dataSetAnnotationsList.clear(); + + for (int i = 0; i < vDataSetAnnotationsArray.length; i++) { + this._dataSetAnnotationsList.add(vDataSetAnnotationsArray[i]); } - } //-- void setDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations) + } + + /** + * Sets the value of '_dataSetAnnotationsList' by copying the + * given Vector. All elements will be checked for type safety. + * + * @param vDataSetAnnotationsList the Vector to copy. + */ + public void setDataSetAnnotations( + final java.util.Vector vDataSetAnnotationsList) { + // copy vector + this._dataSetAnnotationsList.clear(); + + this._dataSetAnnotationsList.addAll(vDataSetAnnotationsList); + } + + /** + * Sets the value of '_dataSetAnnotationsList' by setting it to + * the given Vector. No type checking is performed. + * @deprecated + * + * @param dataSetAnnotationsVector the Vector to set. + */ + public void setDataSetAnnotationsAsReference( + final java.util.Vector dataSetAnnotationsVector) { + this._dataSetAnnotationsList = dataSetAnnotationsVector; + } /** * Sets the value of field 'id'. The field 'id' has the @@ -739,112 +1148,231 @@ implements java.io.Serializable * * @param id the value of field 'id'. */ - public void setId(java.lang.String id) - { + public void setId( + final java.lang.String id) { this._id = id; - } //-- void setId(java.lang.String) + } /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. */ - public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) - { + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { this._provenance = provenance; - } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + } /** - * Method setSequence - * * * * @param index * @param vSequence + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setSequence(int index, uk.ac.vamsas.objects.core.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _sequenceList.size())) { - throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]"); + public void setSequence( + final int index, + final uk.ac.vamsas.objects.core.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._sequenceList.size()) { + throw new IndexOutOfBoundsException("setSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]"); } - _sequenceList.setElementAt(vSequence, index); - } //-- void setSequence(int, uk.ac.vamsas.objects.core.Sequence) + + this._sequenceList.set(index, vSequence); + } /** - * Method setSequence * * + * @param vSequenceArray + */ + public void setSequence( + final uk.ac.vamsas.objects.core.Sequence[] vSequenceArray) { + //-- copy array + _sequenceList.clear(); + + for (int i = 0; i < vSequenceArray.length; i++) { + this._sequenceList.add(vSequenceArray[i]); + } + } + + /** + * Sets the value of '_sequenceList' by copying the given + * Vector. All elements will be checked for type safety. + * + * @param vSequenceList the Vector to copy. + */ + public void setSequence( + final java.util.Vector vSequenceList) { + // copy vector + this._sequenceList.clear(); + + this._sequenceList.addAll(vSequenceList); + } + + /** + * Sets the value of '_sequenceList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param sequenceVector the Vector to set. + */ + public void setSequenceAsReference( + final java.util.Vector sequenceVector) { + this._sequenceList = sequenceVector; + } + + /** + * + * + * @param index + * @param vSequenceMapping + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setSequenceMapping( + final int index, + final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._sequenceMappingList.size()) { + throw new IndexOutOfBoundsException("setSequenceMapping: Index value '" + index + "' not in range [0.." + (this._sequenceMappingList.size() - 1) + "]"); + } + + this._sequenceMappingList.set(index, vSequenceMapping); + } + + /** + * * - * @param sequenceArray + * @param vSequenceMappingArray */ - public void setSequence(uk.ac.vamsas.objects.core.Sequence[] sequenceArray) - { + public void setSequenceMapping( + final uk.ac.vamsas.objects.core.SequenceMapping[] vSequenceMappingArray) { //-- copy array - _sequenceList.removeAllElements(); - for (int i = 0; i < sequenceArray.length; i++) { - _sequenceList.addElement(sequenceArray[i]); + _sequenceMappingList.clear(); + + for (int i = 0; i < vSequenceMappingArray.length; i++) { + this._sequenceMappingList.add(vSequenceMappingArray[i]); } - } //-- void setSequence(uk.ac.vamsas.objects.core.Sequence) + } /** - * Method setTree + * Sets the value of '_sequenceMappingList' by copying the + * given Vector. All elements will be checked for type safety. * + * @param vSequenceMappingList the Vector to copy. + */ + public void setSequenceMapping( + final java.util.Vector vSequenceMappingList) { + // copy vector + this._sequenceMappingList.clear(); + + this._sequenceMappingList.addAll(vSequenceMappingList); + } + + /** + * Sets the value of '_sequenceMappingList' by setting it to + * the given Vector. No type checking is performed. + * @deprecated + * + * @param sequenceMappingVector the Vector to set. + */ + public void setSequenceMappingAsReference( + final java.util.Vector sequenceMappingVector) { + this._sequenceMappingList = sequenceMappingVector; + } + + /** * * * @param index * @param vTree + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection */ - public void setTree(int index, uk.ac.vamsas.objects.core.Tree vTree) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _treeList.size())) { - throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + public void setTree( + final int index, + final uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) { + throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); } - _treeList.setElementAt(vTree, index); - } //-- void setTree(int, uk.ac.vamsas.objects.core.Tree) + + this._treeList.set(index, vTree); + } /** - * Method setTree - * * * - * @param treeArray + * @param vTreeArray */ - public void setTree(uk.ac.vamsas.objects.core.Tree[] treeArray) - { + public void setTree( + final uk.ac.vamsas.objects.core.Tree[] vTreeArray) { //-- copy array - _treeList.removeAllElements(); - for (int i = 0; i < treeArray.length; i++) { - _treeList.addElement(treeArray[i]); + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) { + this._treeList.add(vTreeArray[i]); } - } //-- void setTree(uk.ac.vamsas.objects.core.Tree) + } /** - * Method unmarshal + * Sets the value of '_treeList' by copying the given Vector. + * All elements will be checked for type safety. * + * @param vTreeList the Vector to copy. + */ + public void setTree( + final java.util.Vector vTreeList) { + // copy vector + this._treeList.clear(); + + this._treeList.addAll(vTreeList); + } + + /** + * Sets the value of '_treeList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated * + * @param treeVector the Vector to set. + */ + public void setTreeAsReference( + final java.util.Vector treeVector) { + this._treeList = treeVector; + } + + /** + * Method unmarshal. * * @param reader - * @return DataSet + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.DataSet */ - public static uk.ac.vamsas.objects.core.DataSet unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.DataSet unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSet.class, reader); - } //-- uk.ac.vamsas.objects.core.DataSet unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + public void validate( + ) + throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); - } //-- void validate() + } }