X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbinding%2FSequenceSet.java;h=a0d116e92762320ace5bf395c09d610a732550b4;hb=b8d09897dacc7b0ad203982b4578e2c1d8929142;hp=7ed3b52db875f6661879979da2d5b2864cc3912c;hpb=c68ce4c63bd79f23b87aac3eb0afa7f6b42a3098;p=jalview.git diff --git a/src/jalview/binding/SequenceSet.java b/src/jalview/binding/SequenceSet.java index 7ed3b52..a0d116e 100755 --- a/src/jalview/binding/SequenceSet.java +++ b/src/jalview/binding/SequenceSet.java @@ -1,38 +1,39 @@ /* - * This class was automatically generated with + * This class was automatically generated with * Castor 0.9.6, using an XML * Schema. * $Id$ */ - package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ -//---------------------------------/ +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; +//---------------------------------/ +//- 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 implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ +public class SequenceSet implements java.io.Serializable +{ + //--------------------------/ + //- Class/Member Variables -/ //--------------------------/ /** @@ -60,40 +61,39 @@ public class SequenceSet implements java.io.Serializable { */ private java.util.Vector _annotationList; - - //----------------/ - //- Constructors -/ //----------------/ - - public SequenceSet() { + //- Constructors -/ + //----------------/ + public SequenceSet() + { super(); _sequenceList = new Vector(); _annotationList = new Vector(); - } //-- jalview.binding.SequenceSet() - + } - //-----------/ - //- Methods -/ + //-- jalview.binding.SequenceSet() //-----------/ /** - * Method addAnnotation - * - * - * - * @param vAnnotation + * DOCUMENT ME! + * + * @param vAnnotation DOCUMENT ME! + * + * @throws java.lang.IndexOutOfBoundsException DOCUMENT ME! */ public void addAnnotation(jalview.binding.Annotation vAnnotation) throws java.lang.IndexOutOfBoundsException { _annotationList.addElement(vAnnotation); - } //-- void addAnnotation(jalview.binding.Annotation) + } + + //-- void addAnnotation(jalview.binding.Annotation) /** * Method addAnnotation - * - * - * + * + * + * * @param index * @param vAnnotation */ @@ -101,26 +101,30 @@ public class SequenceSet implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { _annotationList.insertElementAt(vAnnotation, index); - } //-- void addAnnotation(int, jalview.binding.Annotation) + } + + //-- void addAnnotation(int, jalview.binding.Annotation) /** * Method addSequence - * - * - * + * + * + * * @param vSequence */ public void addSequence(jalview.binding.Sequence vSequence) throws java.lang.IndexOutOfBoundsException { _sequenceList.addElement(vSequence); - } //-- void addSequence(jalview.binding.Sequence) + } + + //-- void addSequence(jalview.binding.Sequence) /** * Method addSequence - * - * - * + * + * + * * @param index * @param vSequence */ @@ -128,57 +132,67 @@ public class SequenceSet implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { _sequenceList.insertElementAt(vSequence, index); - } //-- void addSequence(int, jalview.binding.Sequence) + } + + //-- void addSequence(int, jalview.binding.Sequence) /** * Method deleteAligned - * + * */ public void deleteAligned() { - this._has_aligned= false; - } //-- void deleteAligned() + this._has_aligned = false; + } + + //-- void deleteAligned() /** * Method enumerateAnnotation - * - * - * + * + * + * * @return Enumeration */ public java.util.Enumeration enumerateAnnotation() { return _annotationList.elements(); - } //-- java.util.Enumeration enumerateAnnotation() + } + + //-- java.util.Enumeration enumerateAnnotation() /** * Method enumerateSequence - * - * - * + * + * + * * @return Enumeration */ public java.util.Enumeration enumerateSequence() { return _sequenceList.elements(); - } //-- java.util.Enumeration enumerateSequence() + } + + //-- java.util.Enumeration enumerateSequence() /** * Returns the value of field 'aligned'. - * + * * @return boolean * @return the value of field 'aligned'. */ public boolean getAligned() { return this._aligned; - } //-- boolean getAligned() + } + + //-- boolean getAligned() /** * Method getAnnotation - * - * - * + * + * + * * @param index * @return Annotation */ @@ -186,58 +200,70 @@ public class SequenceSet implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _annotationList.size())) { + if ((index < 0) || (index > _annotationList.size())) + { throw new IndexOutOfBoundsException(); } - + return (jalview.binding.Annotation) _annotationList.elementAt(index); - } //-- jalview.binding.Annotation getAnnotation(int) + } + + //-- jalview.binding.Annotation getAnnotation(int) /** * Method getAnnotation - * - * - * + * + * + * * @return Annotation */ public jalview.binding.Annotation[] getAnnotation() { int size = _annotationList.size(); jalview.binding.Annotation[] mArray = new jalview.binding.Annotation[size]; - for (int index = 0; index < size; index++) { + + for (int index = 0; index < size; index++) + { mArray[index] = (jalview.binding.Annotation) _annotationList.elementAt(index); } + return mArray; - } //-- jalview.binding.Annotation[] getAnnotation() + } + + //-- jalview.binding.Annotation[] getAnnotation() /** * Method getAnnotationCount - * - * - * + * + * + * * @return int */ public int getAnnotationCount() { return _annotationList.size(); - } //-- int getAnnotationCount() + } + + //-- 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() + } + + //-- java.lang.String getGapChar() /** * Method getSequence - * - * - * + * + * + * * @param index * @return Sequence */ @@ -245,123 +271,148 @@ public class SequenceSet implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _sequenceList.size())) { + if ((index < 0) || (index > _sequenceList.size())) + { throw new IndexOutOfBoundsException(); } - + return (jalview.binding.Sequence) _sequenceList.elementAt(index); - } //-- jalview.binding.Sequence getSequence(int) + } + + //-- jalview.binding.Sequence getSequence(int) /** * Method getSequence - * - * - * + * + * + * * @return Sequence */ public jalview.binding.Sequence[] getSequence() { int size = _sequenceList.size(); jalview.binding.Sequence[] mArray = new jalview.binding.Sequence[size]; - for (int index = 0; index < size; index++) { + + for (int index = 0; index < size; index++) + { mArray[index] = (jalview.binding.Sequence) _sequenceList.elementAt(index); } + return mArray; - } //-- jalview.binding.Sequence[] getSequence() + } + + //-- jalview.binding.Sequence[] getSequence() /** * Method getSequenceCount - * - * - * + * + * + * * @return int */ public int getSequenceCount() { return _sequenceList.size(); - } //-- int getSequenceCount() + } + + //-- int getSequenceCount() /** * Method hasAligned - * - * - * + * + * + * * @return boolean */ public boolean hasAligned() { return this._has_aligned; - } //-- boolean hasAligned() + } + + //-- boolean hasAligned() /** * Method isValid - * - * - * + * + * + * * @return boolean */ public boolean isValid() { - try { + try + { validate(); } - catch (org.exolab.castor.xml.ValidationException vex) { + catch (org.exolab.castor.xml.ValidationException vex) + { return false; } + return true; - } //-- boolean isValid() + } + + //-- boolean isValid() /** * Method marshal - * - * - * + * + * + * * @param out */ public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } //-- void marshal(java.io.Writer) + } + + //-- void marshal(java.io.Writer) /** * Method marshal - * - * - * + * + * + * * @param handler */ public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + throws java.io.IOException, org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } //-- void marshal(org.xml.sax.ContentHandler) + } + + //-- void marshal(org.xml.sax.ContentHandler) /** * Method removeAllAnnotation - * + * */ public void removeAllAnnotation() { _annotationList.removeAllElements(); - } //-- void removeAllAnnotation() + } + + //-- void removeAllAnnotation() /** * Method removeAllSequence - * + * */ public void removeAllSequence() { _sequenceList.removeAllElements(); - } //-- void removeAllSequence() + } + + //-- void removeAllSequence() /** * Method removeAnnotation - * - * - * + * + * + * * @param index * @return Annotation */ @@ -369,14 +420,17 @@ public class SequenceSet implements java.io.Serializable { { java.lang.Object obj = _annotationList.elementAt(index); _annotationList.removeElementAt(index); + return (jalview.binding.Annotation) obj; - } //-- jalview.binding.Annotation removeAnnotation(int) + } + + //-- jalview.binding.Annotation removeAnnotation(int) /** * Method removeSequence - * - * - * + * + * + * * @param index * @return Sequence */ @@ -384,25 +438,30 @@ public class SequenceSet implements java.io.Serializable { { java.lang.Object obj = _sequenceList.elementAt(index); _sequenceList.removeElementAt(index); + return (jalview.binding.Sequence) obj; - } //-- jalview.binding.Sequence removeSequence(int) + } + + //-- jalview.binding.Sequence removeSequence(int) /** * Sets the value of field 'aligned'. - * + * * @param aligned the value of field 'aligned'. */ public void setAligned(boolean aligned) { this._aligned = aligned; this._has_aligned = true; - } //-- void setAligned(boolean) + } + + //-- void setAligned(boolean) /** * Method setAnnotation - * - * - * + * + * + * * @param index * @param vAnnotation */ @@ -410,43 +469,53 @@ public class SequenceSet implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _annotationList.size())) { + if ((index < 0) || (index > _annotationList.size())) + { throw new IndexOutOfBoundsException(); } + _annotationList.setElementAt(vAnnotation, index); - } //-- void setAnnotation(int, jalview.binding.Annotation) + } + + //-- void setAnnotation(int, jalview.binding.Annotation) /** * Method setAnnotation - * - * - * + * + * + * * @param annotationArray */ public void setAnnotation(jalview.binding.Annotation[] annotationArray) { //-- copy array _annotationList.removeAllElements(); - for (int i = 0; i < annotationArray.length; i++) { + + for (int i = 0; i < annotationArray.length; i++) + { _annotationList.addElement(annotationArray[i]); } - } //-- void setAnnotation(jalview.binding.Annotation) + } + + //-- void setAnnotation(jalview.binding.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) + } + + //-- void setGapChar(java.lang.String) /** * Method setSequence - * - * - * + * + * + * * @param index * @param vSequence */ @@ -454,51 +523,63 @@ public class SequenceSet implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _sequenceList.size())) { + if ((index < 0) || (index > _sequenceList.size())) + { throw new IndexOutOfBoundsException(); } + _sequenceList.setElementAt(vSequence, index); - } //-- void setSequence(int, jalview.binding.Sequence) + } + + //-- void setSequence(int, jalview.binding.Sequence) /** * Method setSequence - * - * - * + * + * + * * @param sequenceArray */ public void setSequence(jalview.binding.Sequence[] sequenceArray) { //-- copy array _sequenceList.removeAllElements(); - for (int i = 0; i < sequenceArray.length; i++) { + + for (int i = 0; i < sequenceArray.length; i++) + { _sequenceList.addElement(sequenceArray[i]); } - } //-- void setSequence(jalview.binding.Sequence) + } + + //-- void setSequence(jalview.binding.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 + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException { - return (jalview.binding.SequenceSet) Unmarshaller.unmarshal(jalview.binding.SequenceSet.class, reader); - } //-- java.lang.Object unmarshal(java.io.Reader) + return (jalview.binding.SequenceSet) Unmarshaller.unmarshal(jalview.binding.SequenceSet.class, + reader); + } + + //-- java.lang.Object unmarshal(java.io.Reader) /** * Method validate - * + * */ - 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() + } + //-- void validate() }