CHILDTYPE - The data type of the child objects.@Immutable public class ChildrenProviderHasChildren<CHILDTYPE extends IHasChildren<CHILDTYPE>> extends Object implements IChildrenProvider<CHILDTYPE>
IChildrenProvider interface that
works with all types that implement IHasChildren.| Constructor and Description |
|---|
ChildrenProviderHasChildren() |
| Modifier and Type | Method and Description |
|---|---|
Collection<? extends CHILDTYPE> |
getAllChildren(CHILDTYPE aCurrent)
Get the children of the passed object.
|
int |
getChildCount(CHILDTYPE aCurrent) |
boolean |
hasChildren(CHILDTYPE aCurrent)
Check if an item has children.
|
public final boolean hasChildren(@Nullable CHILDTYPE aCurrent)
IChildrenProviderhasChildren in interface IChildrenProvider<CHILDTYPE extends IHasChildren<CHILDTYPE>>aCurrent - The object to determine the children of. No null or
non- null constraint possible.true if this item has children, false
otherwise.@Nonnegative public final int getChildCount(@Nullable CHILDTYPE aCurrent)
getChildCount in interface IChildrenProvider<CHILDTYPE extends IHasChildren<CHILDTYPE>>aCurrent - The object to determine the children count of. No null
or non- null constraint possible.@Nullable public Collection<? extends CHILDTYPE> getAllChildren(@Nullable CHILDTYPE aCurrent)
IChildrenProvidergetAllChildren in interface IChildrenProvider<CHILDTYPE extends IHasChildren<CHILDTYPE>>aCurrent - The object to determine the children of. No null or
non-null constraint possible.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.Copyright © 2014–2015 Philip Helger. All rights reserved.