valuesToNodes method
Maps values
to Nodes in this graph.
- If
createNodes
isfalse
will throw a StateError if the node is not present in this graph.
Implementation
Iterable<Node<T>> valuesToNodes(Iterable<T> values,
{bool createNodes = false}) {
if (createNodes) {
return values.map((value) => node(value));
} else {
return values.map((value) =>
getNode(value) ??
(throw StateError("Can't find node with value: $value")));
}
}