Package com.portal.pfc.ui
Class TreeTableNodeComparator
java.lang.Object
com.portal.pfc.ui.TreeTableNodeComparator
- All Implemented Interfaces:
Comparator
- Direct Known Subclasses:
AlphaNumericTreeTableNodeComparator,DefaultTreeTableNode.DefaultComparator
Compare two tree nodes. This class is used by DefaultTreeTableModel to sort
the model.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintabstract intcompareColumnValues(Object colVal1, Object colVal2) Compare the two tree table node column values.voidsetAscending(boolean ascending) voidsetAsksAllowsChildren(boolean asksAllowsChildren) Leaf nodes should appear before non-leaf nodes.voidsetColumn(int column) Set the column of the node used for comparisonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
TreeTableNodeComparator
public TreeTableNodeComparator()
-
-
Method Details
-
compareColumnValues
Compare the two tree table node column values.- Parameters:
colVal1-colVal2-- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
-
compare
- Specified by:
comparein interfaceComparator
-
setColumn
public void setColumn(int column) Set the column of the node used for comparison- Parameters:
column-
-
setAscending
public void setAscending(boolean ascending) - Parameters:
ascending- if true then sort in ascending order
-
setAsksAllowsChildren
public void setAsksAllowsChildren(boolean asksAllowsChildren) Leaf nodes should appear before non-leaf nodes.- Parameters:
asksAllowsChildren- if true then the determination of whether or not a node is a leaf is made is based on whether it allows children.
-