The internal, protected data structure implementing a node of the tree. This class is not accessible from outside. Instead, inner class Cursor, which represents node objects, provides an indirect interface to the values of this class.
Public Fields | |
Dictionary< String, Node > | children |
Node | parent |
T | value |
Public Methods | |
Node (Node _parent) | |
Node | createChild (String childName, char separator) |
Node | createChildNoCheck (String childName) |
int | depth () |
Node | getChild (String childName, char separator) |
Node | getOrCreateChild (String childName, char separator, out bool wasCreated) |
bool | isRoot () |
|
inline |
Creates and returns a child node. If a node already exists, nothing is done and null
is returned as this is considered an error.
childName | The name of the child |
separator | The path separator (used only in debug mode to check file name). |
null
if a child with the given name already existed.
|
inline |
Non-checking version of createChild. Must be used only if it is assured that no child with that name exists, yet.
childName | The name of the child to be created and inserted |
|
inline |
Recursively calculates the depth of a node.
|
inline |
Returns a child node identified by parameter childName. If the child is not found or is illegal (empty, "."
or ".."
or contain a separator character), null
is returned. In debug compilations, an ALIB_DBG.WARNING is reported on illegal child names.
childName | The name of the child |
separator | The path separator (used only in debug mode to check file name). |
null
on failure.
|
inline |
Searches and - if no existent - creates a child node.
If a child needs to be created, childName is first checked to not equal to "."
or ".."
and that it does not contain the separation character. If it does, still true
is returned and with null
for the new child. Furthermore, an ALIB_DBG.WARNING is reported.
childName | The name of the child | |
separator | The path separator. | |
[out] | wasCreated | Will be set to true if the child did not exist and was created. To false otherwise. |
true
when the child was created and false
when it was already existing.
|
inline |
Returns true
if this is the root node, false
otherwise.
true
if this is the root node, false
otherwise. Dictionary<String, Node> children |
Child nodes.
Node parent |
Parent node.
T value |
The template type value.