+ synchronized final protected void setId( final long i ) {
+ if ( i < getNodeCount() ) {
+ throw new IllegalArgumentException( "attempt to set node id to a value less than total node count (thus violating the uniqueness of node ids)" );
+ }
+ _id = i;
+ }
+
+ final BranchData getBranchDataDirectly() {
+ return _branch_data;
+ }
+
+ final NodeData getNodeDataDirectly() {
+ return _node_data;
+ }
+
+ final void setChildNodeOnly( final int i, final PhylogenyNode node ) {
+ if ( getNumberOfDescendants() <= i ) {
+ addChildNode( node );
+ }
+ else {
+ getDescendants().set( i, node );
+ }
+ }
+
+ /**
+ * Sets the indicators of all the children of this PhylogenyNode to zero.
+ */
+ final void setIndicatorsToZero() {
+ for( final PreorderTreeIterator it = new PreorderTreeIterator( this ); it.hasNext(); ) {
+ it.next().setIndicator( ( byte ) 0 );
+ }
+ }
+
+ /**
+ * Adds PhylogenyNode n to the list of child nodes. But does NOT set the
+ * _parent of n to this.
+ *
+ * @see addAsChild( PhylogenyNode n )
+ * @param n
+ * the PhylogenyNode to add
+ */
+ final private void addChildNode( final PhylogenyNode child ) {
+ getDescendants().add( child );
+ }
+
+ public static PhylogenyNode createInstanceFromNhxString( final String nhx ) throws NHXFormatException,
+ PhyloXmlDataFormatException {
+ return new PhylogenyNode( nhx, NHXParser.TAXONOMY_EXTRACTION.NO, false );
+ }
+
+ public static PhylogenyNode createInstanceFromNhxString( final String nhx,
+ final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction )
+ throws NHXFormatException, PhyloXmlDataFormatException {
+ return new PhylogenyNode( nhx, taxonomy_extraction, false );
+ }
+
+ public static PhylogenyNode createInstanceFromNhxString( final String nhx,
+ final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction,
+ final boolean replace_underscores )
+ throws NHXFormatException, PhyloXmlDataFormatException {
+ return new PhylogenyNode( nhx, taxonomy_extraction, replace_underscores );