+ }
+ }
+
+ /**
+ * Returns a read-only view of the (possibly empty) list of selected columns
+ * <p>
+ * The list contains no duplicates but is not necessarily ordered. It also may
+ * include columns hidden from the current view. To modify (for example sort)
+ * the list, you should first make a copy.
+ * <p>
+ * The list is not thread-safe: iterating over it could result in
+ * ConcurrentModificationException if it is modified by another thread.
+ */
+ public List<Integer> getSelected()
+ {
+ return selection.getList();
+ }
+
+ /**
+ * @return list of int arrays containing start and end column position for
+ * runs of selected columns ordered from right to left.
+ */
+ public List<int[]> getSelectedRanges()
+ {
+ return selection.getRanges();
+ }
+
+ /**
+ *
+ * @param col
+ * index to search for in column selection
+ *
+ * @return true if col is selected
+ */
+ public boolean contains(int col)
+ {
+ return (col > -1) ? selection.isSelected(col) : false;
+ }