Documentation ¶
Overview ¶
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Code generated by go generate; EDIT THIS FILE DIRECTLY
Index ¶
- type BoolNode
- func (tn *BoolNode) AddChild(target *BoolNode)
- func (tn *BoolNode) AddChildren(children []*BoolNode)
- func (tn BoolNode) BackwardChild() iter.Seq[*BoolNode]
- func (tn BoolNode) Child() iter.Seq[*BoolNode]
- func (tn *BoolNode) Cleanup() []*BoolNode
- func (tn BoolNode) Copy() *BoolNode
- func (tn *BoolNode) DeleteChild(target *BoolNode) []*BoolNode
- func (tn BoolNode) GetChildren() []*BoolNode
- func (tn BoolNode) GetFirstChild() (*BoolNode, bool)
- func (tn BoolNode) GetParent() (*BoolNode, bool)
- func (tn BoolNode) HasChild(target *BoolNode) bool
- func (tn BoolNode) IsChildOf(target *BoolNode) bool
- func (tn BoolNode) IsLeaf() bool
- func (tn BoolNode) IsSingleton() bool
- func (tn *BoolNode) LinkChildren(children []*BoolNode)
- func (tn *BoolNode) RemoveNode() []*BoolNode
- func (tn BoolNode) String() string
- type ByteNode
- func (tn *ByteNode) AddChild(target *ByteNode)
- func (tn *ByteNode) AddChildren(children []*ByteNode)
- func (tn ByteNode) BackwardChild() iter.Seq[*ByteNode]
- func (tn ByteNode) Child() iter.Seq[*ByteNode]
- func (tn *ByteNode) Cleanup() []*ByteNode
- func (tn ByteNode) Copy() *ByteNode
- func (tn *ByteNode) DeleteChild(target *ByteNode) []*ByteNode
- func (tn ByteNode) GetChildren() []*ByteNode
- func (tn ByteNode) GetFirstChild() (*ByteNode, bool)
- func (tn ByteNode) GetParent() (*ByteNode, bool)
- func (tn ByteNode) HasChild(target *ByteNode) bool
- func (tn ByteNode) IsChildOf(target *ByteNode) bool
- func (tn ByteNode) IsLeaf() bool
- func (tn ByteNode) IsSingleton() bool
- func (tn *ByteNode) LinkChildren(children []*ByteNode)
- func (tn *ByteNode) RemoveNode() []*ByteNode
- func (tn ByteNode) String() string
- type Complex128Node
- func (tn *Complex128Node) AddChild(target *Complex128Node)
- func (tn *Complex128Node) AddChildren(children []*Complex128Node)
- func (tn Complex128Node) BackwardChild() iter.Seq[*Complex128Node]
- func (tn Complex128Node) Child() iter.Seq[*Complex128Node]
- func (tn *Complex128Node) Cleanup() []*Complex128Node
- func (tn Complex128Node) Copy() *Complex128Node
- func (tn *Complex128Node) DeleteChild(target *Complex128Node) []*Complex128Node
- func (tn Complex128Node) GetChildren() []*Complex128Node
- func (tn Complex128Node) GetFirstChild() (*Complex128Node, bool)
- func (tn Complex128Node) GetParent() (*Complex128Node, bool)
- func (tn Complex128Node) HasChild(target *Complex128Node) bool
- func (tn Complex128Node) IsChildOf(target *Complex128Node) bool
- func (tn Complex128Node) IsLeaf() bool
- func (tn Complex128Node) IsSingleton() bool
- func (tn *Complex128Node) LinkChildren(children []*Complex128Node)
- func (tn *Complex128Node) RemoveNode() []*Complex128Node
- func (tn Complex128Node) String() string
- type Complex64Node
- func (tn *Complex64Node) AddChild(target *Complex64Node)
- func (tn *Complex64Node) AddChildren(children []*Complex64Node)
- func (tn Complex64Node) BackwardChild() iter.Seq[*Complex64Node]
- func (tn Complex64Node) Child() iter.Seq[*Complex64Node]
- func (tn *Complex64Node) Cleanup() []*Complex64Node
- func (tn Complex64Node) Copy() *Complex64Node
- func (tn *Complex64Node) DeleteChild(target *Complex64Node) []*Complex64Node
- func (tn Complex64Node) GetChildren() []*Complex64Node
- func (tn Complex64Node) GetFirstChild() (*Complex64Node, bool)
- func (tn Complex64Node) GetParent() (*Complex64Node, bool)
- func (tn Complex64Node) HasChild(target *Complex64Node) bool
- func (tn Complex64Node) IsChildOf(target *Complex64Node) bool
- func (tn Complex64Node) IsLeaf() bool
- func (tn Complex64Node) IsSingleton() bool
- func (tn *Complex64Node) LinkChildren(children []*Complex64Node)
- func (tn *Complex64Node) RemoveNode() []*Complex64Node
- func (tn Complex64Node) String() string
- type ErrorNode
- func (tn *ErrorNode) AddChild(target *ErrorNode)
- func (tn *ErrorNode) AddChildren(children []*ErrorNode)
- func (tn ErrorNode) BackwardChild() iter.Seq[*ErrorNode]
- func (tn ErrorNode) Child() iter.Seq[*ErrorNode]
- func (tn *ErrorNode) Cleanup() []*ErrorNode
- func (tn ErrorNode) Copy() *ErrorNode
- func (tn *ErrorNode) DeleteChild(target *ErrorNode) []*ErrorNode
- func (tn ErrorNode) GetChildren() []*ErrorNode
- func (tn ErrorNode) GetFirstChild() (*ErrorNode, bool)
- func (tn ErrorNode) GetParent() (*ErrorNode, bool)
- func (tn ErrorNode) HasChild(target *ErrorNode) bool
- func (tn ErrorNode) IsChildOf(target *ErrorNode) bool
- func (tn ErrorNode) IsLeaf() bool
- func (tn ErrorNode) IsSingleton() bool
- func (tn *ErrorNode) LinkChildren(children []*ErrorNode)
- func (tn *ErrorNode) RemoveNode() []*ErrorNode
- func (tn ErrorNode) String() string
- type Float32Node
- func (tn *Float32Node) AddChild(target *Float32Node)
- func (tn *Float32Node) AddChildren(children []*Float32Node)
- func (tn Float32Node) BackwardChild() iter.Seq[*Float32Node]
- func (tn Float32Node) Child() iter.Seq[*Float32Node]
- func (tn *Float32Node) Cleanup() []*Float32Node
- func (tn Float32Node) Copy() *Float32Node
- func (tn *Float32Node) DeleteChild(target *Float32Node) []*Float32Node
- func (tn Float32Node) GetChildren() []*Float32Node
- func (tn Float32Node) GetFirstChild() (*Float32Node, bool)
- func (tn Float32Node) GetParent() (*Float32Node, bool)
- func (tn Float32Node) HasChild(target *Float32Node) bool
- func (tn Float32Node) IsChildOf(target *Float32Node) bool
- func (tn Float32Node) IsLeaf() bool
- func (tn Float32Node) IsSingleton() bool
- func (tn *Float32Node) LinkChildren(children []*Float32Node)
- func (tn *Float32Node) RemoveNode() []*Float32Node
- func (tn Float32Node) String() string
- type Float64Node
- func (tn *Float64Node) AddChild(target *Float64Node)
- func (tn *Float64Node) AddChildren(children []*Float64Node)
- func (tn Float64Node) BackwardChild() iter.Seq[*Float64Node]
- func (tn Float64Node) Child() iter.Seq[*Float64Node]
- func (tn *Float64Node) Cleanup() []*Float64Node
- func (tn Float64Node) Copy() *Float64Node
- func (tn *Float64Node) DeleteChild(target *Float64Node) []*Float64Node
- func (tn Float64Node) GetChildren() []*Float64Node
- func (tn Float64Node) GetFirstChild() (*Float64Node, bool)
- func (tn Float64Node) GetParent() (*Float64Node, bool)
- func (tn Float64Node) HasChild(target *Float64Node) bool
- func (tn Float64Node) IsChildOf(target *Float64Node) bool
- func (tn Float64Node) IsLeaf() bool
- func (tn Float64Node) IsSingleton() bool
- func (tn *Float64Node) LinkChildren(children []*Float64Node)
- func (tn *Float64Node) RemoveNode() []*Float64Node
- func (tn Float64Node) String() string
- type Int16Node
- func (tn *Int16Node) AddChild(target *Int16Node)
- func (tn *Int16Node) AddChildren(children []*Int16Node)
- func (tn Int16Node) BackwardChild() iter.Seq[*Int16Node]
- func (tn Int16Node) Child() iter.Seq[*Int16Node]
- func (tn *Int16Node) Cleanup() []*Int16Node
- func (tn Int16Node) Copy() *Int16Node
- func (tn *Int16Node) DeleteChild(target *Int16Node) []*Int16Node
- func (tn Int16Node) GetChildren() []*Int16Node
- func (tn Int16Node) GetFirstChild() (*Int16Node, bool)
- func (tn Int16Node) GetParent() (*Int16Node, bool)
- func (tn Int16Node) HasChild(target *Int16Node) bool
- func (tn Int16Node) IsChildOf(target *Int16Node) bool
- func (tn Int16Node) IsLeaf() bool
- func (tn Int16Node) IsSingleton() bool
- func (tn *Int16Node) LinkChildren(children []*Int16Node)
- func (tn *Int16Node) RemoveNode() []*Int16Node
- func (tn Int16Node) String() string
- type Int32Node
- func (tn *Int32Node) AddChild(target *Int32Node)
- func (tn *Int32Node) AddChildren(children []*Int32Node)
- func (tn Int32Node) BackwardChild() iter.Seq[*Int32Node]
- func (tn Int32Node) Child() iter.Seq[*Int32Node]
- func (tn *Int32Node) Cleanup() []*Int32Node
- func (tn Int32Node) Copy() *Int32Node
- func (tn *Int32Node) DeleteChild(target *Int32Node) []*Int32Node
- func (tn Int32Node) GetChildren() []*Int32Node
- func (tn Int32Node) GetFirstChild() (*Int32Node, bool)
- func (tn Int32Node) GetParent() (*Int32Node, bool)
- func (tn Int32Node) HasChild(target *Int32Node) bool
- func (tn Int32Node) IsChildOf(target *Int32Node) bool
- func (tn Int32Node) IsLeaf() bool
- func (tn Int32Node) IsSingleton() bool
- func (tn *Int32Node) LinkChildren(children []*Int32Node)
- func (tn *Int32Node) RemoveNode() []*Int32Node
- func (tn Int32Node) String() string
- type Int64Node
- func (tn *Int64Node) AddChild(target *Int64Node)
- func (tn *Int64Node) AddChildren(children []*Int64Node)
- func (tn Int64Node) BackwardChild() iter.Seq[*Int64Node]
- func (tn Int64Node) Child() iter.Seq[*Int64Node]
- func (tn *Int64Node) Cleanup() []*Int64Node
- func (tn Int64Node) Copy() *Int64Node
- func (tn *Int64Node) DeleteChild(target *Int64Node) []*Int64Node
- func (tn Int64Node) GetChildren() []*Int64Node
- func (tn Int64Node) GetFirstChild() (*Int64Node, bool)
- func (tn Int64Node) GetParent() (*Int64Node, bool)
- func (tn Int64Node) HasChild(target *Int64Node) bool
- func (tn Int64Node) IsChildOf(target *Int64Node) bool
- func (tn Int64Node) IsLeaf() bool
- func (tn Int64Node) IsSingleton() bool
- func (tn *Int64Node) LinkChildren(children []*Int64Node)
- func (tn *Int64Node) RemoveNode() []*Int64Node
- func (tn Int64Node) String() string
- type Int8Node
- func (tn *Int8Node) AddChild(target *Int8Node)
- func (tn *Int8Node) AddChildren(children []*Int8Node)
- func (tn Int8Node) BackwardChild() iter.Seq[*Int8Node]
- func (tn Int8Node) Child() iter.Seq[*Int8Node]
- func (tn *Int8Node) Cleanup() []*Int8Node
- func (tn Int8Node) Copy() *Int8Node
- func (tn *Int8Node) DeleteChild(target *Int8Node) []*Int8Node
- func (tn Int8Node) GetChildren() []*Int8Node
- func (tn Int8Node) GetFirstChild() (*Int8Node, bool)
- func (tn Int8Node) GetParent() (*Int8Node, bool)
- func (tn Int8Node) HasChild(target *Int8Node) bool
- func (tn Int8Node) IsChildOf(target *Int8Node) bool
- func (tn Int8Node) IsLeaf() bool
- func (tn Int8Node) IsSingleton() bool
- func (tn *Int8Node) LinkChildren(children []*Int8Node)
- func (tn *Int8Node) RemoveNode() []*Int8Node
- func (tn Int8Node) String() string
- type IntNode
- func (tn *IntNode) AddChild(target *IntNode)
- func (tn *IntNode) AddChildren(children []*IntNode)
- func (tn IntNode) BackwardChild() iter.Seq[*IntNode]
- func (tn IntNode) Child() iter.Seq[*IntNode]
- func (tn *IntNode) Cleanup() []*IntNode
- func (tn IntNode) Copy() *IntNode
- func (tn *IntNode) DeleteChild(target *IntNode) []*IntNode
- func (tn IntNode) GetChildren() []*IntNode
- func (tn IntNode) GetFirstChild() (*IntNode, bool)
- func (tn IntNode) GetParent() (*IntNode, bool)
- func (tn IntNode) HasChild(target *IntNode) bool
- func (tn IntNode) IsChildOf(target *IntNode) bool
- func (tn IntNode) IsLeaf() bool
- func (tn IntNode) IsSingleton() bool
- func (tn *IntNode) LinkChildren(children []*IntNode)
- func (tn *IntNode) RemoveNode() []*IntNode
- func (tn IntNode) String() string
- type RuneNode
- func (tn *RuneNode) AddChild(target *RuneNode)
- func (tn *RuneNode) AddChildren(children []*RuneNode)
- func (tn RuneNode) BackwardChild() iter.Seq[*RuneNode]
- func (tn RuneNode) Child() iter.Seq[*RuneNode]
- func (tn *RuneNode) Cleanup() []*RuneNode
- func (tn RuneNode) Copy() *RuneNode
- func (tn *RuneNode) DeleteChild(target *RuneNode) []*RuneNode
- func (tn RuneNode) GetChildren() []*RuneNode
- func (tn RuneNode) GetFirstChild() (*RuneNode, bool)
- func (tn RuneNode) GetParent() (*RuneNode, bool)
- func (tn RuneNode) HasChild(target *RuneNode) bool
- func (tn RuneNode) IsChildOf(target *RuneNode) bool
- func (tn RuneNode) IsLeaf() bool
- func (tn RuneNode) IsSingleton() bool
- func (tn *RuneNode) LinkChildren(children []*RuneNode)
- func (tn *RuneNode) RemoveNode() []*RuneNode
- func (tn RuneNode) String() string
- type StringNode
- func (tn *StringNode) AddChild(target *StringNode)
- func (tn *StringNode) AddChildren(children []*StringNode)
- func (tn StringNode) BackwardChild() iter.Seq[*StringNode]
- func (tn StringNode) Child() iter.Seq[*StringNode]
- func (tn *StringNode) Cleanup() []*StringNode
- func (tn StringNode) Copy() *StringNode
- func (tn *StringNode) DeleteChild(target *StringNode) []*StringNode
- func (tn StringNode) GetChildren() []*StringNode
- func (tn StringNode) GetFirstChild() (*StringNode, bool)
- func (tn StringNode) GetParent() (*StringNode, bool)
- func (tn StringNode) HasChild(target *StringNode) bool
- func (tn StringNode) IsChildOf(target *StringNode) bool
- func (tn StringNode) IsLeaf() bool
- func (tn StringNode) IsSingleton() bool
- func (tn *StringNode) LinkChildren(children []*StringNode)
- func (tn *StringNode) RemoveNode() []*StringNode
- func (tn StringNode) String() string
- type TreeNode
- func (tn *TreeNode[T]) AddChild(target *TreeNode[T])
- func (tn *TreeNode[T]) AddChildren(children []*TreeNode[T])
- func (tn TreeNode[T]) BackwardChild() iter.Seq[*TreeNode[T]]
- func (tn TreeNode[T]) Child() iter.Seq[*TreeNode[T]]
- func (tn *TreeNode[T]) Cleanup() []*TreeNode[T]
- func (tn TreeNode[T]) Copy() *TreeNode[T]
- func (tn *TreeNode[T]) DeleteChild(target *TreeNode[T]) []*TreeNode[T]
- func (tn TreeNode[T]) GetChildren() []*TreeNode[T]
- func (tn TreeNode[T]) GetFirstChild() (*TreeNode[T], bool)
- func (tn TreeNode[T]) GetParent() (*TreeNode[T], bool)
- func (tn TreeNode[T]) HasChild(target *TreeNode[T]) bool
- func (tn TreeNode[T]) IsChildOf(target *TreeNode[T]) bool
- func (tn TreeNode[T]) IsLeaf() bool
- func (tn TreeNode[T]) IsSingleton() bool
- func (tn *TreeNode[T]) LinkChildren(children []*TreeNode[T])
- func (tn *TreeNode[T]) RemoveNode() []*TreeNode[T]
- func (tn TreeNode[T]) String() string
- type Uint16Node
- func (tn *Uint16Node) AddChild(target *Uint16Node)
- func (tn *Uint16Node) AddChildren(children []*Uint16Node)
- func (tn Uint16Node) BackwardChild() iter.Seq[*Uint16Node]
- func (tn Uint16Node) Child() iter.Seq[*Uint16Node]
- func (tn *Uint16Node) Cleanup() []*Uint16Node
- func (tn Uint16Node) Copy() *Uint16Node
- func (tn *Uint16Node) DeleteChild(target *Uint16Node) []*Uint16Node
- func (tn Uint16Node) GetChildren() []*Uint16Node
- func (tn Uint16Node) GetFirstChild() (*Uint16Node, bool)
- func (tn Uint16Node) GetParent() (*Uint16Node, bool)
- func (tn Uint16Node) HasChild(target *Uint16Node) bool
- func (tn Uint16Node) IsChildOf(target *Uint16Node) bool
- func (tn Uint16Node) IsLeaf() bool
- func (tn Uint16Node) IsSingleton() bool
- func (tn *Uint16Node) LinkChildren(children []*Uint16Node)
- func (tn *Uint16Node) RemoveNode() []*Uint16Node
- func (tn Uint16Node) String() string
- type Uint32Node
- func (tn *Uint32Node) AddChild(target *Uint32Node)
- func (tn *Uint32Node) AddChildren(children []*Uint32Node)
- func (tn Uint32Node) BackwardChild() iter.Seq[*Uint32Node]
- func (tn Uint32Node) Child() iter.Seq[*Uint32Node]
- func (tn *Uint32Node) Cleanup() []*Uint32Node
- func (tn Uint32Node) Copy() *Uint32Node
- func (tn *Uint32Node) DeleteChild(target *Uint32Node) []*Uint32Node
- func (tn Uint32Node) GetChildren() []*Uint32Node
- func (tn Uint32Node) GetFirstChild() (*Uint32Node, bool)
- func (tn Uint32Node) GetParent() (*Uint32Node, bool)
- func (tn Uint32Node) HasChild(target *Uint32Node) bool
- func (tn Uint32Node) IsChildOf(target *Uint32Node) bool
- func (tn Uint32Node) IsLeaf() bool
- func (tn Uint32Node) IsSingleton() bool
- func (tn *Uint32Node) LinkChildren(children []*Uint32Node)
- func (tn *Uint32Node) RemoveNode() []*Uint32Node
- func (tn Uint32Node) String() string
- type Uint64Node
- func (tn *Uint64Node) AddChild(target *Uint64Node)
- func (tn *Uint64Node) AddChildren(children []*Uint64Node)
- func (tn Uint64Node) BackwardChild() iter.Seq[*Uint64Node]
- func (tn Uint64Node) Child() iter.Seq[*Uint64Node]
- func (tn *Uint64Node) Cleanup() []*Uint64Node
- func (tn Uint64Node) Copy() *Uint64Node
- func (tn *Uint64Node) DeleteChild(target *Uint64Node) []*Uint64Node
- func (tn Uint64Node) GetChildren() []*Uint64Node
- func (tn Uint64Node) GetFirstChild() (*Uint64Node, bool)
- func (tn Uint64Node) GetParent() (*Uint64Node, bool)
- func (tn Uint64Node) HasChild(target *Uint64Node) bool
- func (tn Uint64Node) IsChildOf(target *Uint64Node) bool
- func (tn Uint64Node) IsLeaf() bool
- func (tn Uint64Node) IsSingleton() bool
- func (tn *Uint64Node) LinkChildren(children []*Uint64Node)
- func (tn *Uint64Node) RemoveNode() []*Uint64Node
- func (tn Uint64Node) String() string
- type Uint8Node
- func (tn *Uint8Node) AddChild(target *Uint8Node)
- func (tn *Uint8Node) AddChildren(children []*Uint8Node)
- func (tn Uint8Node) BackwardChild() iter.Seq[*Uint8Node]
- func (tn Uint8Node) Child() iter.Seq[*Uint8Node]
- func (tn *Uint8Node) Cleanup() []*Uint8Node
- func (tn Uint8Node) Copy() *Uint8Node
- func (tn *Uint8Node) DeleteChild(target *Uint8Node) []*Uint8Node
- func (tn Uint8Node) GetChildren() []*Uint8Node
- func (tn Uint8Node) GetFirstChild() (*Uint8Node, bool)
- func (tn Uint8Node) GetParent() (*Uint8Node, bool)
- func (tn Uint8Node) HasChild(target *Uint8Node) bool
- func (tn Uint8Node) IsChildOf(target *Uint8Node) bool
- func (tn Uint8Node) IsLeaf() bool
- func (tn Uint8Node) IsSingleton() bool
- func (tn *Uint8Node) LinkChildren(children []*Uint8Node)
- func (tn *Uint8Node) RemoveNode() []*Uint8Node
- func (tn Uint8Node) String() string
- type UintNode
- func (tn *UintNode) AddChild(target *UintNode)
- func (tn *UintNode) AddChildren(children []*UintNode)
- func (tn UintNode) BackwardChild() iter.Seq[*UintNode]
- func (tn UintNode) Child() iter.Seq[*UintNode]
- func (tn *UintNode) Cleanup() []*UintNode
- func (tn UintNode) Copy() *UintNode
- func (tn *UintNode) DeleteChild(target *UintNode) []*UintNode
- func (tn UintNode) GetChildren() []*UintNode
- func (tn UintNode) GetFirstChild() (*UintNode, bool)
- func (tn UintNode) GetParent() (*UintNode, bool)
- func (tn UintNode) HasChild(target *UintNode) bool
- func (tn UintNode) IsChildOf(target *UintNode) bool
- func (tn UintNode) IsLeaf() bool
- func (tn UintNode) IsSingleton() bool
- func (tn *UintNode) LinkChildren(children []*UintNode)
- func (tn *UintNode) RemoveNode() []*UintNode
- func (tn UintNode) String() string
- type UintptrNode
- func (tn *UintptrNode) AddChild(target *UintptrNode)
- func (tn *UintptrNode) AddChildren(children []*UintptrNode)
- func (tn UintptrNode) BackwardChild() iter.Seq[*UintptrNode]
- func (tn UintptrNode) Child() iter.Seq[*UintptrNode]
- func (tn *UintptrNode) Cleanup() []*UintptrNode
- func (tn UintptrNode) Copy() *UintptrNode
- func (tn *UintptrNode) DeleteChild(target *UintptrNode) []*UintptrNode
- func (tn UintptrNode) GetChildren() []*UintptrNode
- func (tn UintptrNode) GetFirstChild() (*UintptrNode, bool)
- func (tn UintptrNode) GetParent() (*UintptrNode, bool)
- func (tn UintptrNode) HasChild(target *UintptrNode) bool
- func (tn UintptrNode) IsChildOf(target *UintptrNode) bool
- func (tn UintptrNode) IsLeaf() bool
- func (tn UintptrNode) IsSingleton() bool
- func (tn *UintptrNode) LinkChildren(children []*UintptrNode)
- func (tn *UintptrNode) RemoveNode() []*UintptrNode
- func (tn UintptrNode) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoolNode ¶
type BoolNode struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *BoolNode
Data bool
}
BoolNode is a node in a tree.
func NewBoolNode ¶
NewBoolNode creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *BoolNode: A pointer to the newly created node. It is never nil.
func (*BoolNode) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*BoolNode) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the BoolNode.AddChild function.
Parameters:
- children: The children to add.
func (BoolNode) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*BoolNode]: A sequence of the children of the node.
func (BoolNode) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*BoolNode]: A sequence of the children of the node.
func (*BoolNode) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*BoolNode: The children of the node.
If the receiver is nil, it returns nil.
func (BoolNode) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*BoolNode) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*BoolNode: A slice of the children of the target node.
func (BoolNode) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*BoolNode: A slice of pointers to the children of the node.
func (BoolNode) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *BoolNode: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (BoolNode) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *BoolNode: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (BoolNode) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (BoolNode) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (BoolNode) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*BoolNode) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*BoolNode) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*BoolNode: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type ByteNode ¶
type ByteNode struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *ByteNode
Data byte
}
ByteNode is a node in a tree.
func NewByteNode ¶
NewByteNode creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *ByteNode: A pointer to the newly created node. It is never nil.
func (*ByteNode) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*ByteNode) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the ByteNode.AddChild function.
Parameters:
- children: The children to add.
func (ByteNode) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*ByteNode]: A sequence of the children of the node.
func (ByteNode) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*ByteNode]: A sequence of the children of the node.
func (*ByteNode) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*ByteNode: The children of the node.
If the receiver is nil, it returns nil.
func (ByteNode) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*ByteNode) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*ByteNode: A slice of the children of the target node.
func (ByteNode) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*ByteNode: A slice of pointers to the children of the node.
func (ByteNode) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *ByteNode: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (ByteNode) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *ByteNode: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (ByteNode) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (ByteNode) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (ByteNode) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*ByteNode) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*ByteNode) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*ByteNode: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type Complex128Node ¶
type Complex128Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Complex128Node
Data complex128
}
Complex128Node is a node in a tree.
func NewComplex128Node ¶
func NewComplex128Node(data complex128) *Complex128Node
NewComplex128Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Complex128Node: A pointer to the newly created node. It is never nil.
func (*Complex128Node) AddChild ¶
func (tn *Complex128Node) AddChild(target *Complex128Node)
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Complex128Node) AddChildren ¶
func (tn *Complex128Node) AddChildren(children []*Complex128Node)
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Complex128Node.AddChild function.
Parameters:
- children: The children to add.
func (Complex128Node) BackwardChild ¶ added in v0.1.13
func (tn Complex128Node) BackwardChild() iter.Seq[*Complex128Node]
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Complex128Node]: A sequence of the children of the node.
func (Complex128Node) Child ¶ added in v0.1.13
func (tn Complex128Node) Child() iter.Seq[*Complex128Node]
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Complex128Node]: A sequence of the children of the node.
func (*Complex128Node) Cleanup ¶
func (tn *Complex128Node) Cleanup() []*Complex128Node
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Complex128Node: The children of the node.
If the receiver is nil, it returns nil.
func (Complex128Node) Copy ¶
func (tn Complex128Node) Copy() *Complex128Node
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Complex128Node) DeleteChild ¶
func (tn *Complex128Node) DeleteChild(target *Complex128Node) []*Complex128Node
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Complex128Node: A slice of the children of the target node.
func (Complex128Node) GetChildren ¶
func (tn Complex128Node) GetChildren() []*Complex128Node
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Complex128Node: A slice of pointers to the children of the node.
func (Complex128Node) GetFirstChild ¶
func (tn Complex128Node) GetFirstChild() (*Complex128Node, bool)
GetFirstChild returns the first child of the node.
Returns:
- *Complex128Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Complex128Node) GetParent ¶
func (tn Complex128Node) GetParent() (*Complex128Node, bool)
GetParent returns the parent of the node.
Returns:
- *Complex128Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Complex128Node) HasChild ¶
func (tn Complex128Node) HasChild(target *Complex128Node) bool
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Complex128Node) IsChildOf ¶
func (tn Complex128Node) IsChildOf(target *Complex128Node) bool
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Complex128Node) IsLeaf ¶
func (tn Complex128Node) IsLeaf() bool
IsLeaf implements the tree.Noder interface.
func (Complex128Node) IsSingleton ¶
func (tn Complex128Node) IsSingleton() bool
IsSingleton implements the tree.Noder interface.
func (*Complex128Node) LinkChildren ¶
func (tn *Complex128Node) LinkChildren(children []*Complex128Node)
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Complex128Node) RemoveNode ¶
func (tn *Complex128Node) RemoveNode() []*Complex128Node
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Complex128Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
func (Complex128Node) String ¶
func (tn Complex128Node) String() string
String implements the tree.Noder interface.
type Complex64Node ¶
type Complex64Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Complex64Node
Data complex64
}
Complex64Node is a node in a tree.
func NewComplex64Node ¶
func NewComplex64Node(data complex64) *Complex64Node
NewComplex64Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Complex64Node: A pointer to the newly created node. It is never nil.
func (*Complex64Node) AddChild ¶
func (tn *Complex64Node) AddChild(target *Complex64Node)
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Complex64Node) AddChildren ¶
func (tn *Complex64Node) AddChildren(children []*Complex64Node)
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Complex64Node.AddChild function.
Parameters:
- children: The children to add.
func (Complex64Node) BackwardChild ¶ added in v0.1.13
func (tn Complex64Node) BackwardChild() iter.Seq[*Complex64Node]
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Complex64Node]: A sequence of the children of the node.
func (Complex64Node) Child ¶ added in v0.1.13
func (tn Complex64Node) Child() iter.Seq[*Complex64Node]
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Complex64Node]: A sequence of the children of the node.
func (*Complex64Node) Cleanup ¶
func (tn *Complex64Node) Cleanup() []*Complex64Node
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Complex64Node: The children of the node.
If the receiver is nil, it returns nil.
func (Complex64Node) Copy ¶
func (tn Complex64Node) Copy() *Complex64Node
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Complex64Node) DeleteChild ¶
func (tn *Complex64Node) DeleteChild(target *Complex64Node) []*Complex64Node
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Complex64Node: A slice of the children of the target node.
func (Complex64Node) GetChildren ¶
func (tn Complex64Node) GetChildren() []*Complex64Node
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Complex64Node: A slice of pointers to the children of the node.
func (Complex64Node) GetFirstChild ¶
func (tn Complex64Node) GetFirstChild() (*Complex64Node, bool)
GetFirstChild returns the first child of the node.
Returns:
- *Complex64Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Complex64Node) GetParent ¶
func (tn Complex64Node) GetParent() (*Complex64Node, bool)
GetParent returns the parent of the node.
Returns:
- *Complex64Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Complex64Node) HasChild ¶
func (tn Complex64Node) HasChild(target *Complex64Node) bool
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Complex64Node) IsChildOf ¶
func (tn Complex64Node) IsChildOf(target *Complex64Node) bool
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Complex64Node) IsLeaf ¶
func (tn Complex64Node) IsLeaf() bool
IsLeaf implements the tree.Noder interface.
func (Complex64Node) IsSingleton ¶
func (tn Complex64Node) IsSingleton() bool
IsSingleton implements the tree.Noder interface.
func (*Complex64Node) LinkChildren ¶
func (tn *Complex64Node) LinkChildren(children []*Complex64Node)
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Complex64Node) RemoveNode ¶
func (tn *Complex64Node) RemoveNode() []*Complex64Node
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Complex64Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
func (Complex64Node) String ¶
func (tn Complex64Node) String() string
String implements the tree.Noder interface.
type ErrorNode ¶
type ErrorNode struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *ErrorNode
Data error
}
ErrorNode is a node in a tree.
func NewErrorNode ¶
NewErrorNode creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *ErrorNode: A pointer to the newly created node. It is never nil.
func (*ErrorNode) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*ErrorNode) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the ErrorNode.AddChild function.
Parameters:
- children: The children to add.
func (ErrorNode) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*ErrorNode]: A sequence of the children of the node.
func (ErrorNode) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*ErrorNode]: A sequence of the children of the node.
func (*ErrorNode) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*ErrorNode: The children of the node.
If the receiver is nil, it returns nil.
func (ErrorNode) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*ErrorNode) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*ErrorNode: A slice of the children of the target node.
func (ErrorNode) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*ErrorNode: A slice of pointers to the children of the node.
func (ErrorNode) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *ErrorNode: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (ErrorNode) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *ErrorNode: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (ErrorNode) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (ErrorNode) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (ErrorNode) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*ErrorNode) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*ErrorNode) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*ErrorNode: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type Float32Node ¶
type Float32Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Float32Node
Data float32
}
Float32Node is a node in a tree.
func NewFloat32Node ¶
func NewFloat32Node(data float32) *Float32Node
NewFloat32Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Float32Node: A pointer to the newly created node. It is never nil.
func (*Float32Node) AddChild ¶
func (tn *Float32Node) AddChild(target *Float32Node)
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Float32Node) AddChildren ¶
func (tn *Float32Node) AddChildren(children []*Float32Node)
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Float32Node.AddChild function.
Parameters:
- children: The children to add.
func (Float32Node) BackwardChild ¶ added in v0.1.13
func (tn Float32Node) BackwardChild() iter.Seq[*Float32Node]
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Float32Node]: A sequence of the children of the node.
func (Float32Node) Child ¶ added in v0.1.13
func (tn Float32Node) Child() iter.Seq[*Float32Node]
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Float32Node]: A sequence of the children of the node.
func (*Float32Node) Cleanup ¶
func (tn *Float32Node) Cleanup() []*Float32Node
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Float32Node: The children of the node.
If the receiver is nil, it returns nil.
func (Float32Node) Copy ¶
func (tn Float32Node) Copy() *Float32Node
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Float32Node) DeleteChild ¶
func (tn *Float32Node) DeleteChild(target *Float32Node) []*Float32Node
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Float32Node: A slice of the children of the target node.
func (Float32Node) GetChildren ¶
func (tn Float32Node) GetChildren() []*Float32Node
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Float32Node: A slice of pointers to the children of the node.
func (Float32Node) GetFirstChild ¶
func (tn Float32Node) GetFirstChild() (*Float32Node, bool)
GetFirstChild returns the first child of the node.
Returns:
- *Float32Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Float32Node) GetParent ¶
func (tn Float32Node) GetParent() (*Float32Node, bool)
GetParent returns the parent of the node.
Returns:
- *Float32Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Float32Node) HasChild ¶
func (tn Float32Node) HasChild(target *Float32Node) bool
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Float32Node) IsChildOf ¶
func (tn Float32Node) IsChildOf(target *Float32Node) bool
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Float32Node) IsLeaf ¶
func (tn Float32Node) IsLeaf() bool
IsLeaf implements the tree.Noder interface.
func (Float32Node) IsSingleton ¶
func (tn Float32Node) IsSingleton() bool
IsSingleton implements the tree.Noder interface.
func (*Float32Node) LinkChildren ¶
func (tn *Float32Node) LinkChildren(children []*Float32Node)
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Float32Node) RemoveNode ¶
func (tn *Float32Node) RemoveNode() []*Float32Node
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Float32Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
func (Float32Node) String ¶
func (tn Float32Node) String() string
String implements the tree.Noder interface.
type Float64Node ¶
type Float64Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Float64Node
Data float64
}
Float64Node is a node in a tree.
func NewFloat64Node ¶
func NewFloat64Node(data float64) *Float64Node
NewFloat64Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Float64Node: A pointer to the newly created node. It is never nil.
func (*Float64Node) AddChild ¶
func (tn *Float64Node) AddChild(target *Float64Node)
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Float64Node) AddChildren ¶
func (tn *Float64Node) AddChildren(children []*Float64Node)
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Float64Node.AddChild function.
Parameters:
- children: The children to add.
func (Float64Node) BackwardChild ¶ added in v0.1.13
func (tn Float64Node) BackwardChild() iter.Seq[*Float64Node]
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Float64Node]: A sequence of the children of the node.
func (Float64Node) Child ¶ added in v0.1.13
func (tn Float64Node) Child() iter.Seq[*Float64Node]
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Float64Node]: A sequence of the children of the node.
func (*Float64Node) Cleanup ¶
func (tn *Float64Node) Cleanup() []*Float64Node
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Float64Node: The children of the node.
If the receiver is nil, it returns nil.
func (Float64Node) Copy ¶
func (tn Float64Node) Copy() *Float64Node
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Float64Node) DeleteChild ¶
func (tn *Float64Node) DeleteChild(target *Float64Node) []*Float64Node
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Float64Node: A slice of the children of the target node.
func (Float64Node) GetChildren ¶
func (tn Float64Node) GetChildren() []*Float64Node
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Float64Node: A slice of pointers to the children of the node.
func (Float64Node) GetFirstChild ¶
func (tn Float64Node) GetFirstChild() (*Float64Node, bool)
GetFirstChild returns the first child of the node.
Returns:
- *Float64Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Float64Node) GetParent ¶
func (tn Float64Node) GetParent() (*Float64Node, bool)
GetParent returns the parent of the node.
Returns:
- *Float64Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Float64Node) HasChild ¶
func (tn Float64Node) HasChild(target *Float64Node) bool
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Float64Node) IsChildOf ¶
func (tn Float64Node) IsChildOf(target *Float64Node) bool
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Float64Node) IsLeaf ¶
func (tn Float64Node) IsLeaf() bool
IsLeaf implements the tree.Noder interface.
func (Float64Node) IsSingleton ¶
func (tn Float64Node) IsSingleton() bool
IsSingleton implements the tree.Noder interface.
func (*Float64Node) LinkChildren ¶
func (tn *Float64Node) LinkChildren(children []*Float64Node)
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Float64Node) RemoveNode ¶
func (tn *Float64Node) RemoveNode() []*Float64Node
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Float64Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
func (Float64Node) String ¶
func (tn Float64Node) String() string
String implements the tree.Noder interface.
type Int16Node ¶
type Int16Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Int16Node
Data int16
}
Int16Node is a node in a tree.
func NewInt16Node ¶
NewInt16Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Int16Node: A pointer to the newly created node. It is never nil.
func (*Int16Node) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Int16Node) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Int16Node.AddChild function.
Parameters:
- children: The children to add.
func (Int16Node) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Int16Node]: A sequence of the children of the node.
func (Int16Node) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Int16Node]: A sequence of the children of the node.
func (*Int16Node) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Int16Node: The children of the node.
If the receiver is nil, it returns nil.
func (Int16Node) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Int16Node) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Int16Node: A slice of the children of the target node.
func (Int16Node) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Int16Node: A slice of pointers to the children of the node.
func (Int16Node) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *Int16Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Int16Node) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *Int16Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Int16Node) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Int16Node) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Int16Node) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*Int16Node) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Int16Node) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Int16Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type Int32Node ¶
type Int32Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Int32Node
Data int32
}
Int32Node is a node in a tree.
func NewInt32Node ¶
NewInt32Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Int32Node: A pointer to the newly created node. It is never nil.
func (*Int32Node) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Int32Node) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Int32Node.AddChild function.
Parameters:
- children: The children to add.
func (Int32Node) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Int32Node]: A sequence of the children of the node.
func (Int32Node) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Int32Node]: A sequence of the children of the node.
func (*Int32Node) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Int32Node: The children of the node.
If the receiver is nil, it returns nil.
func (Int32Node) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Int32Node) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Int32Node: A slice of the children of the target node.
func (Int32Node) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Int32Node: A slice of pointers to the children of the node.
func (Int32Node) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *Int32Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Int32Node) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *Int32Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Int32Node) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Int32Node) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Int32Node) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*Int32Node) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Int32Node) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Int32Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type Int64Node ¶
type Int64Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Int64Node
Data int64
}
Int64Node is a node in a tree.
func NewInt64Node ¶
NewInt64Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Int64Node: A pointer to the newly created node. It is never nil.
func (*Int64Node) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Int64Node) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Int64Node.AddChild function.
Parameters:
- children: The children to add.
func (Int64Node) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Int64Node]: A sequence of the children of the node.
func (Int64Node) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Int64Node]: A sequence of the children of the node.
func (*Int64Node) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Int64Node: The children of the node.
If the receiver is nil, it returns nil.
func (Int64Node) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Int64Node) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Int64Node: A slice of the children of the target node.
func (Int64Node) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Int64Node: A slice of pointers to the children of the node.
func (Int64Node) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *Int64Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Int64Node) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *Int64Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Int64Node) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Int64Node) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Int64Node) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*Int64Node) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Int64Node) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Int64Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type Int8Node ¶
type Int8Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Int8Node
Data int8
}
Int8Node is a node in a tree.
func NewInt8Node ¶
NewInt8Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Int8Node: A pointer to the newly created node. It is never nil.
func (*Int8Node) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Int8Node) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Int8Node.AddChild function.
Parameters:
- children: The children to add.
func (Int8Node) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Int8Node]: A sequence of the children of the node.
func (Int8Node) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Int8Node]: A sequence of the children of the node.
func (*Int8Node) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Int8Node: The children of the node.
If the receiver is nil, it returns nil.
func (Int8Node) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Int8Node) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Int8Node: A slice of the children of the target node.
func (Int8Node) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Int8Node: A slice of pointers to the children of the node.
func (Int8Node) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *Int8Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Int8Node) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *Int8Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Int8Node) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Int8Node) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Int8Node) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*Int8Node) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Int8Node) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Int8Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type IntNode ¶
IntNode is a node in a tree.
func NewIntNode ¶
NewIntNode creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *IntNode: A pointer to the newly created node. It is never nil.
func (*IntNode) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*IntNode) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the IntNode.AddChild function.
Parameters:
- children: The children to add.
func (IntNode) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*IntNode]: A sequence of the children of the node.
func (IntNode) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*IntNode]: A sequence of the children of the node.
func (*IntNode) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*IntNode: The children of the node.
If the receiver is nil, it returns nil.
func (IntNode) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*IntNode) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*IntNode: A slice of the children of the target node.
func (IntNode) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*IntNode: A slice of pointers to the children of the node.
func (IntNode) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *IntNode: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (IntNode) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *IntNode: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (IntNode) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (IntNode) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (IntNode) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*IntNode) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*IntNode) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*IntNode: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type RuneNode ¶
type RuneNode struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *RuneNode
Data rune
}
RuneNode is a node in a tree.
func NewRuneNode ¶
NewRuneNode creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *RuneNode: A pointer to the newly created node. It is never nil.
func (*RuneNode) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*RuneNode) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the RuneNode.AddChild function.
Parameters:
- children: The children to add.
func (RuneNode) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*RuneNode]: A sequence of the children of the node.
func (RuneNode) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*RuneNode]: A sequence of the children of the node.
func (*RuneNode) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*RuneNode: The children of the node.
If the receiver is nil, it returns nil.
func (RuneNode) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*RuneNode) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*RuneNode: A slice of the children of the target node.
func (RuneNode) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*RuneNode: A slice of pointers to the children of the node.
func (RuneNode) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *RuneNode: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (RuneNode) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *RuneNode: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (RuneNode) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (RuneNode) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (RuneNode) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*RuneNode) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*RuneNode) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*RuneNode: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type StringNode ¶
type StringNode struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *StringNode
Data string
}
StringNode is a node in a tree.
func NewStringNode ¶
func NewStringNode(data string) *StringNode
NewStringNode creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *StringNode: A pointer to the newly created node. It is never nil.
func (*StringNode) AddChild ¶
func (tn *StringNode) AddChild(target *StringNode)
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*StringNode) AddChildren ¶
func (tn *StringNode) AddChildren(children []*StringNode)
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the StringNode.AddChild function.
Parameters:
- children: The children to add.
func (StringNode) BackwardChild ¶ added in v0.1.13
func (tn StringNode) BackwardChild() iter.Seq[*StringNode]
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*StringNode]: A sequence of the children of the node.
func (StringNode) Child ¶ added in v0.1.13
func (tn StringNode) Child() iter.Seq[*StringNode]
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*StringNode]: A sequence of the children of the node.
func (*StringNode) Cleanup ¶
func (tn *StringNode) Cleanup() []*StringNode
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*StringNode: The children of the node.
If the receiver is nil, it returns nil.
func (StringNode) Copy ¶
func (tn StringNode) Copy() *StringNode
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*StringNode) DeleteChild ¶
func (tn *StringNode) DeleteChild(target *StringNode) []*StringNode
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*StringNode: A slice of the children of the target node.
func (StringNode) GetChildren ¶
func (tn StringNode) GetChildren() []*StringNode
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*StringNode: A slice of pointers to the children of the node.
func (StringNode) GetFirstChild ¶
func (tn StringNode) GetFirstChild() (*StringNode, bool)
GetFirstChild returns the first child of the node.
Returns:
- *StringNode: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (StringNode) GetParent ¶
func (tn StringNode) GetParent() (*StringNode, bool)
GetParent returns the parent of the node.
Returns:
- *StringNode: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (StringNode) HasChild ¶
func (tn StringNode) HasChild(target *StringNode) bool
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (StringNode) IsChildOf ¶
func (tn StringNode) IsChildOf(target *StringNode) bool
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (StringNode) IsLeaf ¶
func (tn StringNode) IsLeaf() bool
IsLeaf implements the tree.Noder interface.
func (StringNode) IsSingleton ¶
func (tn StringNode) IsSingleton() bool
IsSingleton implements the tree.Noder interface.
func (*StringNode) LinkChildren ¶
func (tn *StringNode) LinkChildren(children []*StringNode)
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*StringNode) RemoveNode ¶
func (tn *StringNode) RemoveNode() []*StringNode
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*StringNode: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
func (StringNode) String ¶
func (tn StringNode) String() string
String implements the tree.Noder interface.
type TreeNode ¶
type TreeNode[T any] struct { Parent, FirstChild, NextSibling, LastChild, PrevSibling *TreeNode[T] Data T }
TreeNode is a node in a tree.
func NewTreeNode ¶
NewTreeNode creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *TreeNode[T]: A pointer to the newly created node. It is never nil.
func (*TreeNode[T]) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*TreeNode[T]) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the TreeNode.AddChild function.
Parameters:
- children: The children to add.
func (TreeNode[T]) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*TreeNode[T]]: A sequence of the children of the node.
func (TreeNode[T]) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*TreeNode[T]]: A sequence of the children of the node.
func (*TreeNode[T]) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*TreeNode[T]: The children of the node.
If the receiver is nil, it returns nil.
func (TreeNode[T]) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*TreeNode[T]) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*TreeNode[T]: A slice of the children of the target node.
func (TreeNode[T]) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*TreeNode[T]: A slice of pointers to the children of the node.
func (TreeNode[T]) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *TreeNode[T]: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (TreeNode[T]) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *TreeNode[T]: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (TreeNode[T]) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (TreeNode[T]) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (TreeNode[T]) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*TreeNode[T]) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*TreeNode[T]) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*TreeNode[T]: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type Uint16Node ¶
type Uint16Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Uint16Node
Data uint16
}
Uint16Node is a node in a tree.
func NewUint16Node ¶
func NewUint16Node(data uint16) *Uint16Node
NewUint16Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Uint16Node: A pointer to the newly created node. It is never nil.
func (*Uint16Node) AddChild ¶
func (tn *Uint16Node) AddChild(target *Uint16Node)
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Uint16Node) AddChildren ¶
func (tn *Uint16Node) AddChildren(children []*Uint16Node)
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Uint16Node.AddChild function.
Parameters:
- children: The children to add.
func (Uint16Node) BackwardChild ¶ added in v0.1.13
func (tn Uint16Node) BackwardChild() iter.Seq[*Uint16Node]
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Uint16Node]: A sequence of the children of the node.
func (Uint16Node) Child ¶ added in v0.1.13
func (tn Uint16Node) Child() iter.Seq[*Uint16Node]
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Uint16Node]: A sequence of the children of the node.
func (*Uint16Node) Cleanup ¶
func (tn *Uint16Node) Cleanup() []*Uint16Node
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Uint16Node: The children of the node.
If the receiver is nil, it returns nil.
func (Uint16Node) Copy ¶
func (tn Uint16Node) Copy() *Uint16Node
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Uint16Node) DeleteChild ¶
func (tn *Uint16Node) DeleteChild(target *Uint16Node) []*Uint16Node
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Uint16Node: A slice of the children of the target node.
func (Uint16Node) GetChildren ¶
func (tn Uint16Node) GetChildren() []*Uint16Node
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Uint16Node: A slice of pointers to the children of the node.
func (Uint16Node) GetFirstChild ¶
func (tn Uint16Node) GetFirstChild() (*Uint16Node, bool)
GetFirstChild returns the first child of the node.
Returns:
- *Uint16Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Uint16Node) GetParent ¶
func (tn Uint16Node) GetParent() (*Uint16Node, bool)
GetParent returns the parent of the node.
Returns:
- *Uint16Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Uint16Node) HasChild ¶
func (tn Uint16Node) HasChild(target *Uint16Node) bool
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Uint16Node) IsChildOf ¶
func (tn Uint16Node) IsChildOf(target *Uint16Node) bool
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Uint16Node) IsLeaf ¶
func (tn Uint16Node) IsLeaf() bool
IsLeaf implements the tree.Noder interface.
func (Uint16Node) IsSingleton ¶
func (tn Uint16Node) IsSingleton() bool
IsSingleton implements the tree.Noder interface.
func (*Uint16Node) LinkChildren ¶
func (tn *Uint16Node) LinkChildren(children []*Uint16Node)
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Uint16Node) RemoveNode ¶
func (tn *Uint16Node) RemoveNode() []*Uint16Node
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Uint16Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
func (Uint16Node) String ¶
func (tn Uint16Node) String() string
String implements the tree.Noder interface.
type Uint32Node ¶
type Uint32Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Uint32Node
Data uint32
}
Uint32Node is a node in a tree.
func NewUint32Node ¶
func NewUint32Node(data uint32) *Uint32Node
NewUint32Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Uint32Node: A pointer to the newly created node. It is never nil.
func (*Uint32Node) AddChild ¶
func (tn *Uint32Node) AddChild(target *Uint32Node)
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Uint32Node) AddChildren ¶
func (tn *Uint32Node) AddChildren(children []*Uint32Node)
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Uint32Node.AddChild function.
Parameters:
- children: The children to add.
func (Uint32Node) BackwardChild ¶ added in v0.1.13
func (tn Uint32Node) BackwardChild() iter.Seq[*Uint32Node]
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Uint32Node]: A sequence of the children of the node.
func (Uint32Node) Child ¶ added in v0.1.13
func (tn Uint32Node) Child() iter.Seq[*Uint32Node]
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Uint32Node]: A sequence of the children of the node.
func (*Uint32Node) Cleanup ¶
func (tn *Uint32Node) Cleanup() []*Uint32Node
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Uint32Node: The children of the node.
If the receiver is nil, it returns nil.
func (Uint32Node) Copy ¶
func (tn Uint32Node) Copy() *Uint32Node
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Uint32Node) DeleteChild ¶
func (tn *Uint32Node) DeleteChild(target *Uint32Node) []*Uint32Node
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Uint32Node: A slice of the children of the target node.
func (Uint32Node) GetChildren ¶
func (tn Uint32Node) GetChildren() []*Uint32Node
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Uint32Node: A slice of pointers to the children of the node.
func (Uint32Node) GetFirstChild ¶
func (tn Uint32Node) GetFirstChild() (*Uint32Node, bool)
GetFirstChild returns the first child of the node.
Returns:
- *Uint32Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Uint32Node) GetParent ¶
func (tn Uint32Node) GetParent() (*Uint32Node, bool)
GetParent returns the parent of the node.
Returns:
- *Uint32Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Uint32Node) HasChild ¶
func (tn Uint32Node) HasChild(target *Uint32Node) bool
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Uint32Node) IsChildOf ¶
func (tn Uint32Node) IsChildOf(target *Uint32Node) bool
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Uint32Node) IsLeaf ¶
func (tn Uint32Node) IsLeaf() bool
IsLeaf implements the tree.Noder interface.
func (Uint32Node) IsSingleton ¶
func (tn Uint32Node) IsSingleton() bool
IsSingleton implements the tree.Noder interface.
func (*Uint32Node) LinkChildren ¶
func (tn *Uint32Node) LinkChildren(children []*Uint32Node)
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Uint32Node) RemoveNode ¶
func (tn *Uint32Node) RemoveNode() []*Uint32Node
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Uint32Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
func (Uint32Node) String ¶
func (tn Uint32Node) String() string
String implements the tree.Noder interface.
type Uint64Node ¶
type Uint64Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Uint64Node
Data uint64
}
Uint64Node is a node in a tree.
func NewUint64Node ¶
func NewUint64Node(data uint64) *Uint64Node
NewUint64Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Uint64Node: A pointer to the newly created node. It is never nil.
func (*Uint64Node) AddChild ¶
func (tn *Uint64Node) AddChild(target *Uint64Node)
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Uint64Node) AddChildren ¶
func (tn *Uint64Node) AddChildren(children []*Uint64Node)
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Uint64Node.AddChild function.
Parameters:
- children: The children to add.
func (Uint64Node) BackwardChild ¶ added in v0.1.13
func (tn Uint64Node) BackwardChild() iter.Seq[*Uint64Node]
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Uint64Node]: A sequence of the children of the node.
func (Uint64Node) Child ¶ added in v0.1.13
func (tn Uint64Node) Child() iter.Seq[*Uint64Node]
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Uint64Node]: A sequence of the children of the node.
func (*Uint64Node) Cleanup ¶
func (tn *Uint64Node) Cleanup() []*Uint64Node
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Uint64Node: The children of the node.
If the receiver is nil, it returns nil.
func (Uint64Node) Copy ¶
func (tn Uint64Node) Copy() *Uint64Node
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Uint64Node) DeleteChild ¶
func (tn *Uint64Node) DeleteChild(target *Uint64Node) []*Uint64Node
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Uint64Node: A slice of the children of the target node.
func (Uint64Node) GetChildren ¶
func (tn Uint64Node) GetChildren() []*Uint64Node
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Uint64Node: A slice of pointers to the children of the node.
func (Uint64Node) GetFirstChild ¶
func (tn Uint64Node) GetFirstChild() (*Uint64Node, bool)
GetFirstChild returns the first child of the node.
Returns:
- *Uint64Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Uint64Node) GetParent ¶
func (tn Uint64Node) GetParent() (*Uint64Node, bool)
GetParent returns the parent of the node.
Returns:
- *Uint64Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Uint64Node) HasChild ¶
func (tn Uint64Node) HasChild(target *Uint64Node) bool
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Uint64Node) IsChildOf ¶
func (tn Uint64Node) IsChildOf(target *Uint64Node) bool
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Uint64Node) IsLeaf ¶
func (tn Uint64Node) IsLeaf() bool
IsLeaf implements the tree.Noder interface.
func (Uint64Node) IsSingleton ¶
func (tn Uint64Node) IsSingleton() bool
IsSingleton implements the tree.Noder interface.
func (*Uint64Node) LinkChildren ¶
func (tn *Uint64Node) LinkChildren(children []*Uint64Node)
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Uint64Node) RemoveNode ¶
func (tn *Uint64Node) RemoveNode() []*Uint64Node
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Uint64Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
func (Uint64Node) String ¶
func (tn Uint64Node) String() string
String implements the tree.Noder interface.
type Uint8Node ¶
type Uint8Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Uint8Node
Data uint8
}
Uint8Node is a node in a tree.
func NewUint8Node ¶
NewUint8Node creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *Uint8Node: A pointer to the newly created node. It is never nil.
func (*Uint8Node) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*Uint8Node) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the Uint8Node.AddChild function.
Parameters:
- children: The children to add.
func (Uint8Node) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*Uint8Node]: A sequence of the children of the node.
func (Uint8Node) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*Uint8Node]: A sequence of the children of the node.
func (*Uint8Node) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*Uint8Node: The children of the node.
If the receiver is nil, it returns nil.
func (Uint8Node) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*Uint8Node) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*Uint8Node: A slice of the children of the target node.
func (Uint8Node) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*Uint8Node: A slice of pointers to the children of the node.
func (Uint8Node) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *Uint8Node: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (Uint8Node) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *Uint8Node: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (Uint8Node) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (Uint8Node) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (Uint8Node) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*Uint8Node) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*Uint8Node) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*Uint8Node: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type UintNode ¶
type UintNode struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *UintNode
Data uint
}
UintNode is a node in a tree.
func NewUintNode ¶
NewUintNode creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *UintNode: A pointer to the newly created node. It is never nil.
func (*UintNode) AddChild ¶
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*UintNode) AddChildren ¶
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the UintNode.AddChild function.
Parameters:
- children: The children to add.
func (UintNode) BackwardChild ¶ added in v0.1.13
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*UintNode]: A sequence of the children of the node.
func (UintNode) Child ¶ added in v0.1.13
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*UintNode]: A sequence of the children of the node.
func (*UintNode) Cleanup ¶
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*UintNode: The children of the node.
If the receiver is nil, it returns nil.
func (UintNode) Copy ¶
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*UintNode) DeleteChild ¶
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*UintNode: A slice of the children of the target node.
func (UintNode) GetChildren ¶
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*UintNode: A slice of pointers to the children of the node.
func (UintNode) GetFirstChild ¶
GetFirstChild returns the first child of the node.
Returns:
- *UintNode: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (UintNode) GetParent ¶
GetParent returns the parent of the node.
Returns:
- *UintNode: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (UintNode) HasChild ¶
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (UintNode) IsChildOf ¶
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (UintNode) IsSingleton ¶
IsSingleton implements the tree.Noder interface.
func (*UintNode) LinkChildren ¶
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*UintNode) RemoveNode ¶
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*UintNode: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
type UintptrNode ¶
type UintptrNode struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *UintptrNode
Data uintptr
}
UintptrNode is a node in a tree.
func NewUintptrNode ¶
func NewUintptrNode(data uintptr) *UintptrNode
NewUintptrNode creates a new node with the given data.
Parameters:
- Data: The Data of the node.
Returns:
- *UintptrNode: A pointer to the newly created node. It is never nil.
func (*UintptrNode) AddChild ¶
func (tn *UintptrNode) AddChild(target *UintptrNode)
AddChild adds the target child to the node. Because this function clears the parent and sibling of the target, it does not add its relatives.
Parameters:
- target: The child to add.
If the receiver or the target are nil, it does nothing.
func (*UintptrNode) AddChildren ¶
func (tn *UintptrNode) AddChildren(children []*UintptrNode)
AddChildren is a convenience function to add multiple children to the node at once. It is more efficient than adding them one by one. Therefore, the behaviors are the same as the behaviors of the UintptrNode.AddChild function.
Parameters:
- children: The children to add.
func (UintptrNode) BackwardChild ¶ added in v0.1.13
func (tn UintptrNode) BackwardChild() iter.Seq[*UintptrNode]
BackwardChild scans the children of the node in reverse order (i.e., from the last child to the first one) and yields them one by one.
Returns:
- iter.Seq[*UintptrNode]: A sequence of the children of the node.
func (UintptrNode) Child ¶ added in v0.1.13
func (tn UintptrNode) Child() iter.Seq[*UintptrNode]
Child scans the children of the node in order (i.e., from the first child to the last one) and yields them one by one.
Returns:
- iter.Seq[*UintptrNode]: A sequence of the children of the node.
func (*UintptrNode) Cleanup ¶
func (tn *UintptrNode) Cleanup() []*UintptrNode
Cleanup cleans the node and returns its children. This function logically removes the node from the siblings and the parent.
Finally, it is not safe to use in goroutines as pointers may be dereferenced while another goroutine is still using them.
Returns:
- []*UintptrNode: The children of the node.
If the receiver is nil, it returns nil.
func (UintptrNode) Copy ¶
func (tn UintptrNode) Copy() *UintptrNode
Copy creates a shally copy of the node.
Although this function never returns nil, it does not copy any pointers.
func (*UintptrNode) DeleteChild ¶
func (tn *UintptrNode) DeleteChild(target *UintptrNode) []*UintptrNode
DeleteChild deletes the child from the children of the node while returning the children of the target node.
Parameters:
- target: The child to remove.
Returns:
- []*UintptrNode: A slice of the children of the target node.
func (UintptrNode) GetChildren ¶
func (tn UintptrNode) GetChildren() []*UintptrNode
GetChildren returns the immediate children of the node.
The returned nodes are never nil and are not copied. Thus, modifying the returned nodes will modify the tree.
Returns:
- []*UintptrNode: A slice of pointers to the children of the node.
func (UintptrNode) GetFirstChild ¶
func (tn UintptrNode) GetFirstChild() (*UintptrNode, bool)
GetFirstChild returns the first child of the node.
Returns:
- *UintptrNode: The first child of the node.
- bool: True if the node has a child, false otherwise.
func (UintptrNode) GetParent ¶
func (tn UintptrNode) GetParent() (*UintptrNode, bool)
GetParent returns the parent of the node.
Returns:
- *UintptrNode: The parent of the node.
- bool: True if the node has a parent, false otherwise.
func (UintptrNode) HasChild ¶
func (tn UintptrNode) HasChild(target *UintptrNode) bool
HasChild returns true if the node has the given child.
Because children of a node cannot be nil, a nil target will always return false.
Parameters:
- target: The child to check for.
Returns:
- bool: True if the node has the child, false otherwise.
func (UintptrNode) IsChildOf ¶
func (tn UintptrNode) IsChildOf(target *UintptrNode) bool
IsChildOf returns true if the node is a child of the parent. If target is nil, it returns false.
Parameters:
- target: The target parent to check for.
Returns:
- bool: True if the node is a child of the parent, false otherwise.
func (UintptrNode) IsLeaf ¶
func (tn UintptrNode) IsLeaf() bool
IsLeaf implements the tree.Noder interface.
func (UintptrNode) IsSingleton ¶
func (tn UintptrNode) IsSingleton() bool
IsSingleton implements the tree.Noder interface.
func (*UintptrNode) LinkChildren ¶
func (tn *UintptrNode) LinkChildren(children []*UintptrNode)
LinkChildren is a method that links the children of the node.
Parameters:
- children: The children to link.
Does nothing if the receiver is nil.
func (*UintptrNode) RemoveNode ¶
func (tn *UintptrNode) RemoveNode() []*UintptrNode
RemoveNode removes the node from the tree while shifting the children up one level to maintain the tree structure. The returned children can be used to create a forest of trees if the root node is removed.
Returns:
- []*UintptrNode: A slice of pointers to the children of the node iff the node is the root.
Example:
// Given the tree: 1 ├── 2 ├── 3 | ├── 4 | └── 5 └── 6 // The tree after removing node 3: 1 ├── 2 ├── 4 ├── 5 └── 6
func (UintptrNode) String ¶
func (tn UintptrNode) String() string
String implements the tree.Noder interface.