Class SearchTree
- class ooodev.dialog.search.tree_search.SearchTree(match_value, match_all=False)[source]
Rule engine for searching a tree.
- Parameters:
match_value (Any) –
match_all (bool) –
- __init__(match_value, match_all=False)[source]
Constructor
- Parameters:
match_value (Any) –
match_all (bool) –
- Return type:
None
- find_node(node)[source]
Finds a node in the tree
- Parameters:
node (XTreeNode) – Node to find
- Returns:
The node if found, None otherwise
- Return type:
XTreeNode | None
- register_rule(rule)[source]
Register rule
- Parameters:
rule (RuleT) – Rule to register
- Return type:
None
- unregister_rule(rule)[source]
Unregister Rule
- Parameters:
rule (RuleT) – Rule to unregister
- Raises:
ValueError – If an error occurs
- property match_all: bool
Gets or sets whether all rules must match for a node to be considered a match.
- Return type:
bool
- property match_value: Any
Gets or sets the value to match.
- Return type:
Any