JAL-2001 faster check for a column being selected
authorJim Procter <jprocter@issues.jalview.org>
Mon, 4 Apr 2016 14:21:04 +0000 (15:21 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 4 Apr 2016 14:21:04 +0000 (15:21 +0100)
TODO: consider deprecate Integer variant ?

src/jalview/datamodel/ColumnSelection.java

index a5d2ddd..cfe4685 100644 (file)
@@ -170,6 +170,11 @@ public class ColumnSelection
       selected.or(mask);
     }
 
+    public boolean isSelected(int column)
+    {
+      return selected.get(column);
+    }
+
     public int getMaxColumn()
     {
       return selected.length() - 1;
@@ -258,7 +263,7 @@ public class ColumnSelection
    */
   public boolean contains(int col)
   {
-    return selected.contains(new Integer(col));
+    return selected.isSelected(col);
   }
 
   /**
@@ -1488,4 +1493,9 @@ public class ColumnSelection
     } while (count < annotations.length);
     return false;
   }
+
+  public boolean isSelected(int column)
+  {
+    return selected.isSelected(column);
+  }
 }