From: pvtroshin Date: Tue, 21 Dec 2010 18:28:57 +0000 (+0000) Subject: Write javadoc for new datamodel classes , remove some incomplete staff X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1f6064c0e1d3a64b9faabf9a2be4850ec9b06645;p=jabaws.git Write javadoc for new datamodel classes , remove some incomplete staff git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@3555 e3abac25-378b-4346-85de-24260fe3988d --- diff --git a/datamodel/compbio/data/sequence/JalviewAnnotation.java b/datamodel/compbio/data/sequence/JalviewAnnotation.java deleted file mode 100644 index cf19937..0000000 --- a/datamodel/compbio/data/sequence/JalviewAnnotation.java +++ /dev/null @@ -1,7 +0,0 @@ -package compbio.data.sequence; - -public class JalviewAnnotation { - - String annotation; - -} diff --git a/datamodel/compbio/data/sequence/MultiAnnotatedSequence.java b/datamodel/compbio/data/sequence/MultiAnnotatedSequence.java index 92d475d..1212a7d 100644 --- a/datamodel/compbio/data/sequence/MultiAnnotatedSequence.java +++ b/datamodel/compbio/data/sequence/MultiAnnotatedSequence.java @@ -79,8 +79,4 @@ public class MultiAnnotatedSequence> { return value; } - public JalviewAnnotation toJalviewAnnotation() { - // TODO Auto-generated method stub - return null; - } } diff --git a/datamodel/compbio/data/sequence/Score.java b/datamodel/compbio/data/sequence/Score.java index 127df64..d401aa8 100644 --- a/datamodel/compbio/data/sequence/Score.java +++ b/datamodel/compbio/data/sequence/Score.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.text.NumberFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; @@ -15,11 +16,17 @@ import javax.xml.bind.annotation.XmlAccessorType; import compbio.util.annotation.Immutable; +/** + * A value class for AACon annotation results storage + * + * @author pvtroshin + * + */ @XmlAccessorType(XmlAccessType.FIELD) @Immutable public class Score { - public static final NumberFormat NUMBER_FORMAT = NumberFormat + static final NumberFormat NUMBER_FORMAT = NumberFormat .getNumberInstance(Locale.UK); static { NUMBER_FORMAT.setGroupingUsed(false); @@ -34,15 +41,35 @@ public class Score { // JaXB default constructor } + /** + * Instantiate the Score + * + * @param method + * the ConservationMethod with which {@code scores} were + * calculated + * @param scores + * the actual conservation values for each column of the + * alignment + */ public Score(ConservationMethod method, List scores) { this.method = method; - this.scores = scores; + this.scores = new ArrayList(scores); } + /** + * Returns the ConservationMethod + * + * @return the ConservationMethod + */ public ConservationMethod getMethod() { return method; } + /** + * The column scores for the alignment + * + * @return the column scores for the alignment + */ public List getScores() { return scores; } @@ -88,8 +115,35 @@ public class Score { return true; } + /** + * Outputs the List of Score objects into the Output stream. The output + * format is as follows: + * + *
+	 * 	  #MethodName 
+	 * 	  
+	 * For example:
+	 * 	 
+	 * 	  #KABAT 0.2 0.3 0.2 0 0.645 0.333 1 1 0 0
+	 *    #SMERFS 0.645 0.333 1 1 0 0 0.2 0.3 0.2 0
+	 * 
+ * + * The maximum precision for values is 3 digits, but can be less. + * + * @param scores + * the list of scores to output + * @param output + * the stream to output the data to + * @throws IOException + * if the OutputStream cannot be written into + * @throws NullPointerException + * if the output stream is null + */ public static void write(Set scores, OutputStream output) throws IOException { + if (output == null) { + throw new NullPointerException("OutputStream must be provided!"); + } BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( output)); for (Score score : scores) { diff --git a/website/AAConWSClientExample.pdf b/website/AAConWSClientExample.pdf deleted file mode 100644 index 82a315e..0000000 Binary files a/website/AAConWSClientExample.pdf and /dev/null differ