Decision Center API

ilog.rules.teamserver.web.tree
Interface IlrTreeSorter

All Known Implementing Classes:
IlrDefaultTreeSorter

public interface IlrTreeSorter

A tree sorter allows you to reorder the nodes provided by the tree's model.

See Also:
IlrTreeDataProvider, IlrTreeController.getTreeSorter()

Method Summary
 int category(IlrTreeNode node)
          Returns the category of a node.
 int compare(IlrTreeController controller, IlrTreeNode node1, IlrTreeNode node2, boolean ignoreCase)
          Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.
 

Method Detail

category

int category(IlrTreeNode node)
Returns the category of a node.

A common use is to categorize the node to optimize the sorting.

Parameters:
node - The node.
Returns:
A category.

compare

int compare(IlrTreeController controller,
            IlrTreeNode node1,
            IlrTreeNode node2,
            boolean ignoreCase)
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.

Note: The ignoreCase argument is relevant in case of string comparisons.

Parameters:
controller - The tree controller.
node1 - The first node.
node2 - The second node.
ignoreCase - true if the method should not be case sensitive, and false otherwise.
Returns:
A negative number if the first element is less than the second element; the value 0 if the first element is equal to the second element; and a positive number if the first element is greater than the second element.

Decision Center API

© Copyright IBM Corp. 1987, 2013