Package com.helger.commons.hierarchy
Interface IChildrenProviderSorted<CHILDTYPE>
- Type Parameters:
CHILDTYPE- The type of the children to retrieve.
- All Superinterfaces:
IChildrenProvider<CHILDTYPE>
- All Known Implementing Classes:
ChildrenProviderHasChildrenSorted
This interface can be used to generically resolved children of a certain
object in a sorted way.
- Author:
- Philip Helger
-
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 interface com.helger.commons.hierarchy.IChildrenProvider
getChildCount, hasChildren, hasNoChildren
-
Method Details
-
getAllChildren
Get the children of the passed object.- Specified by:
getAllChildrenin interfaceIChildrenProvider<CHILDTYPE>- Parameters:
aCurrent- The object to determine the children of. May benulldepending on the concrete implementation.- 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
Get 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 bygetAllChildren(Object).- 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.
- Throws:
IndexOutOfBoundsException- in case the specified index is invalid.
-