}
@Override
+ // this is poor, as it only compares on names!
final public int compareTo( final PhylogenyNode o ) {
final PhylogenyNode n = o;
if ( ( getName() == null ) || ( n.getName() == null ) ) {
*
*/
final public boolean equals( final Object o ) {
- System.out.print( " PN___e___ " );
if ( this == o ) {
return true;
}
@Override
final public int hashCode() {
- System.out.print( " PNh " );
final NodeData data = getNodeData();
if ( ( getName().length() < 1 ) && !data.isHasSequence() && !data.isHasTaxonomy() ) {
return super.hashCode();
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.SortedSet;
-import java.util.TreeSet;
+import java.util.Set;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyNode;
private int _speciations_sum;
private final List<PhylogenyNode> _stripped_gene_tree_nodes;
private final List<PhylogenyNode> _stripped_species_tree_nodes;
- private final SortedSet<PhylogenyNode> _mapped_species_tree_nodes;
+ private final Set<PhylogenyNode> _mapped_species_tree_nodes;
/**
* Constructor which sets the gene tree and the species tree to be compared.
_strip_species_tree = strip_species_tree;
_stripped_gene_tree_nodes = new ArrayList<PhylogenyNode>();
_stripped_species_tree_nodes = new ArrayList<PhylogenyNode>();
- _mapped_species_tree_nodes = new TreeSet<PhylogenyNode>();
+ _mapped_species_tree_nodes = new HashSet<PhylogenyNode>();
getSpeciesTree().preOrderReId();
linkNodesOfG();
geneTreePostOrderTraversal( getGeneTree().getRoot() );
}
}
- public SortedSet<PhylogenyNode> getMappedExternalSpeciesTreeNodes() {
+ public Set<PhylogenyNode> getMappedExternalSpeciesTreeNodes() {
return _mapped_species_tree_nodes;
}