|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zul.TreeitemComparator
public class TreeitemComparator
A comparator used to compare Treeitem
, if not live data,
or the data themselves, if live data.
Constructor Summary | |
---|---|
TreeitemComparator()
Compares with Treeitem.getValue() . |
|
TreeitemComparator(int index)
Compares with the column of the specified index. |
|
TreeitemComparator(int index,
boolean ascending,
boolean ignoreCase)
Compares with the column of the specified index. |
|
TreeitemComparator(int index,
boolean ascending,
boolean ignoreCase,
boolean byValue)
Compares with the column of the specified index. |
|
TreeitemComparator(int index,
boolean ascending,
boolean ignoreCase,
boolean byValue,
boolean nullAsMax)
Compares with the column of the specified index. |
|
TreeitemComparator(Treecol treecol,
boolean ascending,
boolean ignoreCase)
Compares with the column which the tree header is at. |
|
TreeitemComparator(Treecol treecol,
boolean ascending,
boolean ignoreCase,
boolean byValue)
Compares with the column which the tree header is at. |
|
TreeitemComparator(Treecol treecol,
boolean ascending,
boolean ignoreCase,
boolean byValue,
boolean nullAsMax)
Compares with the column which the tree header is at. |
Method Summary | |
---|---|
boolean |
byValue()
Returns whether to compare the returned value of Treeitem.getValue() |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
|
boolean |
equals(java.lang.Object o)
|
Treecol |
getTreecol()
Returns the Treecol that this comparator is associated with, or null if not available. |
int |
hashCode()
|
boolean |
isAscending()
Returns whether the order is ascending. |
boolean |
shallIgnoreCase()
Returns whether to ignore case. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TreeitemComparator()
Treeitem.getValue()
.
It assumes the value returned by Treeitem.getValue()
implements Comparable.
Note: It assumes the ascending order and case-insensitive.
If not, use TreeitemComparator(int, boolean, boolean)
instead.
public TreeitemComparator(int index)
0 for the first column, 1 for the second and so on
Note: -1 for Treeitem.getValue()
and it assumes
the value implements Comparable.
Note: It assumes the ascending order, case-insensitive and
comparing the returned values of LabelElement.getLabel()
.
If not, use TreeitemComparator(int, boolean, boolean, boolean)
instead.
A null value is considered as the minimum value.
index
- which column to compare. If -1, Treeitem.getValue()
is used.public TreeitemComparator(int index, boolean ascending, boolean ignoreCase)
0 for the first column, 1 for the second and so on
Note: -1 for Treeitem.getValue()
and it assumes
the value implements Comparable.
Note: it compares the returned value of LabelElement.getLabel()
.
If you want to compare Treeitem.getValue()
.,
use TreeitemComparator(int, boolean, boolean, boolean)
instead.
A null value is considered as the minimum value.
index
- which column to compare. If -1, Treeitem.getValue()
is used.ascending
- whether to sort as ascending (or descending).ignoreCase
- whether to sort case-insensitivepublic TreeitemComparator(int index, boolean ascending, boolean ignoreCase, boolean byValue)
0 for the first column, 1 for the second and so on
Note: -1 for Treeitem.getValue()
and it assumes
the value implements Comparable.
A null value is considered as the minimum value.
index
- which column to compare. If -1, Treeitem.getValue()
is used.ascending
- whether to sort as ascending (or descending).ignoreCase
- whether to sort case-insensitivebyValue
- whether to compare Treeitem.getValue()
.
If false, it compares LabelElement.getLabel()
.
If true, it assumes the value returned by Treeitem.getValue()
implements Comparable.
It is ignored if the index is -1.public TreeitemComparator(int index, boolean ascending, boolean ignoreCase, boolean byValue, boolean nullAsMax)
0 for the first column, 1 for the second and so on
Note: -1 for Treeitem.getValue()
and it assumes
the value implements Comparable.
index
- which column to compare. If -1, Treeitem.getValue()
is used.ascending
- whether to sort as ascending (or descending).ignoreCase
- whether to sort case-insensitivebyValue
- whether to compare Treeitem.getValue()
.
If false, it compares LabelElement.getLabel()
.
If true, it assumes the value returned by Treeitem.getValue()
implements Comparable.
It is ignored if the index is -1.nullAsMax
- whether to consider null as the maximum value.
If false, null is considered as the minimum value.public TreeitemComparator(Treecol treecol, boolean ascending, boolean ignoreCase)
Note: it compares the returned value of LabelElement.getLabel()
.
If you want to compare Treeitem.getValue()
.,
use TreeitemComparator(Treecol, boolean, boolean, boolean)
instead.
A null value is considered as the minimum value.
ascending
- whether to sort as ascending (or descending).ignoreCase
- whether to sort case-insensitivepublic TreeitemComparator(Treecol treecol, boolean ascending, boolean ignoreCase, boolean byValue)
A null value is considered as the minimum value.
ascending
- whether to sort as ascending (or descending).ignoreCase
- whether to sort case-insensitivebyValue
- whether to compare Treeitem.getValue()
.
If false, it compares LabelElement.getLabel()
.public TreeitemComparator(Treecol treecol, boolean ascending, boolean ignoreCase, boolean byValue, boolean nullAsMax)
ascending
- whether to sort as ascending (or descending).ignoreCase
- whether to sort case-insensitivebyValue
- whether to compare Treeitem.getValue()
.
If false, it compares LabelElement.getLabel()
.nullAsMax
- whether to consider null as the maximum value.
If false, null is considered as the minimum value.Method Detail |
---|
public Treecol getTreecol()
public boolean isAscending()
public boolean shallIgnoreCase()
public boolean byValue()
Treeitem.getValue()
public int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
public boolean equals(java.lang.Object o)
equals
in interface java.util.Comparator
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |