JAL-1473 refactor score matrices and tree score calculations to interface/api and...
[jalview.git] / src / jalview / schemes / ScoreMatrix.java
index e78b92c..ab603e1 100644 (file)
  */
 package jalview.schemes;
 
-public class ScoreMatrix
+import jalview.analysis.scoremodels.PairwiseSeqScoreModel;
+import jalview.api.analysis.ScoreModelI;
+
+public class ScoreMatrix extends PairwiseSeqScoreModel implements ScoreModelI
 {
   String name;
+  
+  @Override
+  public String getName()
+  {
+    return name;
+  }
 
   /**
    * reference to integer score matrix
@@ -31,23 +40,31 @@ public class ScoreMatrix
    * 0 for Protein Score matrix. 1 for dna score matrix
    */
   int type;
-
+  /**
+   * 
+   * @param name Unique, human readable name for the matrix
+   * @param matrix Pairwise scores indexed according to appropriate symbol alphabet
+   * @param type 0 for Protein, 1 for NA
+   */
   ScoreMatrix(String name, int[][] matrix, int type)
   {
     this.matrix = matrix;
     this.type = type;
+    this.name = name;
   }
 
+  @Override
   public boolean isDNA()
   {
     return type == 1;
   }
-
+  @Override
   public boolean isProtein()
   {
     return type == 0;
   }
 
+  @Override
   public int[][] getMatrix()
   {
     return matrix;