getNode method
Gets the node that has a key value equal to the specified key.
Implementation
Node<T>? getNode(String key, {Node<T>? parent}) {
Node<T>? _found;
List<Node<T>> _children = parent == null ? this.children : parent.children;
Iterator iter = _children.iterator;
while (iter.moveNext()) {
Node<T> child = iter.current;
if (child.key == key) {
_found = child;
break;
} else {
if (child.isParent) {
_found = this.getNode(key, parent: child);
if (_found != null) {
break;
}
}
}
}
return _found;
}