package beast.evolution.tree;



import java.util.List;

import beast.evolution.alignment.TaxonSet;
import beast.evolution.tree.Node;

public interface TreeInterface {
    String getID();

    int getLeafNodeCount();
	int getInternalNodeCount();
	int getNodeCount();

	Node getRoot();
    Node getNode(int i);
    Node [] getNodesAsArray();

    List<Node> getExternalNodes();
    List<Node> getInternalNodes();
    
    TaxonSet getTaxonset();
    
	boolean somethingIsDirty();

    public void getMetaData(Node node, Double[] fT, String sPattern);
    public void setMetaData(Node node, Double[] fT, String sPattern);

    /*
    * Note that leaf nodes are always numbered 0,...,nodeCount-1
    * Internal nodes are numbered higher, but the root has no guaranteed 
    * number.
    */
}

@@ -781,10 +781,857 @@
 %0A    */%0A
+%0A%0A    /**%0A     * @param node  top of tree/sub tree (null defaults to whole tree)%0A     * @param nodes array to fill (null will result in creating a new one)%0A     * @return tree nodes in post-order, children before parents%0A     */%0A    default public Node%5B%5D listNodesPostOrder(Node node, Node%5B%5D nodes) %7B%0A        if (node == null) %7B%0A            node = getRoot();%0A        %7D%0A        if (nodes == null) %7B%0A            final int n = node.getNodeCount();%0A            nodes = new Node%5Bn%5D;%0A        %7D%0A        getNodesPostOrder(node, nodes, 0);%0A        return nodes;%0A    %7D%0A%0A    static int%0A    getNodesPostOrder(final Node node, final Node%5B%5D nodes, int pos) %7B%0A        //node.m_tree = this;%0A        for (final Node child : node.children) %7B%0A            pos = getNodesPostOrder(child, nodes, pos);%0A        %7D%0A        nodes%5Bpos%5D = node;%0A        return pos + 1;%0A    %7D%0A
 %7D%0A

Add a (default) interface method to get tree nodes in post-order