6 * NOTE: Columns are zero based.
\r
8 public class ColumnSelection {
\r
9 Vector selected = new Vector();
\r
11 public void addElement(int col) {
\r
12 selected.addElement(new Integer(col));
\r
15 public void clear() {
\r
16 selected.removeAllElements();
\r
19 public void removeElement(int col) {
\r
20 Integer colInt = new Integer(col);
\r
21 if (selected.contains(colInt)) {
\r
22 selected.removeElement(colInt);
\r
24 System.err.println("WARNING: Tried to remove Integer NOT in ColumnSelection");
\r
28 public boolean contains(int col) {
\r
29 return selected.contains(new Integer(col));
\r
32 public int columnAt(int i) {
\r
33 return ((Integer)selected.elementAt(i)).intValue();
\r
37 return selected.size();
\r
40 public int getMax() {
\r
43 for (int i=0;i<selected.size();i++) {
\r
44 if (columnAt(i) > max) {
\r
51 public int getMin() {
\r
52 int min = 1000000000;
\r
54 for (int i=0;i<selected.size();i++) {
\r
55 if (columnAt(i) < min) {
\r
62 public Vector asVector() {
\r
66 public void compensateForEdit(int start, int change) {
\r
67 for (int i=0; i < size();i++) {
\r
68 int temp = columnAt(i);
\r
70 if (temp >= start) {
\r
71 selected.setElementAt(new Integer(temp-change),i);
\r