Children<TNode> Class
Definition
Collection of child nodes for a Node<TNode>.
Type Parameters
Name | Description |
---|---|
TNode | The base node type for the collection. |
Properties
Name | Description |
---|---|
Current capacity of the collection. The capacity is the size of the internal array used to hold items. When set, the internal array of the list is reallocated to the given capacity. | |
The number of nodes in the collection. | |
Gets the first child in the collection. | |
Gets the first child in the collection or null if the collection is empty. | |
Gets or sets the node at the specified index. Parents will be updated accordingly on set. | |
Gets the last child in the collection. | |
Gets the last child in the collection or null if the collection is empty. | |
Gets the first child in the collection without array bounds checks. For high performance scenarios. WARNING: Do not use unless you are certain of the number of children! | |
Gets the last child in the collection without array bounds checks. For high performance scenarios. WARNING: Do not use unless you are certain of the number of children! |
Methods
Name | Description |
---|---|
Adds a node to the collection and assigns its Parent property. | |
Adds nodes to the collection and assigns their Parent properties. | |
Adds nodes to the collection and assigns their Parent properties. | |
Adds nodes to the collection and assigns their Parent properties. | |
Removes all nodes from the collection and resets their Parent properties to | |
Determines if the specified node is in the collection or not. | |
Lazily enumerates over all nodes in this collection not of the specified type. | |
Returns the first node in the collection if it is of the specified type or a specified default if the collection is empty or the first node is a different type. | |
Returns the first node in the collection of the specified type or throws otherwise. | |
Returns the first node in the collection of the specified type or a specified default if it doesn't contain any nodes of the specified type. | |
Gets the index of the specified node in this collection. | |
Inserts a node into the collection at the specified position and assigns its Parent property. | |
Returns the last node in the collection if it is of the specified type or a specified default if the collection is empty or the last node is a different type. | |
Returns the last node in the collection of the specified type or throws otherwise. | |
Returns the last node in the collection of the specified type or a specified default if it doesn't contain any nodes of the specified type. | |
Moves a node from it's current parent (if it has one) and into this collection. | |
Moves nodes from their current parents (if they have one) into this collection. | |
Moves nodes from their current parents (if they have one) into this collection. | |
Lazily enumerates over all nodes in this collection of the specified type. | |
Tries to remove a node from the collection and reset its Parent property to | |
Removes the node at the specified position from the collection and reset its Parent property to | |
Replaces a node in the collection with another node. The replacement will be removed from its parent and the node being replaced will have it's parent removed. | |
Returns the only node in the collection of the specified type. Throws if there is not exactly one node in the collection of the specified type. | |
Returns the only node in the collection of the specified type. Returns the specified default if there are no nodes in the collection of the specified type. Throws if there are multiple nodes in the collection of the specified type. | |
Gets the child at the specified index in the collection without array bounds checks. For high performance scenarios. WARNING: Do not use unless you are certain of the number of children! |