TreeOps class
Static helpers shared by the controller and the view. Each is generic over
the node value type T; the type argument is normally inferred from the
List<TreeNode<T>> you pass in.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → TreeNodeId -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
ancestorsOf<
T> (List< TreeNode< roots, TreeNodeId id) → List<T> >TreeNodeId> -
Ancestor ids of
id, outermost-first (empty if root or missing). -
count<
T> (List< TreeNode< roots) → intT> > - Total node count.
-
find<
T> (List< TreeNode< roots, TreeNodeId id) → TreeNode<T> >T> ? - Find a node by id, or null.
-
insertAfter<
T> (List< TreeNode< nodes, TreeNodeId afterId, TreeNode<T> >T> toAdd) → List<TreeNode< T> > -
Rebuild
nodes, insertingtoAddimmediately after the nodeafterIdat whatever depth it lives. -
leafIds<
T> (TreeNode< T> node) → List<TreeNodeId> -
All leaf ids beneath (and including, if leaf)
node. -
mapNode<
T> (List< TreeNode< nodes, TreeNodeId id, TreeNode<T> >T> transform(TreeNode<T> )) → List<TreeNode< T> > -
Rebuild
nodes, replacing the node matchingidwithtransform(node). -
removeNode<
T> (List< TreeNode< nodes, TreeNodeId id) → List<T> >TreeNode< T> > -
Rebuild
nodeswithid(and its subtree) removed. -
subtreeIds<
T> (TreeNode< T> node) → List<TreeNodeId> -
All ids beneath (and including)
node. -
walk<
T> (List< TreeNode< roots, void visit(TreeNode<T> >T> node, List<TreeNode< ancestors)) → voidT> > -
Depth-first walk;
visitreceives each node and its ancestor path.