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