lojix/logic/src/main/com/thesett/aima/logic/fol/Clause.java
public Iterator<Operator<Term>> getChildren(boolean reverse)
    {
        if ((traverser != null) && (traverser instanceof ClauseTraverser))
        {
            return ((ClauseTraverser) traverser).traverse(this, reverse);
        }
        else
        {
            LinkedList<Operator<Term>> resultList = null;

            if (!reverse)
            {
                resultList = new LinkedList<Operator<Term>>();
            }
            else
            {
                resultList = new StackQueue<Operator<Term>>();
            }

            if (head != null)
            {
                resultList.add(head);
            }

            if (body != null)
            {
                for (Term bodyTerm : body)
                {
                    resultList.add(bodyTerm);
                }
            }

            return resultList.iterator();
        }
    }
public Iterator<Operator<Term>> getChildren(boolean reverse)
    {
        if ((traverser != null) && (traverser instanceof ClauseTraverser))
        {
            return ((ClauseTraverser) traverser).traverse(this, reverse);
        }
        else
        {
            LinkedList<Operator<Term>> resultList = null;

            if (!reverse)
            {
                resultList = new LinkedList<Operator<Term>>();
            }
            else
            {
                resultList = new StackQueue<Operator<Term>>();
            }

            if (head != null)
            {
                resultList.add(head);
            }

            if (body != null)
            {
                for (Term bodyTerm : body)
                {
                    resultList.add(bodyTerm);
                }
            }

            return resultList.iterator();
        }
    }
Provides an iterator over the child terms, if there are any. Only functors and clauses are compound, and build
across a list of child arguments.

@param  reverse Set, if the children should be presented in reverse order.

@return The sub-terms of a compound term.