// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// 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
* @param n
* the PhylogenyNode to add
*/
+ @Override
final public void addAsChild( final PhylogenyNodeI node ) {
final PhylogenyNode n = ( PhylogenyNode ) node;
addChildNode( n );
getDescendants().add( child );
}
+ @Override
final public int compareTo( final PhylogenyNode o ) {
final PhylogenyNode n = o;
if ( ( getName() == null ) || ( n.getName() == null ) ) {
* @throws IllegalArgumentException
* if n is out of bounds
*/
+ @Override
final public PhylogenyNode getChildNode( final int i ) {
if ( isExternal() ) {
throw new UnsupportedOperationException( "attempt to get the child node of an external node." );
* Returns the length of the branch leading to the _parent of this
* PhylogenyNode (double).
*/
+ @Override
final public double getDistanceToParent() {
return _distance_parent;
}
/**
* Returns the ID (int) of this PhylogenyNode.
*/
+ @Override
final public int getId() {
return _id;
}
/**
* Returns the name of this node.
*/
+ @Override
final public String getName() {
return getNodeData().getNodeName();
}
* Sets the length of the branch leading to the _parent of this
* PhylogenyNode to double d.
*/
+ @Override
final public void setDistanceToParent( final double d ) {
_distance_parent = d;
}
/**
* Sets the name of this node.
*/
+ @Override
final public void setName( final String node_name ) {
getNodeData().setNodeName( node_name );
}
/**
* Sets the _parent PhylogenyNode of this PhylogenyNode to n.
*/
+ @Override
final public void setParent( final PhylogenyNode n ) {
_parent = n;
}