X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FResidueCount.java;h=bb604d03c00e2cf06ff39b845dc10e79d591a831;hb=881c6a099be11108b04ff7446204dfc0623fb0b2;hp=3e3a9666ddf2061e6d19e9f9fb30ca22b63136e2;hpb=5776cb3b3d74f3c3d3d791d56287d8d78e46b01b;p=jalview.git diff --git a/src/jalview/datamodel/ResidueCount.java b/src/jalview/datamodel/ResidueCount.java index 3e3a966..bb604d0 100644 --- a/src/jalview/datamodel/ResidueCount.java +++ b/src/jalview/datamodel/ResidueCount.java @@ -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++;