// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.data.Taxonomy;
-import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
public class TaxonomyAssigner extends SDI {
- public TaxonomyAssigner( final Phylogeny gene_tree, final Phylogeny species_tree ) {
+ public TaxonomyAssigner( final Phylogeny gene_tree, final Phylogeny species_tree ) throws SdiException {
super( gene_tree, species_tree );
getSpeciesTree().preOrderReId();
linkNodesOfG();
void geneTreePostOrderTraversal( final PhylogenyNode g ) {
if ( !g.isExternal() ) {
- for( final PhylogenyNodeIterator iter = g.iterateChildNodesForward(); iter.hasNext(); ) {
- geneTreePostOrderTraversal( iter.next() );
+ for( int i = 0; i < g.getNumberOfDescendants(); ++i ) {
+ geneTreePostOrderTraversal( g.getChildNode( i ) );
}
final PhylogenyNode[] linked_nodes = new PhylogenyNode[ g.getNumberOfDescendants() ];
for( int i = 0; i < linked_nodes.length; ++i ) {
}
}
- public static void execute( final Phylogeny gene_tree, final Phylogeny species_tree ) {
+ public static void execute( final Phylogeny gene_tree, final Phylogeny species_tree ) throws SdiException {
new TaxonomyAssigner( gene_tree, species_tree );
}
}