File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 66A trait which indicates whether a tree node stores references to its parents (`StoredParents()`) or
77if the parents must be inferred from the tree structure (`ImplicitParents()`).
88
9- Trees for which `parentlinks ` returns `StoredParents()` *MUST* implement [`parent`](@ref).
9+ Trees for which `ParentLinks ` returns `StoredParents()` *MUST* implement [`parent`](@ref).
1010
1111If `StoredParents()`, all nodes in the tree must also have `StoredParents()`, otherwise use
1212`ImplicitParents()`.
1313
1414**OPTIONAL**: This should be implemented for a tree if parents of nodes are stored
1515```julia
16- AbstractTrees.parentlinks (::Type{<:TreeType}) = AbstractTrees.StoredParents()
16+ AbstractTrees.ParentLinks (::Type{<:TreeType}) = AbstractTrees.StoredParents()
1717parent(t::TreeType) = get_parent(t)
1818```
1919"""
@@ -92,12 +92,15 @@ SiblingLinks(tree) = SiblingLinks(typeof(tree))
9292 ChildIndexing(node)
9393
9494A trait indicating whether the tree node `n` has children (as returned by [`children`](@ref)) which can be
95- indexed using 1-based indexing.
95+ indexed using 1-based indexing. Options are either [`NonIndexedChildren`](@ref) (default) or [`IndexedChildren`](@ref).
96+
97+ To declare that the tree `TreeType` supports one-based indexing on the children, define
98+ ```julia
99+ AbstractTrees.ChildIndexing(::Type{<:TreeType}) = AbstractTrees.IndexedChildren()
100+ ```
96101
97102If a node has the `IndexedChildren()` so must all connected nodes in the tree. Otherwise, use
98103`NonIndexedChildren()` instead.
99-
100- Options are either [`NonIndexedChildren`](@ref) (default) or [`IndexedChildren`](@ref).
101104"""
102105abstract type ChildIndexing end
103106
You can’t perform that action at this time.
0 commit comments