Documentation ¶
Index ¶
- type Node
- func (t *Node[K]) Ancestry() []K
- func (t *Node[K]) Children() map[K]*Node[K]
- func (t *Node[K]) Data() K
- func (t *Node[K]) Equals(t2 *Node[K]) bool
- func (t *Node[K]) Get(key K) (*Node[K], bool)
- func (t *Node[K]) IsTerminal() bool
- func (t *Node[K]) Parent() *Node[K]
- func (t *Node[K]) RemoveChild(key K)
- func (t *Node[K]) Set(key K)
- func (t *Node[K]) SetParent(p *Node[K])
- func (t *Node[K]) Spawn(key K) *Node[K]
- func (t *Node[K]) String() string
- func (t *Node[K]) Walk() [][]K
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node[K comparable] map[K]*Node[K]
func (*Node[K]) Ancestry ¶
func (t *Node[K]) Ancestry() []K
returns a slice of []K, indicating the path to the Node
func (*Node[K]) Data ¶
func (t *Node[K]) Data() K
get key of self by querying parent zero value means root (no key)
func (*Node[K]) IsTerminal ¶
IsTerminal returns true if the Node contains no child Nodes
func (*Node[K]) Set ¶
func (t *Node[K]) Set(key K)
Set simply calls Spawn(), but discards return value
Click to show internal directories.
Click to hide internal directories.