CHILDTYPE - The type of the children.public interface IHasChildrenSorted<CHILDTYPE> extends IHasChildren<CHILDTYPE>
IHasChildren by indicating that the child items are sorted!| Modifier and Type | Method and Description |
|---|---|
default CHILDTYPE |
findFirstChild(Predicate<? super CHILDTYPE> aFilter)
Find the first direct child that matches the passed predicate.
|
default <DSTTYPE> DSTTYPE |
findFirstChildMapped(Predicate<? super CHILDTYPE> aFilter,
Function<? super CHILDTYPE,? extends DSTTYPE> aMapper)
Find the first direct child that matches the passed predicate.
|
ICommonsList<? extends CHILDTYPE> |
getAllChildren() |
CHILDTYPE |
getChildAtIndex(int nIndex)
Get the child node at the specified index
|
default CHILDTYPE |
getFirstChild()
Get the first child node or
null if no child is present |
default CHILDTYPE |
getLastChild()
Get the last child node or
null if no child is present |
forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getChildCount, getChildren, hasChildren, hasNoChildren@Nullable ICommonsList<? extends CHILDTYPE> getAllChildren()
getAllChildren in interface IHasChildren<CHILDTYPE>null if no
children are present.IHasChildren.hasChildren(),
IHasChildren.getChildren()@Nullable CHILDTYPE getChildAtIndex(@Nonnegative int nIndex)
nIndex - The index to be queried. May not be < 0 or ≥ the number of
childrennull if the index
is invalid.IndexOutOfBoundsException - in case the index is invalid@Nullable default CHILDTYPE getFirstChild()
null if no child is presentnull.@Nullable default CHILDTYPE findFirstChild(@Nonnull Predicate<? super CHILDTYPE> aFilter)
aFilter - The filter that is applied on each direct child node. May not be
null.null if no direct child matches the passed filter or
if no child is present at all.@Nullable default <DSTTYPE> DSTTYPE findFirstChildMapped(@Nonnull Predicate<? super CHILDTYPE> aFilter, @Nonnull Function<? super CHILDTYPE,? extends DSTTYPE> aMapper)
DSTTYPE - The destination type to be mapped toaFilter - The filter that is applied on each direct child node. May not be
null.aMapper - The mapping function from micro node to the target type. May not be
null.null if no direct child matches the passed filter or
if no child is present at all.Copyright © 2014–2022 Philip Helger. All rights reserved.