View Source UnrootedPolytree.Node (UnrootedPolytree v0.1.1)
A node in an UnrootedPolytree. Contains any value, and a unique string ID.
Link to this section Summary
Functions
Constructs a Node given an ID string and any value.
Returns the ID string of this node.
Returns the value of this node.
Link to this section Types
@type id() :: String.t()
Link to this section Functions
Constructs a Node given an ID string and any value.
iex> UnrootedPolytree.Node.from_id_and_value("a", %{foo: "bar"}) %UnrootedPolytree.Node{id: "a", value: %{foo: "bar"}}
Returns the ID string of this node.
iex> UnrootedPolytree.Node.id(%UnrootedPolytree.Node{id: "a", value: %{foo: "bar"}}) "a"
Returns the value of this node.
iex> UnrootedPolytree.Node.value(%UnrootedPolytree.Node{id: "a", value: %{foo: "bar"}}) %{foo: "bar"}