Skip to content
Snippets Groups Projects
Commit ff9bc713 authored by Powers, Peter M.'s avatar Powers, Peter M.
Browse files

logic tree copy moethod

parent 3b19caeb
No related branches found
No related tags found
1 merge request!146Lib updates
......@@ -248,6 +248,16 @@ class MfdTrees {
return pathTree.build();
}
/* Create an exact copy of the supplied tree. */
static <T> LogicTree<T> copy(LogicTree<T> tree) {
LogicTree.Builder<T> copy = LogicTree.builder(tree.name());
tree.forEach(branch -> copy.addBranch(
branch.id(),
branch.value(),
branch.weight()));
return copy.build();
}
/*
* Transpose a list of logic trees to a logic tree of immutable lists.
* Supplied logic trees are assumed to have same branch names and IDs.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment