@Immutable public final class TreeWithIDSorter extends Object
ITreeWithID instances recursively
- either by ID or by value| Modifier and Type | Method and Description |
|---|---|
static <KEYTYPE extends Comparable<? super KEYTYPE>,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> |
sortByID(IBasicTree<DATATYPE,ITEMTYPE> aTree)
Sort each level of the passed tree on the ID with the specified comparator.
|
static <KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> |
sortByID(IBasicTree<DATATYPE,ITEMTYPE> aTree,
Comparator<? super KEYTYPE> aKeyComparator)
Sort each level of the passed tree on the ID with the specified comparator.
|
static <KEYTYPE,DATATYPE extends Comparable<? super DATATYPE>,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> |
sortByValue(IBasicTree<DATATYPE,ITEMTYPE> aTree)
Sort each level of the passed tree on the value with the specified
comparator.
|
static <KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> |
sortByValue(IBasicTree<DATATYPE,ITEMTYPE> aTree,
Comparator<? super DATATYPE> aValueComparator)
Sort each level of the passed tree on the value with the specified
comparator.
|
public static <KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> void sortByID(@Nonnull IBasicTree<DATATYPE,ITEMTYPE> aTree, @Nonnull Comparator<? super KEYTYPE> aKeyComparator)
KEYTYPE - Tree item key typeDATATYPE - Tree item data typeITEMTYPE - Tree item typeaTree - The tree to be sorted.aKeyComparator - The comparator to be used for sorting the tree item keys on each
level.public static <KEYTYPE extends Comparable<? super KEYTYPE>,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> void sortByID(@Nonnull IBasicTree<DATATYPE,ITEMTYPE> aTree)
Comparable interface.KEYTYPE - Tree item key typeDATATYPE - Tree item data typeITEMTYPE - Tree item typeaTree - The tree to be sorted.public static <KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> void sortByValue(@Nonnull IBasicTree<DATATYPE,ITEMTYPE> aTree, @Nonnull Comparator<? super DATATYPE> aValueComparator)
KEYTYPE - Tree item key typeDATATYPE - Tree item data typeITEMTYPE - Tree item typeaTree - The tree to be sorted.aValueComparator - The comparator to be used for sorting the tree item keys on each
level.public static <KEYTYPE,DATATYPE extends Comparable<? super DATATYPE>,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> void sortByValue(@Nonnull IBasicTree<DATATYPE,ITEMTYPE> aTree)
Comparable interface.KEYTYPE - Tree item key typeDATATYPE - Tree item data typeITEMTYPE - Tree item typeaTree - The tree to be sorted.Copyright © 2014–2016 Philip Helger. All rights reserved.