"""
Python module generated from Java source file com.google.common.collect.TreeTraverser

Java source file obtained from artifact guava version 33.3.1-jre

Because this Python module is automatically generated, it may contain errors
and/or code that cannot be parsed. Please report these issues at
https://github.com/magicmq/docs-translator/issues
"""
from com.google.common.annotations import Beta
from com.google.common.annotations import GwtCompatible
from com.google.common.base import Function
from com.google.common.collect import *
from java.util import ArrayDeque
from java.util import Deque
from java.util import Iterator
from java.util import Queue
from java.util.function import Consumer
from javax.annotation import CheckForNull
from typing import Any, Callable, Iterable, Tuple


class TreeTraverser:

    @staticmethod
    def using(nodeToChildrenFunction: "Function"["T", Iterable["T"]]) -> "TreeTraverser"["T"]:
        """
        Returns a tree traverser that uses the given function to navigate from a node to its children.
        This is useful if the function instance already exists, or so that you can supply a lambda
        expressions. If those circumstances don't apply, you probably don't need to use this; subclass
        `TreeTraverser` and implement its .children method directly.

        Since
        - 20.0

        Deprecated
        - Use com.google.common.graph.Traverser.forTree instead. If you are using a
            lambda, these methods have exactly the same signature.
        """
        ...


    def children(self, root: "T") -> Iterable["T"]:
        """
        Returns the children of the specified node. Must not contain null.
        """
        ...


    def preOrderTraversal(self, root: "T") -> "FluentIterable"["T"]:
        """
        Returns an unmodifiable iterable over the nodes in a tree structure, using pre-order traversal.
        That is, each node's subtrees are traversed after the node itself is returned.
        
        No guarantees are made about the behavior of the traversal when nodes change while iteration
        is in progress or when the iterators generated by .children are advanced.

        Deprecated
        - Use com.google.common.graph.Traverser.depthFirstPreOrder instead, which has
            the same behavior.
        """
        ...


    def postOrderTraversal(self, root: "T") -> "FluentIterable"["T"]:
        """
        Returns an unmodifiable iterable over the nodes in a tree structure, using post-order
        traversal. That is, each node's subtrees are traversed before the node itself is returned.
        
        No guarantees are made about the behavior of the traversal when nodes change while iteration
        is in progress or when the iterators generated by .children are advanced.

        Deprecated
        - Use com.google.common.graph.Traverser.depthFirstPostOrder instead, which
            has the same behavior.
        """
        ...


    def breadthFirstTraversal(self, root: "T") -> "FluentIterable"["T"]:
        """
        Returns an unmodifiable iterable over the nodes in a tree structure, using breadth-first
        traversal. That is, all the nodes of depth 0 are returned, then depth 1, then 2, and so on.
        
        No guarantees are made about the behavior of the traversal when nodes change while iteration
        is in progress or when the iterators generated by .children are advanced.

        Deprecated
        - Use com.google.common.graph.Traverser.breadthFirst instead, which has the
            same behavior.
        """
        ...
