Merge branch 'develop' into update_212_Dec_merge_with_21125_chamges
[jalview.git] / src / jalview / datamodel / ResidueCount.java
index aaf6988..4ca4c80 100644 (file)
@@ -72,7 +72,7 @@ public class ResidueCount
    */
   private static final String AAS = "ACDEFGHIKLMNPQRSTUVWXY";
 
-  private static final int GAP_COUNT = 0;
+  static final int GAP_COUNT = 0;
 
   /*
    * fast lookup tables holding the index into our count
@@ -232,7 +232,12 @@ public class ResidueCount
         counts[offset] = (short) ++newValue;
       }
     }
-    maxCount = Math.max(maxCount, newValue);
+
+    if (offset != GAP_COUNT)
+    {
+      // update modal residue count
+      maxCount = Math.max(maxCount, newValue);
+    }
     return newValue;
   }
 
@@ -321,15 +326,7 @@ public class ResidueCount
    */
   public int addGap()
   {
-    int newValue;
-    if (useIntCounts)
-    {
-      newValue = ++intCounts[GAP_COUNT];
-    }
-    else
-    {
-      newValue = ++counts[GAP_COUNT];
-    }
+    int newValue = increment(GAP_COUNT);
     return newValue;
   }
 
@@ -666,7 +663,7 @@ public class ResidueCount
    * 
    * @return
    */
-  public int getTotalCount()
+  public int getTotalResidueCount()
   {
     int total = 0;
     for (char symbol : this.getSymbolCounts().symbols)