JAL-2001 drop isSelected(int) in favour of original ‘contains(int)’ method
[jalview.git] / src / jalview / datamodel / ColumnSelection.java
index 168e43f..c63b6cd 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;
@@ -241,7 +246,8 @@ public class ColumnSelection
 
   /**
    * Returns a list of selected columns. The list contains no duplicates but is
-   * not necessarily ordered.
+   * not necessarily ordered. It also may include columns hidden from the
+   * current view
    */
   public List<Integer> getSelected()
   {
@@ -253,11 +259,11 @@ public class ColumnSelection
    * @param col
    *          index to search for in column selection
    * 
-   * @return true if Integer(col) is in selection.
+   * @return true if col is selected
    */
   public boolean contains(int col)
   {
-    return selected.contains(new Integer(col));
+    return (col > -1) ? selected.isSelected(col) : false;
   }
 
   /**