/* * This class was automatically generated with * Castor 0.9.9M2, using an XML * Schema. * $Id$ */ package org.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 SequenceSet. * * @version $Revision$ $Date$ */ public class SequenceSet extends org.vamsas.client.object implements java.io.Serializable { //--------------------------/ //- Class/Member Variables -/ //--------------------------/ /** * Field _id */ private java.lang.String _id; /** * Field _sequenceList */ private java.util.Vector _sequenceList; /** * Field _sequenceSetAnnotationsList */ private java.util.Vector _sequenceSetAnnotationsList; /** * Field _alignmentList */ private java.util.Vector _alignmentList; /** * Field _treeList */ private java.util.Vector _treeList; /** * Field _provenance */ private org.vamsas.objects.core.Provenance _provenance; //----------------/ //- Constructors -/ //----------------/ public SequenceSet() { super(); _sequenceList = new Vector(); _sequenceSetAnnotationsList = new Vector(); _alignmentList = new Vector(); _treeList = new Vector(); } //-- org.vamsas.objects.core.SequenceSet() //-----------/ //- Methods -/ //-----------/ /** * Method addAlignment * * * * @param vAlignment */ public void addAlignment(org.vamsas.objects.core.Alignment vAlignment) throws java.lang.IndexOutOfBoundsException { _alignmentList.addElement(vAlignment); } //-- void addAlignment(org.vamsas.objects.core.Alignment) /** * Method addAlignment * * * * @param index * @param vAlignment */ public void addAlignment(int index, org.vamsas.objects.core.Alignment vAlignment) throws java.lang.IndexOutOfBoundsException { _alignmentList.insertElementAt(vAlignment, index); } //-- void addAlignment(int, org.vamsas.objects.core.Alignment) /** * Method addSequence * * * * @param vSequence */ public void addSequence(org.vamsas.objects.core.Sequence vSequence) throws java.lang.IndexOutOfBoundsException { _sequenceList.addElement(vSequence); } //-- void addSequence(org.vamsas.objects.core.Sequence) /** * Method addSequence * * * * @param index * @param vSequence */ public void addSequence(int index, org.vamsas.objects.core.Sequence vSequence) throws java.lang.IndexOutOfBoundsException { _sequenceList.insertElementAt(vSequence, index); } //-- void addSequence(int, org.vamsas.objects.core.Sequence) /** * Method addSequenceSetAnnotations * * * * @param vSequenceSetAnnotations */ public void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations) throws java.lang.IndexOutOfBoundsException { _sequenceSetAnnotationsList.addElement(vSequenceSetAnnotations); } //-- void addSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations) /** * Method addSequenceSetAnnotations * * * * @param index * @param vSequenceSetAnnotations */ public void addSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations) throws java.lang.IndexOutOfBoundsException { _sequenceSetAnnotationsList.insertElementAt(vSequenceSetAnnotations, index); } //-- void addSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations) /** * Method addTree * * * * @param vTree */ public void addTree(org.vamsas.objects.core.Tree vTree) throws java.lang.IndexOutOfBoundsException { _treeList.addElement(vTree); } //-- void addTree(org.vamsas.objects.core.Tree) /** * Method addTree * * * * @param index * @param vTree */ public void addTree(int index, org.vamsas.objects.core.Tree vTree) throws java.lang.IndexOutOfBoundsException { _treeList.insertElementAt(vTree, index); } //-- void addTree(int, org.vamsas.objects.core.Tree) /** * Method enumerateAlignment * * * * @return Enumeration */ public java.util.Enumeration enumerateAlignment() { return _alignmentList.elements(); } //-- java.util.Enumeration enumerateAlignment() /** * Method enumerateSequence * * * * @return Enumeration */ public java.util.Enumeration enumerateSequence() { return _sequenceList.elements(); } //-- java.util.Enumeration enumerateSequence() /** * Method enumerateSequenceSetAnnotations * * * * @return Enumeration */ public java.util.Enumeration enumerateSequenceSetAnnotations() { return _sequenceSetAnnotationsList.elements(); } //-- java.util.Enumeration enumerateSequenceSetAnnotations() /** * Method enumerateTree * * * * @return Enumeration */ public java.util.Enumeration enumerateTree() { return _treeList.elements(); } //-- java.util.Enumeration enumerateTree() /** * Note: hashCode() has not been overriden * * @param obj * @return boolean */ public boolean equals(java.lang.Object obj) { if ( this == obj ) return true; if (super.equals(obj)==false) return false; if (obj instanceof SequenceSet) { SequenceSet temp = (SequenceSet)obj; 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._sequenceList != null) { if (temp._sequenceList == null) return false; else if (!(this._sequenceList.equals(temp._sequenceList))) return false; } else if (temp._sequenceList != null) return false; if (this._sequenceSetAnnotationsList != null) { if (temp._sequenceSetAnnotationsList == null) return false; else if (!(this._sequenceSetAnnotationsList.equals(temp._sequenceSetAnnotationsList))) return false; } else if (temp._sequenceSetAnnotationsList != 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) 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) 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) return false; return true; } return false; } //-- boolean equals(java.lang.Object) /** * Method getAlignment * * * * @param index * @return Alignment */ public org.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()+ "]"); } return (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index); } //-- org.vamsas.objects.core.Alignment getAlignment(int) /** * Method getAlignment * * * * @return Alignment */ public org.vamsas.objects.core.Alignment[] getAlignment() { int size = _alignmentList.size(); org.vamsas.objects.core.Alignment[] mArray = new org.vamsas.objects.core.Alignment[size]; for (int index = 0; index < size; index++) { mArray[index] = (org.vamsas.objects.core.Alignment) _alignmentList.elementAt(index); } return mArray; } //-- org.vamsas.objects.core.Alignment[] getAlignment() /** * Method getAlignmentCount * * * * @return int */ public int getAlignmentCount() { return _alignmentList.size(); } //-- int getAlignmentCount() /** * Returns the value of field 'id'. * * @return String * @return the value of field 'id'. */ public java.lang.String getId() { return this._id; } //-- java.lang.String getId() /** * Returns the value of field 'provenance'. * * @return Provenance * @return the value of field 'provenance'. */ public org.vamsas.objects.core.Provenance getProvenance() { return this._provenance; } //-- org.vamsas.objects.core.Provenance getProvenance() /** * Method getSequence * * * * @param index * @return Sequence */ public org.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()+ "]"); } return (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index); } //-- org.vamsas.objects.core.Sequence getSequence(int) /** * Method getSequence * * * * @return Sequence */ public org.vamsas.objects.core.Sequence[] getSequence() { int size = _sequenceList.size(); org.vamsas.objects.core.Sequence[] mArray = new org.vamsas.objects.core.Sequence[size]; for (int index = 0; index < size; index++) { mArray[index] = (org.vamsas.objects.core.Sequence) _sequenceList.elementAt(index); } return mArray; } //-- org.vamsas.objects.core.Sequence[] getSequence() /** * Method getSequenceCount * * * * @return int */ public int getSequenceCount() { return _sequenceList.size(); } //-- int getSequenceCount() /** * Method getSequenceSetAnnotations * * * * @param index * @return SequenceSetAnnotations */ public org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int index) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) { throw new IndexOutOfBoundsException("getSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]"); } return (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index); } //-- org.vamsas.objects.core.SequenceSetAnnotations getSequenceSetAnnotations(int) /** * Method getSequenceSetAnnotations * * * * @return SequenceSetAnnotations */ public org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations() { int size = _sequenceSetAnnotationsList.size(); org.vamsas.objects.core.SequenceSetAnnotations[] mArray = new org.vamsas.objects.core.SequenceSetAnnotations[size]; for (int index = 0; index < size; index++) { mArray[index] = (org.vamsas.objects.core.SequenceSetAnnotations) _sequenceSetAnnotationsList.elementAt(index); } return mArray; } //-- org.vamsas.objects.core.SequenceSetAnnotations[] getSequenceSetAnnotations() /** * Method getSequenceSetAnnotationsCount * * * * @return int */ public int getSequenceSetAnnotationsCount() { return _sequenceSetAnnotationsList.size(); } //-- int getSequenceSetAnnotationsCount() /** * Method getTree * * * * @param index * @return Tree */ public org.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()+ "]"); } return (org.vamsas.objects.core.Tree) _treeList.elementAt(index); } //-- org.vamsas.objects.core.Tree getTree(int) /** * Method getTree * * * * @return Tree */ public org.vamsas.objects.core.Tree[] getTree() { int size = _treeList.size(); org.vamsas.objects.core.Tree[] mArray = new org.vamsas.objects.core.Tree[size]; for (int index = 0; index < size; index++) { mArray[index] = (org.vamsas.objects.core.Tree) _treeList.elementAt(index); } return mArray; } //-- org.vamsas.objects.core.Tree[] getTree() /** * Method getTreeCount * * * * @return int */ public int getTreeCount() { return _treeList.size(); } //-- int getTreeCount() /** * Method isValid * * * * @return boolean */ public boolean isValid() { try { validate(); } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; } //-- boolean isValid() /** * Method marshal * * * * @param out */ public void marshal(java.io.Writer out) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); } //-- void marshal(java.io.Writer) /** * Method marshal * * * * @param handler */ public void marshal(org.xml.sax.ContentHandler handler) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, handler); } //-- void marshal(org.xml.sax.ContentHandler) /** * Method removeAlignment * * * * @param index * @return Alignment */ public org.vamsas.objects.core.Alignment removeAlignment(int index) { java.lang.Object obj = _alignmentList.elementAt(index); _alignmentList.removeElementAt(index); return (org.vamsas.objects.core.Alignment) obj; } //-- org.vamsas.objects.core.Alignment removeAlignment(int) /** * Method removeAllAlignment * */ public void removeAllAlignment() { _alignmentList.removeAllElements(); } //-- void removeAllAlignment() /** * Method removeAllSequence * */ public void removeAllSequence() { _sequenceList.removeAllElements(); } //-- void removeAllSequence() /** * Method removeAllSequenceSetAnnotations * */ public void removeAllSequenceSetAnnotations() { _sequenceSetAnnotationsList.removeAllElements(); } //-- void removeAllSequenceSetAnnotations() /** * Method removeAllTree * */ public void removeAllTree() { _treeList.removeAllElements(); } //-- void removeAllTree() /** * Method removeSequence * * * * @param index * @return Sequence */ public org.vamsas.objects.core.Sequence removeSequence(int index) { java.lang.Object obj = _sequenceList.elementAt(index); _sequenceList.removeElementAt(index); return (org.vamsas.objects.core.Sequence) obj; } //-- org.vamsas.objects.core.Sequence removeSequence(int) /** * Method removeSequenceSetAnnotations * * * * @param index * @return SequenceSetAnnotations */ public org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int index) { java.lang.Object obj = _sequenceSetAnnotationsList.elementAt(index); _sequenceSetAnnotationsList.removeElementAt(index); return (org.vamsas.objects.core.SequenceSetAnnotations) obj; } //-- org.vamsas.objects.core.SequenceSetAnnotations removeSequenceSetAnnotations(int) /** * Method removeTree * * * * @param index * @return Tree */ public org.vamsas.objects.core.Tree removeTree(int index) { java.lang.Object obj = _treeList.elementAt(index); _treeList.removeElementAt(index); return (org.vamsas.objects.core.Tree) obj; } //-- org.vamsas.objects.core.Tree removeTree(int) /** * Method setAlignment * * * * @param index * @param vAlignment */ public void setAlignment(int index, org.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()+ "]"); } _alignmentList.setElementAt(vAlignment, index); } //-- void setAlignment(int, org.vamsas.objects.core.Alignment) /** * Method setAlignment * * * * @param alignmentArray */ public void setAlignment(org.vamsas.objects.core.Alignment[] alignmentArray) { //-- copy array _alignmentList.removeAllElements(); for (int i = 0; i < alignmentArray.length; i++) { _alignmentList.addElement(alignmentArray[i]); } } //-- void setAlignment(org.vamsas.objects.core.Alignment) /** * Sets the value of field 'id'. * * @param id the value of field 'id'. */ public void setId(java.lang.String id) { this._id = id; } //-- void setId(java.lang.String) /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. */ public void setProvenance(org.vamsas.objects.core.Provenance provenance) { this._provenance = provenance; } //-- void setProvenance(org.vamsas.objects.core.Provenance) /** * Method setSequence * * * * @param index * @param vSequence */ public void setSequence(int index, org.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()+ "]"); } _sequenceList.setElementAt(vSequence, index); } //-- void setSequence(int, org.vamsas.objects.core.Sequence) /** * Method setSequence * * * * @param sequenceArray */ public void setSequence(org.vamsas.objects.core.Sequence[] sequenceArray) { //-- copy array _sequenceList.removeAllElements(); for (int i = 0; i < sequenceArray.length; i++) { _sequenceList.addElement(sequenceArray[i]); } } //-- void setSequence(org.vamsas.objects.core.Sequence) /** * Method setSequenceSetAnnotations * * * * @param index * @param vSequenceSetAnnotations */ public void setSequenceSetAnnotations(int index, org.vamsas.objects.core.SequenceSetAnnotations vSequenceSetAnnotations) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index if ((index < 0) || (index > _sequenceSetAnnotationsList.size())) { throw new IndexOutOfBoundsException("setSequenceSetAnnotations: Index value '"+index+"' not in range [0.."+_sequenceSetAnnotationsList.size()+ "]"); } _sequenceSetAnnotationsList.setElementAt(vSequenceSetAnnotations, index); } //-- void setSequenceSetAnnotations(int, org.vamsas.objects.core.SequenceSetAnnotations) /** * Method setSequenceSetAnnotations * * * * @param sequenceSetAnnotationsArray */ public void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations[] sequenceSetAnnotationsArray) { //-- copy array _sequenceSetAnnotationsList.removeAllElements(); for (int i = 0; i < sequenceSetAnnotationsArray.length; i++) { _sequenceSetAnnotationsList.addElement(sequenceSetAnnotationsArray[i]); } } //-- void setSequenceSetAnnotations(org.vamsas.objects.core.SequenceSetAnnotations) /** * Method setTree * * * * @param index * @param vTree */ public void setTree(int index, org.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()+ "]"); } _treeList.setElementAt(vTree, index); } //-- void setTree(int, org.vamsas.objects.core.Tree) /** * Method setTree * * * * @param treeArray */ public void setTree(org.vamsas.objects.core.Tree[] treeArray) { //-- copy array _treeList.removeAllElements(); for (int i = 0; i < treeArray.length; i++) { _treeList.addElement(treeArray[i]); } } //-- void setTree(org.vamsas.objects.core.Tree) /** * Method unmarshal * * * * @param reader * @return SequenceSet */ public static org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (org.vamsas.objects.core.SequenceSet) Unmarshaller.unmarshal(org.vamsas.objects.core.SequenceSet.class, reader); } //-- org.vamsas.objects.core.SequenceSet unmarshal(java.io.Reader) /** * Method validate * */ public void validate() throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); } //-- void validate() }