score is a double, fix bugs for score only annotation not being associated with sequences
authorjprocter <Jim Procter>
Thu, 26 Apr 2007 17:11:27 +0000 (17:11 +0000)
committerjprocter <Jim Procter>
Thu, 26 Apr 2007 17:11:27 +0000 (17:11 +0000)
src/jalview/datamodel/AlignmentAnnotation.java

index acb02b1..20a3633 100755 (executable)
@@ -57,7 +57,7 @@ public class AlignmentAnnotation
   /**
    * Score associated with label and description.
    */
-  public float score= Float.NaN;
+  public double score= Double.NaN;
   /**
    * flag indicating if annotation has a score.
    */
@@ -483,13 +483,13 @@ Loading...
     {
       return;
     }
+    sequenceRef=seqRef;
     if (annotations==null)
     {
       return;
     }
     sequenceMapping = new java.util.Hashtable();
 
-    sequenceRef = seqRef;
     int seqPos;
 
     for (int i = 0; i < annotations.length; i++)
@@ -616,7 +616,7 @@ Loading...
   /**
    * @return the score
    */
-  public float getScore()
+  public double getScore()
   {
     return score;
   }
@@ -624,8 +624,9 @@ Loading...
   /**
    * @param score the score to set
    */
-  public void setScore(float score)
+  public void setScore(double score)
   {
+    hasScore=true;
     this.score = score;
   }
   /**
@@ -634,6 +635,6 @@ Loading...
    */
   public boolean hasScore()
   {
-    return hasScore;
+    return hasScore || !Double.isNaN(score);
   }
 }