Package com.helger.tree.sort
Class TreeSorter
- java.lang.Object
-
- com.helger.tree.sort.TreeSorter
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <DATATYPE,ITEMTYPE extends ITreeItem<DATATYPE,ITEMTYPE>>
voidsort(IBasicTree<? extends DATATYPE,ITEMTYPE> aTree, Comparator<? super DATATYPE> aValueComparator)Sort each level of the passed tree with the specified comparator.static <DATATYPE extends Comparable<? super DATATYPE>,ITEMTYPE extends ITreeItem<DATATYPE,ITEMTYPE>>
voidsort(IBasicTree<DATATYPE,ITEMTYPE> aTree)Sort each level of the passed tree with the specified comparator.
-
-
-
Method Detail
-
sort
public static <DATATYPE,ITEMTYPE extends ITreeItem<DATATYPE,ITEMTYPE>> void sort(@Nonnull IBasicTree<? extends DATATYPE,ITEMTYPE> aTree, @Nonnull Comparator<? super DATATYPE> aValueComparator)
Sort each level of the passed tree with the specified comparator.- Type Parameters:
DATATYPE- The tree item data typeITEMTYPE- The tree item type- Parameters:
aTree- The tree to be sorted.aValueComparator- The comparator to be used for sorting the tree items on each level.
-
sort
public static <DATATYPE extends Comparable<? super DATATYPE>,ITEMTYPE extends ITreeItem<DATATYPE,ITEMTYPE>> void sort(@Nonnull IBasicTree<DATATYPE,ITEMTYPE> aTree)
Sort each level of the passed tree with the specified comparator. This method assumes that the values in the tree item implement theComparableinterface.- Type Parameters:
DATATYPE- The tree item data typeITEMTYPE- The tree item type- Parameters:
aTree- The tree to be sorted.
-
-