From 2e5d563a1a639e338a9b2e9742ebd4a96c6c3e45 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 4 Apr 2016 15:21:04 +0100 Subject: [PATCH] JAL-2001 faster check for a column being selected TODO: consider deprecate Integer variant ? --- src/jalview/datamodel/ColumnSelection.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java index a5d2ddd..cfe4685 100644 --- a/src/jalview/datamodel/ColumnSelection.java +++ b/src/jalview/datamodel/ColumnSelection.java @@ -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); + } } -- 1.7.10.2