View Javadoc
1   package org.csveed.common;
2   
3   public class ColumnIndexKey extends ColumnKey {
4   
5       private final Integer columnIndex;
6   
7       public ColumnIndexKey(int columnIndex) {
8           this.columnIndex = columnIndex;
9       }
10  
11      @Override
12      public int compareTo(ColumnKey columnKey) {
13          if (!sameKeyType(columnKey)) {
14              return keyTypeCompare(columnKey);
15          }
16          return this.columnIndex.compareTo(((ColumnIndexKey)columnKey).columnIndex);
17      }
18  
19      @Override
20      public boolean equals(Object obj) {
21          if (!(obj instanceof ColumnIndexKey)) {
22              return false;
23          }
24          return compareTo((ColumnIndexKey)obj) == 0;
25      }
26  
27      @Override
28      public int hashCode() {
29          return columnIndex.hashCode();
30      }
31  
32      @Override
33      public String toString() {
34          return "Column Index: "+columnIndex;
35      }
36  
37      @Override
38      public Integer getPriority() {
39          return 1;
40      }
41  }