Node class
- Inheritance
- Implemented types
- Implementers
Constructors
Properties
-
children
→ Map<
String, Node> -
These are the children of the node.
final
-
childrenAsList
→ List<
Node> -
This returns the children as an iterable list.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLeaf → bool
-
Getter to check if the node is a Leaf.
A Leaf-Node does have any children.
no setterinherited
- isRoot → bool
-
Getter to check if the node is a root.
Root is always the first node in a Tree. A Root-Node never has a parent.
no setterinherited
- key → String
-
This is the uniqueKey of the Node
final
- length → int
-
Getter to get the total number of children
no setterinherited
- level → int
-
Getter to get the level i.e. how many iterations it will take to get to the
root.
** Note: starting index is 0.
no setterinherited
-
meta
↔ Map<
String, dynamic> ? -
Any related data that needs to be accessible from the node can be added to
meta without needing to extend or implement the INode
getter/setter pairoverride
- parent ↔ Node?
-
This is the parent Node. Only the root node has a null parent
covariantgetter/setter pairoverride
- path → String
-
Path of the node in the tree. It provides information about the node
hierarchy by listing all the ancestors of the node.
no setterinherited
- root → Node
-
Getter to get the root node.
If the current node is not a root, then the getter will traverse up the
path to get the root.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
covariant Node value) → void -
Add a
value
node to the childrenoverride -
addAll(
covariant Iterable< Node> iterable) → void -
Add a collection of Iterable nodes to children
override
-
clear(
) → void -
Clear all the child nodes from children. The children will be empty
after this operation.
override
-
delete(
) → void -
Delete
this
nodeoverride -
elementAt(
String path) → Node -
- Utility method to get a child node at the
path
. Get any item atpath
from the root The keys of the items to be traversed should be provided in thepath
override - Utility method to get a child node at the
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
covariant Node value) → void -
Remove a child
value
node from the childrenoverride -
removeAll(
covariant Iterable< Node> iterable) → void -
Remove all the Iterable nodes from the children
override
-
removeWhere(
bool test(Node element)) → void -
Remove all the child nodes from the children that match the criterion in
the provided
test
override -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String path) → Node -
Overloaded operator for elementAt
override