public class VectorComparator
extends java.lang.Object
implements java.util.Comparator
Modifier and Type | Field and Description |
---|---|
static int |
COMP_TYPE_NORMAL_STRING |
static int |
COMP_TYPE_NUMBER |
static int |
COMP_TYPE_WITH_LENGTH_STRING |
Constructor and Description |
---|
VectorComparator()
建構子
|
VectorComparator(int[] sortCol)
建構子
|
VectorComparator(int[] sortCol,
boolean sortAsc)
建構子
|
VectorComparator(int[] sortCol,
boolean[] sortAsc)
建構子
|
VectorComparator(int[] sortCol,
boolean[] sortAsc,
java.lang.Class[] sortclass) |
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object obj1,
java.lang.Object obj2)
實作比較的法則
|
boolean |
equals(java.lang.Object obj)
需實作兩個比較元素何時相等
|
void |
setCompareType(int[] types) |
void |
setM_sortAsc(boolean newM_sortAsc)
設定比較結果的遞增或遞減排列方式
|
void |
setSortAsc(boolean[] newM_sortAsc)
設定比較結果的遞增或遞減排列方式
|
void |
setSortKeyObjectClass(java.lang.Class[] in) |
void |
setTargetColumn(int[] newM_sortCol)
設定欲比較的Column
|
public static int COMP_TYPE_NORMAL_STRING
public static int COMP_TYPE_NUMBER
public static int COMP_TYPE_WITH_LENGTH_STRING
public VectorComparator(int[] sortCol, boolean[] sortAsc)
int[]
- sortCol 設定欲比較的Column,從0開始boolean[]
- sortAsc個別欄位遞增或遞減排列方式public VectorComparator(int[] sortCol, boolean[] sortAsc, java.lang.Class[] sortclass)
public VectorComparator(int[] sortCol, boolean sortAsc)
int[]sortCol
- 設定欲比較的Columnboolean
- sortAsc全體遞增或遞減排列方式public VectorComparator(int[] sortCol)
sortCol
- 設定欲比較的Columnpublic VectorComparator()
sortCol
- 設定欲比較的Columnpublic int compare(java.lang.Object obj1, java.lang.Object obj2)
compare
in interface java.util.Comparator
obj1
- java.lang.Object 比較元素1obj2
- java.lang.Object 比較元素2public boolean equals(java.lang.Object obj)
equals
in interface java.util.Comparator
equals
in class java.lang.Object
public void setSortAsc(boolean[] newM_sortAsc)
boolean
- 比較結果的遞增或遞減排列方式public void setM_sortAsc(boolean newM_sortAsc)
boolean
- 比較結果的遞增或遞減排列方式public void setCompareType(int[] types)
public void setTargetColumn(int[] newM_sortCol)
newM_sortAsc
- int 欲比較的Columnpublic void setSortKeyObjectClass(java.lang.Class[] in)