Documentation
¶
Overview ¶
Package node provides a small generic tree node used to describe Paper document structure.
Index ¶
- type Node
- func (n *Node[T]) AddNext(child *Node[T])
- func (n *Node[T]) Backtrack() []*Node[T]
- func (n *Node[T]) Filter(filterFunc func(obj T) bool) (*Node[T], bool)
- func (n *Node[T]) GetData() T
- func (n *Node[T]) GetID() int
- func (n *Node[T]) GetNexts() []*Node[T]
- func (n *Node[T]) GetPrevious() *Node[T]
- func (n *Node[T]) GetStructure() []string
- func (n *Node[T]) IsLeaf() bool
- func (n *Node[T]) IsRoot() bool
- func (n *Node[T]) WithID(id int) *Node[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node[T any] struct { // contains filtered or unexported fields }
Node is a generic tree node.
func (*Node[T]) Filter ¶
Filter returns a copy of this subtree containing only nodes accepted by filterFunc.
func (*Node[T]) GetPrevious ¶
GetPrevious returns the parent node.
func (*Node[T]) GetStructure ¶
GetStructure returns parent-child ID pairs for this node and its descendants.
Click to show internal directories.
Click to hide internal directories.