def add_leaf(leaf)
      return if leaf.parent == self
      leaf.remove_from_parent if leaf.parent
      leaf.parent = self
      if @leaves.length > 0
        @leaves.last.next = leaf
        leaf.prev         = @leaves.last
      else
        leaf.prev = nil
      end
      leaf.next = nil
      leaf.invalidate
      @leaves << leaf
      @leaves_and_children << leaf
      self
    end
def add_leaf(leaf)
      return if leaf.parent == self
      leaf.remove_from_parent if leaf.parent
      leaf.parent = self
      if @leaves.length > 0
        @leaves.last.next = leaf
        leaf.prev         = @leaves.last
      else
        leaf.prev = nil
      end
      leaf.next = nil
      leaf.invalidate
      @leaves << leaf
      @leaves_and_children << leaf
      self
    end
Add a Leaf
 @param [LeafNode] leaf

 @return self