lib/jumoku/builders/shared.rb
# Adds the node to the tree.
#
# For convenience, you may pass a branch as the parameter,
# which one node already exists in the tree and the other is
# to be added.
#
# @overload add_node!(n)
#   @param [node] n
# @overload add_node!(b)
#   @param [Branch] b Branch[node i, node j, label l = nil]; if i (j) already exists, then j (i) must not exist
# @return [RawTree] self
Adds the node to the tree.
For convenience, you may pass a branch as the parameter,
which one node already exists in the tree and the other is
to be added.
Adds the node to the tree . For convenience you may pass a branch as the parameter which one node already exists in the tree and the other is to be added .
def add_node! u, v = nil, l = nil
      if nodes.empty?
        add_vertex! u, l
      elsif u.is_a? _branch_type
        add_branch! u, nil, l
      elsif not v.nil?
        add_branch! u, v, l
      else
        raise RawTreeError, "In order to add a node to the tree, you must specify another node to attach to."
      end
    end
def add_node! u , v = nil , l = nil if nodes . empty? add_vertex! u , l elsif u . is_a? _branch_type add_branch! u , nil , l elsif not v . nil? add_branch! u , v , l else raise RawTreeError , "In order to add a node to the tree, you must specify another node to attach to." end end
Adds the node to the tree.
Adds the node to the tree .
# Ensure the connected constraint.
None
RawTree
u
<not_specific>
v
<not_specific>
l
<not_specific>
overload
add_node!(n) @param [node] n
add_node! ( n ) @param [ node ] n
overload
add_node!(b) @param [Branch] b Branch[node i, node j, label l = nil]; if i (j) already exists, then j (i) must not exist
add_node! ( b ) @param [ Branch ] b Branch [ node i node j label l = nil ] ; if i ( j ) already exists then j ( i ) must not exist