lojix/search/src/main/com/thesett/aima/search/util/TreeSearchState.java
public Iterator<Operator<Tree<E>>> validOperators(boolean reverse)
    {
        /*log.fine("public Iterator<Operator> validOperators(): called");*/

        // Check if the tree is a leaf and return an empty iterator if so.
        if (tree.isLeaf())
        {
            /*log.fine("is leaf");*/

            return new ArrayList<Operator<Tree<E>>>().iterator();
        }

        // Generate an iterator over the child trees of the current node, encapsulating them as operators.
        else
        {
            /*log.fine("is node");*/

            Tree.Node<E> node = tree.getAsNode();

            return new TreeSearchOperatorIterator<E>(node.getChildIterator());
        }
    }
public Iterator<Operator<Tree<E>>> validOperators(boolean reverse)
    {
        /*log.fine("public Iterator<Operator> validOperators(): called");*/

        // Check if the tree is a leaf and return an empty iterator if so.
        if (tree.isLeaf())
        {
            /*log.fine("is leaf");*/

            return new ArrayList<Operator<Tree<E>>>().iterator();
        }

        // Generate an iterator over the child trees of the current node, encapsulating them as operators.
        else
        {
            /*log.fine("is node");*/

            Tree.Node<E> node = tree.getAsNode();

            return new TreeSearchOperatorIterator<E>(node.getChildIterator());
        }
    }
public Iterator < Operator < Tree < E > > > validOperators ( boolean reverse ) { /*log.fine("public Iterator<Operator> validOperators(): called");*/ // Check if the tree is a leaf and return an empty iterator if so. if ( tree . isLeaf ( ) ) { /*log.fine("is leaf");*/ return new ArrayList < Operator < Tree < E > > > ( ) . iterator ( ) ; } // Generate an iterator over the child trees of the current node, encapsulating them as operators. else { /*log.fine("is node");*/ Tree . Node < E > node = tree . getAsNode ( ) ; return new TreeSearchOperatorIterator < E > ( node . getChildIterator ( ) ) ; } }
Gets all operators valid from this state. If the current tree to search has any children these are encoded as
operators to access those child trees as tree search states. If the current tree is a leaf then an empty iterator
is returned.

@param  reverse <tt>true</tt> if the operators are to be presented in reverse order.

@return An iterator over all the operators that may be applied to this state.
Gets all operators valid from this state . If the current tree to search has any children these are encoded as operators to access those child trees as tree search states . If the current tree is a leaf then an empty iterator is returned .