Class TreeNode.Utils

  • Enclosing interface:
    TreeNode<T>

    public static class TreeNode.Utils
    extends Object
    Static utility methods relating to tree nodes.
    See Also:
    TreeNode
    • Method Detail

      • traverser

        public static <E> com.google.common.graph.Traverser<TreeNode<E>> traverser()
        Creates and returns a new traverser instance.
        Type Parameters:
        E - the tree node label type
        Returns:
        a traverser
      • childrenFunction

        public static <E> Function<TreeNode<E>,​Iterable<TreeNode<E>>> childrenFunction()
        Creates and returns a new function that gets a node's children.
        Type Parameters:
        E - the tree node label type
        Returns:
        a new function
      • labelFunction

        public static <E> Function<TreeNode<E>,​E> labelFunction()
        Creates and returns a new function that returns the label of a tree node
        Type Parameters:
        E - the tree node label type
        Returns:
        a new function