Package com.helger.commons.hierarchy
Class ChildrenProviderHasChildrenSorting<CHILDTYPE extends IHasChildren<CHILDTYPE>>
java.lang.Object
com.helger.commons.hierarchy.ChildrenProviderHasChildren<CHILDTYPE>
com.helger.commons.hierarchy.ChildrenProviderHasChildrenSorting<CHILDTYPE>
- Type Parameters:
CHILDTYPE- The data type of the child objects.
- All Implemented Interfaces:
IChildrenProvider<CHILDTYPE>
@Immutable
public class ChildrenProviderHasChildrenSorting<CHILDTYPE extends IHasChildren<CHILDTYPE>>
extends ChildrenProviderHasChildren<CHILDTYPE>
An implementation of the
IChildrenProvider interface that works
with all types that implement
IHasChildren. It automatically sorts the
returned children by the specified comparator.- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionChildrenProviderHasChildrenSorting(Comparator<? super CHILDTYPE> aComparator) -
Method Summary
Modifier and TypeMethodDescriptionICommonsList<? extends CHILDTYPE> getAllChildren(CHILDTYPE aCurrent) Get the children of the passed object.Comparator<? super CHILDTYPE> Methods inherited from class com.helger.commons.hierarchy.ChildrenProviderHasChildren
getChildCount, hasChildrenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.commons.hierarchy.IChildrenProvider
hasNoChildren
-
Constructor Details
-
ChildrenProviderHasChildrenSorting
-
-
Method Details
-
getComparator
-
getAllChildren
Description copied from interface:IChildrenProviderGet the children of the passed object.- Specified by:
getAllChildrenin interfaceIChildrenProvider<CHILDTYPE extends IHasChildren<CHILDTYPE>>- Overrides:
getAllChildrenin classChildrenProviderHasChildren<CHILDTYPE extends IHasChildren<CHILDTYPE>>- Parameters:
aCurrent- The object to determine the children of. Nonullor non-nullconstraint possible.- Returns:
- The child objects, or
nullif there are no children. Ifnullis passed, the resolver is expected to return any possible top level (root) elements. This method may NOT returnnullif the call toIChildrenProvider.hasChildren(Object)with the same object returnedtrue.
-