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 |
---|---|
ICommonsCollection<? 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasNoChildren
public final boolean hasChildren(@Nullable CHILDTYPE aCurrent)
IChildrenProvider
hasChildren
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 ICommonsCollection<? extends CHILDTYPE> getAllChildren(@Nullable CHILDTYPE aCurrent)
IChildrenProvider
getAllChildren
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–2019 Philip Helger. All rights reserved.