Package com.helger.commons.hierarchy
Class ChildrenProviderHasChildrenSorted<CHILDTYPE extends IHasChildrenSorted<CHILDTYPE>>
java.lang.Object
com.helger.commons.hierarchy.ChildrenProviderHasChildren<CHILDTYPE>
com.helger.commons.hierarchy.ChildrenProviderHasChildrenSorted<CHILDTYPE>
- Type Parameters:
CHILDTYPE- The data type of the child objects.
- All Implemented Interfaces:
IChildrenProvider<CHILDTYPE>,IChildrenProviderSorted<CHILDTYPE>
@Immutable
public final class ChildrenProviderHasChildrenSorted<CHILDTYPE extends IHasChildrenSorted<CHILDTYPE>>
extends ChildrenProviderHasChildren<CHILDTYPE>
implements IChildrenProviderSorted<CHILDTYPE>
An
IChildrenProviderSorted implementation for object implementing the
IHasChildrenSorted interface.- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionICommonsList<? extends CHILDTYPE> getAllChildren(CHILDTYPE aCurrent) Get the children of the passed object.getChildAtIndex(CHILDTYPE aCurrent, int nIndex) Get the child of the passed object at the given index.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
getChildCount, hasChildren, hasNoChildren
-
Constructor Details
-
ChildrenProviderHasChildrenSorted
public ChildrenProviderHasChildrenSorted()
-
-
Method Details
-
getAllChildren
Description copied from interface:IChildrenProviderGet the children of the passed object.- Specified by:
getAllChildrenin interfaceIChildrenProvider<CHILDTYPE extends IHasChildrenSorted<CHILDTYPE>>- Specified by:
getAllChildrenin interfaceIChildrenProviderSorted<CHILDTYPE extends IHasChildrenSorted<CHILDTYPE>>- Overrides:
getAllChildrenin classChildrenProviderHasChildren<CHILDTYPE extends IHasChildrenSorted<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.
-
getChildAtIndex
Description copied from interface:IChildrenProviderSortedGet the child of the passed object at the given index. It is assumed that objects are accessed in exactly the same order as they are delivered byIChildrenProviderSorted.getAllChildren(Object).- Specified by:
getChildAtIndexin interfaceIChildrenProviderSorted<CHILDTYPE extends IHasChildrenSorted<CHILDTYPE>>- Parameters:
aCurrent- The object to get the child of. May benulldepending on the concrete implementation.nIndex- The index to retrieve the child at.- Returns:
- The child at the specified index. May not be < 0.
-