Node<T> class

A Graph Node.

Inheritance

Constructors

Node(T value, {Graph<T>? graph})
Node.root(T value, {Graph<T>? graph})

Properties

attachment ↔ dynamic
Temporary attachment to associate with this node. See reset and Graph.reset.
getter/setter pair
depth int
The node depth from root. See shortestPathToRoot.
no setter
graph Graph<T>?
no setter
hashCode int
The hash code for this object.
no setteroverride
inputs List<Node<T>>
Return the inputs of this node.
no setteroverride
inputsValues List<T>
Return the inputs values of this node.
no setter
isAlwaysRoot bool
Returns true if this node was created with Node.root (can't have inputs).
no setter
isLeaf bool
Returns true if it's a leaf node (no outputs).
no setter
isRoot bool
Returns true if it's a root node (no inputs).
no setter
isTarget bool
If true matches a target in the scan. See NodeMatcher.matches.
no setter
outputs List<Node<T>>
Return the outputs of this node.
no setteroverride
outputsValues List<T>
Return the outputs values of this node.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shortestPathToRoot List<Node<T>>
Returns the shortest path to root (unmodifiable List).
no setter
value → T
The node value.
final

Methods

addInput(T nodeValue) Node<T>?
Add a node to the inputs if it has not been added yet.
override
addOutput(T nodeValue) Node<T>?
Add a node to the outputs if it has not been added yet.
override
containsInput(T nodeValue) bool
Returns true if nodeValue is a inputs.
override
containsInputNode(Node<T> node) bool
Returns true if node is a inputs.
containsOutput(T nodeValue) bool
Returns true if outputs contains a Node with nodeValue.
override
containsOutputNode(Node<T> node) bool
Returns true if outputs contains node.
dependencies({bool includeThisInputs = true, int? maxDepth, Iterable<Node<T>>? ignore}) List<Node<T>>
Returns all the dependencies.
disposeGraph() → void
Disposes the graph.
getInput(T nodeValue) Node<T>?
Gets a Node in the inputs.
getOrAddInput(T nodeValue) Node<T>
Gets a Node in the inputs or add it.
getOrAddOutput(T nodeValue) Node<T>
Gets a Node in the outputs or add it.
getOutput(T nodeValue) Node<T>?
Gets a Node in the outputs.
inputsInDepth({int? maxDepth, bool bfs = false, Iterable<Node<T>>? ignore}) List<Node<T>>
Returns all the inputs in depth, scanning all the inputs of inputs.
inputsInDepthIntersection(Node<T>? other) List<Node<T>>
isInput(T targetValue) bool
Returns true if targetValue is an input of this node.
isInputInShortestPathToRoot(Node target) bool
Returns true if target is an input in the shortestPathToRoot.
isInputNode(Node<T> target) bool
Returns true if target is an input of this node.
isOutput(T targetValue) bool
Returns true if targetValue is an output of this node.
isOutputNode(Node<T> target) bool
Returns true if target is an output of this node.
markAsTarget() → void
Marks this node as a target.
missingDependencies(Iterable<Node<T>> knownDependencies, {int? maxDepth}) List<Node<T>>
Returns all the missing dependencies not present in the knownDependencies parameter.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
outputsInDepth({int? maxDepth, bool bfs = false, Iterable<Node<T>>? ignore}) List<Node<T>>
Returns all the outputs in depth, scanning all the outputs of outputs.
outputsInDepthIntersection(Node<T>? other) List<Node<T>>
reset() → void
Resets this node for a path scan. Clears _target and attachment.
override
resolveAllPathsToRoot({int maxExpansion = 3}) List<List<Node<T>>>
Resolves all the paths to the root from this node.
resolveShortestPathToRoot() List<Node<T>>
Resolves the shortest path to root from this node. Since inputs is populated in BFS, the 1st input is one of the closest to the root.
roots({bool bfs = false}) List<Node<T>>
sideRoots({int? maxDepth}) List<Node<T>>
Return the list of side roots after this Node.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override