Class TreeTableNodeComparator

java.lang.Object
com.portal.pfc.ui.TreeTableNodeComparator
All Implemented Interfaces:
Comparator
Direct Known Subclasses:
AlphaNumericTreeTableNodeComparator, DefaultTreeTableNode.DefaultComparator

public abstract class TreeTableNodeComparator extends Object implements Comparator
Compare two tree nodes. This class is used by DefaultTreeTableModel to sort the model.
  • Constructor Details

    • TreeTableNodeComparator

      public TreeTableNodeComparator()
  • Method Details

    • compareColumnValues

      public abstract int compareColumnValues(Object colVal1, Object colVal2)
      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

      public int compare(Object o1, Object o2)
      Specified by:
      compare in interface Comparator
    • 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.