org.omnaest.utils.structure.hierarchy.tree
Class TreeNavigator.TreeNodeVisitor.TraversalConfiguration
java.lang.Object
org.omnaest.utils.structure.hierarchy.tree.TreeNavigator.TreeNodeVisitor.TraversalConfiguration
- Enclosing interface:
- TreeNavigator.TreeNodeVisitor<T extends Tree<?,TN>,TN extends TreeNode>
public static class TreeNavigator.TreeNodeVisitor.TraversalConfiguration
- extends Object
Configuration for the TreeNavigator.traverse(TreeNodeVisitor) methods.
As default the current node is included and all children will be traversed, but no already traversed nodes will be visited.
A TreeNavigator.TreeNodeVisitor.TraversalConfiguration is immutable, to change single flags use the copy(Boolean, Boolean, Boolean)
method to create a new TreeNavigator.TreeNodeVisitor.TraversalConfiguration from the current one.
The TreeNavigator.TreeNodeVisitor.TraversalConfiguration implements equals(Object) and hashCode() using the internal flags to
compare. This results that two TreeNavigator.TreeNodeVisitor.TraversalConfiguration instances are treated as equal, if their flag state is equal.
- Author:
- Omnaest
- See Also:
isIncludingCurrentNode(),
isIncludingChildren(),
isIncludingAlreadyTraversedNodes(),
copy(Boolean, Boolean, Boolean)
TreeNavigator.TreeNodeVisitor.TraversalConfiguration
public TreeNavigator.TreeNodeVisitor.TraversalConfiguration(boolean includingCurrentNode,
boolean includingAlreadyTraversedNodes,
boolean includingChildren)
- Parameters:
includingCurrentNode - includingAlreadyTraversedNodes - includingChildren - - See Also:
TreeNavigator.TreeNodeVisitor.TraversalConfiguration
TreeNavigator.TreeNodeVisitor.TraversalConfiguration
public TreeNavigator.TreeNodeVisitor.TraversalConfiguration()
- See Also:
TreeNavigator.TreeNodeVisitor.TraversalConfiguration
copy
public TreeNavigator.TreeNodeVisitor.TraversalConfiguration copy(Boolean includingCurrentNode,
Boolean includingAlreadyTraversedNodes,
Boolean includingChildren)
- Copies the current
TreeNavigator.TreeNodeVisitor.TraversalConfiguration but uses all explicit given flags if they are not null. This means if a
flag should not be overridden it should be set to null.
- Parameters:
includingCurrentNode - includingAlreadyTraversedNodes - includingChildren -
- Returns:
- new
TreeNavigator.TreeNodeVisitor.TraversalConfiguration instance
isIncludingCurrentNode
public boolean isIncludingCurrentNode()
- Returns:
- the includeCurrentNode
isIncludingAlreadyTraversedNodes
public boolean isIncludingAlreadyTraversedNodes()
- Returns:
- the includeAlreadyTraversedNodes
isIncludingChildren
public boolean isIncludingChildren()
- Returns:
- the includeChildren
toString
public String toString()
- Overrides:
toString in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
Copyright © 2013. All Rights Reserved.