DATATYPE - The type of object in the hierarchy to be iteratedpublic class DefaultHierarchyVisitorCallback<DATATYPE> extends Object implements IHierarchyVisitorCallback<DATATYPE>
IHierarchyVisitorCallback interface
doing nothing except counting levels.| Constructor and Description |
|---|
DefaultHierarchyVisitorCallback() |
DefaultHierarchyVisitorCallback(int nInitialLevel) |
| Modifier and Type | Method and Description |
|---|---|
int |
getLevel() |
EHierarchyVisitorReturn |
onItemAfterChildren(DATATYPE aItem)
Called after eventual children of the current item were visited.
|
EHierarchyVisitorReturn |
onItemBeforeChildren(DATATYPE aItem)
Called before children of the current item are visited.
|
void |
onLevelDown()
Called before the tree walker descends into the next tree level.
|
void |
onLevelUp()
Called after the tree walker ascends into the previous tree level.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbegin, endpublic DefaultHierarchyVisitorCallback()
public DefaultHierarchyVisitorCallback(int nInitialLevel)
@Nonnegative public int getLevel()
getLevel in interface IHierarchyVisitorCallback<DATATYPE>@OverridingMethodsMustInvokeSuper public void onLevelDown()
IHierarchyVisitorCallbackIHierarchyVisitorCallback.getLevel() should return a value increased by 1.onLevelDown in interface IHierarchyVisitorCallback<DATATYPE>@OverridingMethodsMustInvokeSuper public void onLevelUp()
IHierarchyVisitorCallbackIHierarchyVisitorCallback.getLevel() should return a value decreased by 1.onLevelUp in interface IHierarchyVisitorCallback<DATATYPE>@Nonnull public EHierarchyVisitorReturn onItemBeforeChildren(DATATYPE aItem)
IHierarchyVisitorCallbackonItemBeforeChildren in interface IHierarchyVisitorCallback<DATATYPE>aItem - The current item. May be null.null status code that determines how to continue
iteration.@Nonnull public EHierarchyVisitorReturn onItemAfterChildren(DATATYPE aItem)
IHierarchyVisitorCallbackIHierarchyVisitorCallback.onItemBeforeChildren(Object) was
called.onItemAfterChildren in interface IHierarchyVisitorCallback<DATATYPE>aItem - The current item. May be null.null status code that determines how to continue
iteration.Copyright © 2014–2020 Philip Helger. All rights reserved.