Node<T, S> class

Slightly modified version of a typical tree node implementation which stores two pices of data: the actual data we're storing inside it as well as the reference, (think of it as an unique ID of the node). We need to provide types for both data and reference respectively

Constructors

Node({@required T data, @required S reference})
Create node instance from data and reference, both parameters are required

Properties

children List<Node>
List of node's children, which are other nodes
read / write
data → T
Data that the node is storing
final
hashCode int
The hash code for this object. [...]
read-only, inherited
reference → S
Node's reference
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

hasChildren() bool
Returns true if the node has any children nodes
insertChild(Node child) → void
Insert a child node
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited