Package com.google.common.collect
Class BinaryTreeTraverser<T>
java.lang.Object
com.google.common.collect.TreeTraverser<T>
com.google.common.collect.BinaryTreeTraverser<T>
A variant of
TreeTraverser
for binary trees, providing additional traversals specific to
binary trees.- Since:
- 15.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the children of this node, in left-to-right order.final FluentIterable
<T> inOrderTraversal
(T root) Returns the left child of the specified node, orOptional.absent()
if the specified node has no left child.rightChild
(T root) Returns the right child of the specified node, orOptional.absent()
if the specified node has no right child.Methods inherited from class com.google.common.collect.TreeTraverser
breadthFirstTraversal, postOrderTraversal, preOrderTraversal, using
-
Constructor Details
-
BinaryTreeTraverser
public BinaryTreeTraverser()
-
-
Method Details
-
leftChild
Returns the left child of the specified node, orOptional.absent()
if the specified node has no left child. -
rightChild
Returns the right child of the specified node, orOptional.absent()
if the specified node has no right child. -
children
Returns the children of this node, in left-to-right order.- Specified by:
children
in classTreeTraverser<T>
-
inOrderTraversal
-