X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemabinding%2Fversion2%2FSequenceSet.java;h=6f0342ba78ad6a546549c38720fe89bc4273ca50;hb=1c6e3aa5ffd0d3fbbfe5bffbdeaa9c4f54a61cd3;hp=020cbb91ad57c9fe79f9096a3b345fd8d0f0e641;hpb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;p=jalview.git diff --git a/src/jalview/schemabinding/version2/SequenceSet.java b/src/jalview/schemabinding/version2/SequenceSet.java index 020cbb9..6f0342b 100755 --- a/src/jalview/schemabinding/version2/SequenceSet.java +++ b/src/jalview/schemabinding/version2/SequenceSet.java @@ -1,5 +1,5 @@ /* - * This class was automatically generated with + * This class was automatically generated with * Castor 0.9.6, using an XML * Schema. * $Id$ @@ -7,467 +7,445 @@ package jalview.schemabinding.version2; + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import java.util.*; -import org.exolab.castor.xml.*; +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 - implements java.io.Serializable -{ - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _gapChar - */ - private java.lang.String _gapChar; - - /** - * Field _sequenceList - */ - private java.util.Vector _sequenceList; - - /** - * Field _annotationList - */ - private java.util.Vector _annotationList; - - //----------------/ - //- Constructors -/ - //----------------/ - - public SequenceSet() - { - super(); - _sequenceList = new Vector(); - _annotationList = new Vector(); - } //-- jalview.schemabinding.version2.SequenceSet() - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Method addAnnotation - * - * - * - * @param vAnnotation - */ - public void addAnnotation(jalview.schemabinding.version2.Annotation - vAnnotation) - throws java.lang.IndexOutOfBoundsException - { - _annotationList.addElement(vAnnotation); - } //-- void addAnnotation(jalview.schemabinding.version2.Annotation) - - /** - * Method addAnnotation - * - * - * - * @param index - * @param vAnnotation - */ - public void addAnnotation(int index, - jalview.schemabinding.version2.Annotation - vAnnotation) - throws java.lang.IndexOutOfBoundsException - { - _annotationList.insertElementAt(vAnnotation, index); - } //-- void addAnnotation(int, jalview.schemabinding.version2.Annotation) - - /** - * Method addSequence - * - * - * - * @param vSequence - */ - public void addSequence(jalview.schemabinding.version2.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException - { - _sequenceList.addElement(vSequence); - } //-- void addSequence(jalview.schemabinding.version2.Sequence) - - /** - * Method addSequence - * - * - * - * @param index - * @param vSequence - */ - public void addSequence(int index, - jalview.schemabinding.version2.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException - { - _sequenceList.insertElementAt(vSequence, index); - } //-- void addSequence(int, jalview.schemabinding.version2.Sequence) - - /** - * Method enumerateAnnotation - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateAnnotation() - { - return _annotationList.elements(); - } //-- java.util.Enumeration enumerateAnnotation() - - /** - * Method enumerateSequence - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateSequence() - { - return _sequenceList.elements(); - } //-- java.util.Enumeration enumerateSequence() - - /** - * Method getAnnotation - * - * - * - * @param index - * @return Annotation - */ - public jalview.schemabinding.version2.Annotation getAnnotation(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ( (index < 0) || (index > _annotationList.size())) +public class SequenceSet implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _gapChar + */ + private java.lang.String _gapChar; + + /** + * Field _sequenceList + */ + private java.util.Vector _sequenceList; + + /** + * Field _annotationList + */ + private java.util.Vector _annotationList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceSet() { + super(); + _sequenceList = new Vector(); + _annotationList = new Vector(); + } //-- jalview.schemabinding.version2.SequenceSet() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAnnotation + * + * + * + * @param vAnnotation + */ + public void addAnnotation(jalview.schemabinding.version2.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _annotationList.addElement(vAnnotation); + } //-- void addAnnotation(jalview.schemabinding.version2.Annotation) + + /** + * Method addAnnotation + * + * + * + * @param index + * @param vAnnotation + */ + public void addAnnotation(int index, jalview.schemabinding.version2.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _annotationList.insertElementAt(vAnnotation, index); + } //-- void addAnnotation(int, jalview.schemabinding.version2.Annotation) + + /** + * Method addSequence + * + * + * + * @param vSequence + */ + public void addSequence(jalview.schemabinding.version2.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + _sequenceList.addElement(vSequence); + } //-- void addSequence(jalview.schemabinding.version2.Sequence) + + /** + * Method addSequence + * + * + * + * @param index + * @param vSequence + */ + public void addSequence(int index, jalview.schemabinding.version2.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + _sequenceList.insertElementAt(vSequence, index); + } //-- void addSequence(int, jalview.schemabinding.version2.Sequence) + + /** + * Method enumerateAnnotation + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAnnotation() + { + return _annotationList.elements(); + } //-- java.util.Enumeration enumerateAnnotation() + + /** + * Method enumerateSequence + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateSequence() + { + return _sequenceList.elements(); + } //-- java.util.Enumeration enumerateSequence() + + /** + * Method getAnnotation + * + * + * + * @param index + * @return Annotation + */ + public jalview.schemabinding.version2.Annotation getAnnotation(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _annotationList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Annotation) _annotationList.elementAt(index); + } //-- jalview.schemabinding.version2.Annotation getAnnotation(int) + + /** + * Method getAnnotation + * + * + * + * @return Annotation + */ + public jalview.schemabinding.version2.Annotation[] getAnnotation() + { + int size = _annotationList.size(); + jalview.schemabinding.version2.Annotation[] mArray = new jalview.schemabinding.version2.Annotation[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Annotation) _annotationList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Annotation[] getAnnotation() + + /** + * Method getAnnotationCount + * + * + * + * @return int + */ + public int getAnnotationCount() + { + return _annotationList.size(); + } //-- int getAnnotationCount() + + /** + * Returns the value of field 'gapChar'. + * + * @return String + * @return the value of field 'gapChar'. + */ + public java.lang.String getGapChar() + { + return this._gapChar; + } //-- java.lang.String getGapChar() + + /** + * Method getSequence + * + * + * + * @param index + * @return Sequence + */ + public jalview.schemabinding.version2.Sequence getSequence(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _sequenceList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Sequence) _sequenceList.elementAt(index); + } //-- jalview.schemabinding.version2.Sequence getSequence(int) + + /** + * Method getSequence + * + * + * + * @return Sequence + */ + public jalview.schemabinding.version2.Sequence[] getSequence() + { + int size = _sequenceList.size(); + jalview.schemabinding.version2.Sequence[] mArray = new jalview.schemabinding.version2.Sequence[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Sequence) _sequenceList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Sequence[] getSequence() + + /** + * Method getSequenceCount + * + * + * + * @return int + */ + public int getSequenceCount() + { + return _sequenceList.size(); + } //-- int getSequenceCount() + + /** + * 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 removeAllAnnotation + * + */ + public void removeAllAnnotation() + { + _annotationList.removeAllElements(); + } //-- void removeAllAnnotation() + + /** + * Method removeAllSequence + * + */ + public void removeAllSequence() { - throw new IndexOutOfBoundsException(); - } - - return (jalview.schemabinding.version2.Annotation) _annotationList. - elementAt(index); - } //-- jalview.schemabinding.version2.Annotation getAnnotation(int) - - /** - * Method getAnnotation - * - * - * - * @return Annotation - */ - public jalview.schemabinding.version2.Annotation[] getAnnotation() - { - int size = _annotationList.size(); - jalview.schemabinding.version2.Annotation[] mArray = new jalview. - schemabinding.version2.Annotation[size]; - for (int index = 0; index < size; index++) + _sequenceList.removeAllElements(); + } //-- void removeAllSequence() + + /** + * Method removeAnnotation + * + * + * + * @param index + * @return Annotation + */ + public jalview.schemabinding.version2.Annotation removeAnnotation(int index) { - mArray[index] = (jalview.schemabinding.version2.Annotation) - _annotationList.elementAt(index); - } - return mArray; - } //-- jalview.schemabinding.version2.Annotation[] getAnnotation() - - /** - * Method getAnnotationCount - * - * - * - * @return int - */ - public int getAnnotationCount() - { - return _annotationList.size(); - } //-- int getAnnotationCount() - - /** - * Returns the value of field 'gapChar'. - * - * @return String - * @return the value of field 'gapChar'. - */ - public java.lang.String getGapChar() - { - return this._gapChar; - } //-- java.lang.String getGapChar() - - /** - * Method getSequence - * - * - * - * @param index - * @return Sequence - */ - public jalview.schemabinding.version2.Sequence getSequence(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ( (index < 0) || (index > _sequenceList.size())) + java.lang.Object obj = _annotationList.elementAt(index); + _annotationList.removeElementAt(index); + return (jalview.schemabinding.version2.Annotation) obj; + } //-- jalview.schemabinding.version2.Annotation removeAnnotation(int) + + /** + * Method removeSequence + * + * + * + * @param index + * @return Sequence + */ + public jalview.schemabinding.version2.Sequence removeSequence(int index) { - throw new IndexOutOfBoundsException(); - } - - return (jalview.schemabinding.version2.Sequence) _sequenceList.elementAt( - index); - } //-- jalview.schemabinding.version2.Sequence getSequence(int) - - /** - * Method getSequence - * - * - * - * @return Sequence - */ - public jalview.schemabinding.version2.Sequence[] getSequence() - { - int size = _sequenceList.size(); - jalview.schemabinding.version2.Sequence[] mArray = new jalview. - schemabinding.version2.Sequence[size]; - for (int index = 0; index < size; index++) + java.lang.Object obj = _sequenceList.elementAt(index); + _sequenceList.removeElementAt(index); + return (jalview.schemabinding.version2.Sequence) obj; + } //-- jalview.schemabinding.version2.Sequence removeSequence(int) + + /** + * Method setAnnotation + * + * + * + * @param index + * @param vAnnotation + */ + public void setAnnotation(int index, jalview.schemabinding.version2.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException { - mArray[index] = (jalview.schemabinding.version2.Sequence) _sequenceList. - elementAt(index); - } - return mArray; - } //-- jalview.schemabinding.version2.Sequence[] getSequence() - - /** - * Method getSequenceCount - * - * - * - * @return int - */ - public int getSequenceCount() - { - return _sequenceList.size(); - } //-- int getSequenceCount() - - /** - * Method isValid - * - * - * - * @return boolean - */ - public boolean isValid() - { - try + //-- check bounds for index + if ((index < 0) || (index > _annotationList.size())) { + throw new IndexOutOfBoundsException(); + } + _annotationList.setElementAt(vAnnotation, index); + } //-- void setAnnotation(int, jalview.schemabinding.version2.Annotation) + + /** + * Method setAnnotation + * + * + * + * @param annotationArray + */ + public void setAnnotation(jalview.schemabinding.version2.Annotation[] annotationArray) { - validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) + //-- copy array + _annotationList.removeAllElements(); + for (int i = 0; i < annotationArray.length; i++) { + _annotationList.addElement(annotationArray[i]); + } + } //-- void setAnnotation(jalview.schemabinding.version2.Annotation) + + /** + * Sets the value of field 'gapChar'. + * + * @param gapChar the value of field 'gapChar'. + */ + public void setGapChar(java.lang.String gapChar) { - 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 removeAllAnnotation - * - */ - public void removeAllAnnotation() - { - _annotationList.removeAllElements(); - } //-- void removeAllAnnotation() - - /** - * Method removeAllSequence - * - */ - public void removeAllSequence() - { - _sequenceList.removeAllElements(); - } //-- void removeAllSequence() - - /** - * Method removeAnnotation - * - * - * - * @param index - * @return Annotation - */ - public jalview.schemabinding.version2.Annotation removeAnnotation(int index) - { - java.lang.Object obj = _annotationList.elementAt(index); - _annotationList.removeElementAt(index); - return (jalview.schemabinding.version2.Annotation) obj; - } //-- jalview.schemabinding.version2.Annotation removeAnnotation(int) - - /** - * Method removeSequence - * - * - * - * @param index - * @return Sequence - */ - public jalview.schemabinding.version2.Sequence removeSequence(int index) - { - java.lang.Object obj = _sequenceList.elementAt(index); - _sequenceList.removeElementAt(index); - return (jalview.schemabinding.version2.Sequence) obj; - } //-- jalview.schemabinding.version2.Sequence removeSequence(int) - - /** - * Method setAnnotation - * - * - * - * @param index - * @param vAnnotation - */ - public void setAnnotation(int index, - jalview.schemabinding.version2.Annotation - vAnnotation) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ( (index < 0) || (index > _annotationList.size())) + this._gapChar = gapChar; + } //-- void setGapChar(java.lang.String) + + /** + * Method setSequence + * + * + * + * @param index + * @param vSequence + */ + public void setSequence(int index, jalview.schemabinding.version2.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException { - throw new IndexOutOfBoundsException(); - } - _annotationList.setElementAt(vAnnotation, index); - } //-- void setAnnotation(int, jalview.schemabinding.version2.Annotation) - - /** - * Method setAnnotation - * - * - * - * @param annotationArray - */ - public void setAnnotation(jalview.schemabinding.version2.Annotation[] - annotationArray) - { - //-- copy array - _annotationList.removeAllElements(); - for (int i = 0; i < annotationArray.length; i++) + //-- check bounds for index + if ((index < 0) || (index > _sequenceList.size())) { + throw new IndexOutOfBoundsException(); + } + _sequenceList.setElementAt(vSequence, index); + } //-- void setSequence(int, jalview.schemabinding.version2.Sequence) + + /** + * Method setSequence + * + * + * + * @param sequenceArray + */ + public void setSequence(jalview.schemabinding.version2.Sequence[] sequenceArray) { - _annotationList.addElement(annotationArray[i]); - } - } //-- void setAnnotation(jalview.schemabinding.version2.Annotation) - - /** - * Sets the value of field 'gapChar'. - * - * @param gapChar the value of field 'gapChar'. - */ - public void setGapChar(java.lang.String gapChar) - { - this._gapChar = gapChar; - } //-- void setGapChar(java.lang.String) - - /** - * Method setSequence - * - * - * - * @param index - * @param vSequence - */ - public void setSequence(int index, - jalview.schemabinding.version2.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ( (index < 0) || (index > _sequenceList.size())) + //-- copy array + _sequenceList.removeAllElements(); + for (int i = 0; i < sequenceArray.length; i++) { + _sequenceList.addElement(sequenceArray[i]); + } + } //-- void setSequence(jalview.schemabinding.version2.Sequence) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - throw new IndexOutOfBoundsException(); - } - _sequenceList.setElementAt(vSequence, index); - } //-- void setSequence(int, jalview.schemabinding.version2.Sequence) - - /** - * Method setSequence - * - * - * - * @param sequenceArray - */ - public void setSequence(jalview.schemabinding.version2.Sequence[] - sequenceArray) - { - //-- copy array - _sequenceList.removeAllElements(); - for (int i = 0; i < sequenceArray.length; i++) + return (jalview.schemabinding.version2.SequenceSet) Unmarshaller.unmarshal(jalview.schemabinding.version2.SequenceSet.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException { - _sequenceList.addElement(sequenceArray[i]); - } - } //-- void setSequence(jalview.schemabinding.version2.Sequence) - - /** - * Method unmarshal - * - * - * - * @param reader - * @return Object - */ - public static java.lang.Object unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, - org.exolab.castor.xml.ValidationException - { - return (jalview.schemabinding.version2.SequenceSet) Unmarshaller.unmarshal( - jalview.schemabinding.version2.SequenceSet.class, reader); - } //-- java.lang.Object 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() + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() }