You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`init(value: T)`: Initialize a new tree (containing the specified value at the root)
40
42
41
-
-`func addChild(forValue: T) -> Node`: Append a new node (containing the specified value) to our list of children
43
+
-`func addChild(for: T) -> Node`: Append a new node (containing the specified value) to our list of children
42
44
43
45
#### Node Retrieval
44
46
45
-
-`func getParent(excludeValues: ValueSet) -> Node?`: Return the immediate parent node, if any. Optional list of parent values to be excluded. A match will cause this function to return nil.
46
-
47
-
-`func getParents(maxDepth: Int, excludeValues: ValueSet) -> [Node]`: Return the parent nodes, starting with immediate parent. Optional list of parent values to be excluded. A match will exclude further ancestors. Optional limit on depth.
47
+
-`func getChildren(excludeValues: ValueSet) -> [Node]`: Fetch the child nodes of the node. Optional list of values for children to be excluded, along with their progeny. Traversal is breadth-first.
48
48
49
-
-`func getChildren(maxDepth: Int, excludeValues: ValueSet) -> [Node]`: Fetch child nodes. Optional list of values for children to be excluded, along with their progeny. Traversal is depth-first, with optional limit.
49
+
-`func getChildren(maxDepth: Int, excludeValues: ValueSet) -> [Node]`: Fetch the child nodes of the node. Optional list of values for children to be excluded, along with their progeny. Traversal is depth-first, with optional limit.
50
50
51
-
#### Iterators
51
+
-`func getParent(excludeValues: ValueSet) -> Node?`: Return the immediate parent node, if any. Optional list of parent values to be excluded. A match will cause this function to return nil.
52
52
53
-
-`func makeChildIterator(excludeValues: ValueSet) -> AnyIterator<Node>`: Create a iterator to traverse through the children (grandchildren, etc.) of the current node. Traversal is breadth-first. With short circuit of child branches on exclude filter.
53
+
-`func getParents(maxDepth: Int, excludeValues: ValueSet) -> [Node]`: Return the parent nodes, starting with immediate parent. Optional list of parent values to be excluded. A match will exclude further ancestors. Optional limit on depth.
54
54
55
-
-`func makeParentIterator() -> AnyIterator<Node>`: Create a iterator to traverse up the tree through the parents of the current node, starting with the most recent parent, if any.
55
+
-`func getAll(excludeValues: ValueSet) -> [Node]`: Fetch the node and its child nodes. Optional list of values for children to be excluded, along with their progeny. Traversal is breadth-first.
56
56
57
-
#### Iterative Node Search
57
+
#### Node Search
58
58
59
-
-`func getFirst(forValue: T) -> Node?`: Traverse from the current node to find the first node with the specified value. Includes current node. Traversal is breadth-first.
59
+
-`func getFirst(for: T) -> Node?`: Traverse from the current node to find the first node with the specified value. Traversal is breadth-first.
60
60
61
-
-`func getFirstChild(forValue: T) -> Node?`: Traverse the children from the current node to find the first child (grandchild, etc.) with the specified value. Traversal is breadth-first.
61
+
-`func getFirstChild(for: T) -> Node?`: Traverse the children from the current node to find the first child (grandchild, etc.) with the specified value. Traversal is breadth-first.
62
62
63
-
#### Iterative Node Retrieval
63
+
#### Iterators
64
64
65
-
-`func getAll(excludeValues: ValueSet) -> [Node]`: Flatten tree from current node. Includes current node. Optional list of values for children to be excluded, along with their progeny. Traversal is breadth-first.
65
+
-`func makeChildIterator(excludeValues: ValueSet) -> AnyIterator<Node>`: Create a iterator to traverse through the children (grandchildren, etc.) of the current node. Traversal is breadth-first. With short circuit of child branches on exclude filter.
66
66
67
-
-`func getAllChildren(excludeValues: ValueSet) -> [Node]`: Get all the child nodes from the current node. Optional list of values for children to be excluded, along with their progeny. Traversal is breadth-first.
67
+
-`func makeParentIterator() -> AnyIterator<Node>`: Create a iterator to traverse up the tree through the parents of the current node, starting with the most recent parent, if any.
68
68
69
69
#### Value retrieval
70
70
71
-
-`func getAllChildValues(excludeValues: ValueSet) -> [T]`: Get all the child values from the current node. Optional list of values for children to be excluded, along with their progeny. Traversal is breadth-first.
72
-
73
-
-`func getAllValues(excludeValues: ValueSet) -> [T]`: Flatten tree from current node. Includes value of current node. Optional list of values for children to be excluded, along with their progeny. Traversal is breadth-first.
71
+
-`func getChildValues(excludeValues: ValueSet) -> [T]`: Fetch the values of the child nodes. Optional list of values for children to be excluded, along with their progeny. Traversal is breadth-first.
74
72
75
-
-`func getChildValues(maxDepth: Int, excludeValues: ValueSet) -> [T]`: Fetch child values. Optional list of values for children to be excluded, along with their progeny. Traversal is depth-first, with optional limit.
73
+
-`func getChildValues(maxDepth: Int, excludeValues: ValueSet) -> [T]`: Fetch the values of the child nodes. Optional list of values for children to be excluded, along with their progeny. Traversal is depth-first, with optional limit.
76
74
77
75
-`func getParentValue(excludeValues: ValueSet) -> T?`: Return the value of the immediate parent node, if any. Optional list of parent values to be excluded. A match will cause this function to return nil.
78
76
79
77
-`func getParentValues(maxDepth: Int, excludeValues: ValueSet) -> [T]`: Return the values of the parent nodes, starting with immediate parent. Optional list of parent values to be excluded. A match will exclude further ancestors. Optional limit on depth.
80
78
79
+
-`func getAllValues(excludeValues: ValueSet) -> [T]`: Fetch values for the node and its child nodes. Includes value of current node. Optional list of values for children to be excluded, along with their progeny. Traversal is breadth-first.
0 commit comments