Interface IChildrenProviderSorted<CHILDTYPE>

Type Parameters:
CHILDTYPE - The type of the children to retrieve.
All Superinterfaces:
IChildrenProvider<CHILDTYPE>
All Known Implementing Classes:
ChildrenProviderHasChildrenSorted

public interface IChildrenProviderSorted<CHILDTYPE> extends IChildrenProvider<CHILDTYPE>
This interface can be used to generically resolved children of a certain object in a sorted way.
Author:
Philip Helger
  • Method Details

    • getAllChildren

      @Nullable ICommonsList<? extends CHILDTYPE> getAllChildren(@Nullable CHILDTYPE aCurrent)
      Get the children of the passed object.
      Specified by:
      getAllChildren in interface IChildrenProvider<CHILDTYPE>
      Parameters:
      aCurrent - The object to determine the children of. May be null depending on the concrete implementation.
      Returns:
      The child objects, or null if there are no children. If null is passed, the resolver is expected to return any possible top level (root) elements. This method may NOT return null if the call to IChildrenProvider.hasChildren(Object) with the same object returned true.
    • getChildAtIndex

      @Nullable CHILDTYPE getChildAtIndex(@Nullable CHILDTYPE aCurrent, @Nonnegative int nIndex)
      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 by getAllChildren(Object).
      Parameters:
      aCurrent - The object to get the child of. May be null depending 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.