Documentation
¶
Index ¶
- func CalculateRatioToRoot[T any](descendantTreeCount *DescendantTreeCount[*T])
- func TraverseTreePost[T TreeProvider[T]](node T, yield func(T, *T, bool) bool)
- type DescendantTracker
- type DescendantTreeCount
- func CollectAllNodes[T any](descendantTreeCount *DescendantTreeCount[*T]) []*DescendantTreeCount[*T]
- func CountDescendantTree[T TreeProvider[T]](root T) *DescendantTreeCount[*T]
- func FilterDescendantTree[T any](descendantTreeCount *DescendantTreeCount[*T], threshold float64) *DescendantTreeCount[*T]
- func NewDescendantTreeCount[T any](node T) *DescendantTreeCount[T]
- func SortDescendantTree[T any](descendantTreeCount *DescendantTreeCount[*T]) *DescendantTreeCount[*T]
- func (d *DescendantTreeCount[T]) Add(node *DescendantTreeCount[T])
- func (d *DescendantTreeCount[T]) Children() iter.Seq[TreeProvider[*DescendantTreeCount[T]]]
- func (d *DescendantTreeCount[T]) MarshalJSON() ([]byte, error)
- func (d *DescendantTreeCount[T]) Node() *DescendantTreeCount[T]
- func (d *DescendantTreeCount[T]) NodeValue() T
- func (d *DescendantTreeCount[T]) SetChildren(children []*DescendantTreeCount[T])
- func (d *DescendantTreeCount[T]) SetNode(node T)
- func (d *DescendantTreeCount[T]) String() string
- type Tree
- type TreeProvider
- type TreeTraversePostTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateRatioToRoot ¶
func CalculateRatioToRoot[T any](descendantTreeCount *DescendantTreeCount[*T])
func TraverseTreePost ¶
func TraverseTreePost[T TreeProvider[T]](node T, yield func(T, *T, bool) bool)
Types ¶
type DescendantTracker ¶
type DescendantTracker[T any] struct { Parent *T Children []*DescendantTreeCount[*T] }
type DescendantTreeCount ¶
type DescendantTreeCount[T any] struct { Count int ChildrenCount int RatioToParent float64 RatioToRoot float64 BelowThresholdCount int // contains filtered or unexported fields }
func CollectAllNodes ¶
func CollectAllNodes[T any](descendantTreeCount *DescendantTreeCount[*T]) []*DescendantTreeCount[*T]
func CountDescendantTree ¶
func CountDescendantTree[T TreeProvider[T]](root T) *DescendantTreeCount[*T]
func FilterDescendantTree ¶
func FilterDescendantTree[T any](descendantTreeCount *DescendantTreeCount[*T], threshold float64) *DescendantTreeCount[*T]
func NewDescendantTreeCount ¶
func NewDescendantTreeCount[T any](node T) *DescendantTreeCount[T]
func SortDescendantTree ¶
func SortDescendantTree[T any](descendantTreeCount *DescendantTreeCount[*T]) *DescendantTreeCount[*T]
func (*DescendantTreeCount[T]) Add ¶
func (d *DescendantTreeCount[T]) Add(node *DescendantTreeCount[T])
func (*DescendantTreeCount[T]) Children ¶
func (d *DescendantTreeCount[T]) Children() iter.Seq[TreeProvider[*DescendantTreeCount[T]]]
func (*DescendantTreeCount[T]) MarshalJSON ¶
func (d *DescendantTreeCount[T]) MarshalJSON() ([]byte, error)
func (*DescendantTreeCount[T]) Node ¶
func (d *DescendantTreeCount[T]) Node() *DescendantTreeCount[T]
func (*DescendantTreeCount[T]) NodeValue ¶
func (d *DescendantTreeCount[T]) NodeValue() T
func (*DescendantTreeCount[T]) SetChildren ¶
func (d *DescendantTreeCount[T]) SetChildren(children []*DescendantTreeCount[T])
func (*DescendantTreeCount[T]) SetNode ¶
func (d *DescendantTreeCount[T]) SetNode(node T)
func (*DescendantTreeCount[T]) String ¶
func (d *DescendantTreeCount[T]) String() string
type Tree ¶
type Tree[T any] struct { Node T // contains filtered or unexported fields }
func CopyTree ¶
func CopyTree[T TreeProvider[T]](root T) Tree[T]
func FilterTree ¶
func FilterTree[T TreeProvider[T]](root T, filter func(T) bool) *Tree[T]
type TreeProvider ¶
type TreeProvider[T any] = collections.TreeProvider[T]
type TreeTraversePostTracker ¶
Click to show internal directories.
Click to hide internal directories.