JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / datamodel / ResidueCount.java
index 3e3a966..bb604d0 100644 (file)
@@ -28,6 +28,7 @@ import jalview.util.SparseCount;
 /**
  * A class to count occurrences of residues in a profile, optimised for speed
  * and memory footprint.
+ * 
  * @author gmcarstairs
  *
  */
@@ -75,9 +76,10 @@ public class ResidueCount
    * fast lookup tables holding the index into our count
    * arrays of each symbol; index 0 is reserved for gap counting
    */
-  private static int[] NUC_INDEX = new int[26];
+  private final static int[] NUC_INDEX = new int[26];
+
+  private final static int[] AA_INDEX = new int[26];
 
-  private static int[] AA_INDEX = new int[26];
   static
   {
     for (int i = 0; i < NUCS.length(); i++)
@@ -447,8 +449,8 @@ public class ResidueCount
       {
         if (intCounts[i] == count)
         {
-          modal.append(isNucleotide ? NUCS.charAt(i - 1) : AAS
-                  .charAt(i - 1));
+          modal.append(
+                  isNucleotide ? NUCS.charAt(i - 1) : AAS.charAt(i - 1));
         }
       }
     }
@@ -458,8 +460,8 @@ public class ResidueCount
       {
         if (counts[i] == count)
         {
-          modal.append(isNucleotide ? NUCS.charAt(i - 1) : AAS
-                  .charAt(i - 1));
+          modal.append(
+                  isNucleotide ? NUCS.charAt(i - 1) : AAS.charAt(i - 1));
         }
       }
     }
@@ -492,7 +494,8 @@ public class ResidueCount
    * 
    * @return
    */
-  public int size() {
+  public int size()
+  {
     int size = 0;
     if (useIntCounts)
     {
@@ -546,8 +549,8 @@ public class ResidueCount
       {
         if (intCounts[i] > 0)
         {
-          char symbol = isNucleotide ? NUCS.charAt(i - 1) : AAS
-                  .charAt(i - 1);
+          char symbol = isNucleotide ? NUCS.charAt(i - 1)
+                  : AAS.charAt(i - 1);
           symbols[j] = symbol;
           values[j] = intCounts[i];
           j++;
@@ -560,8 +563,8 @@ public class ResidueCount
       {
         if (counts[i] > 0)
         {
-          char symbol = isNucleotide ? NUCS.charAt(i - 1) : AAS
-                  .charAt(i - 1);
+          char symbol = isNucleotide ? NUCS.charAt(i - 1)
+                  : AAS.charAt(i - 1);
           symbols[j] = symbol;
           values[j] = counts[i];
           j++;