chore: remove unused methods

This commit is contained in:
Steven
2023-12-14 00:24:41 +08:00
parent 5266a62685
commit 3edce174d6
5 changed files with 15 additions and 50 deletions

View File

@@ -8,29 +8,17 @@ type Node interface {
// This method is used for debugging.
String() string
// GetParent returns a parent node of this node.
GetParent() Node
// GetPrevSibling returns a previous sibling node of this node.
GetPrevSibling() Node
// GetNextSibling returns a next sibling node of this node.
GetNextSibling() Node
// GetChildren returns children nodes of this node.
GetChildren() []Node
// SetParent sets a parent node to this node.
SetParent(Node)
// SetPrevSibling sets a previous sibling node to this node.
SetPrevSibling(Node)
// SetNextSibling sets a next sibling node to this node.
SetNextSibling(Node)
// SetChildren sets children nodes to this node.
SetChildren([]Node)
}
type NodeType int
@@ -49,17 +37,9 @@ func NewNodeType(name string) NodeType {
}
type BaseNode struct {
parent Node
prevSibling Node
nextSibling Node
children []Node
}
func (n *BaseNode) GetParent() Node {
return n.parent
}
func (n *BaseNode) GetPrevSibling() Node {
@@ -70,14 +50,6 @@ func (n *BaseNode) GetNextSibling() Node {
return n.nextSibling
}
func (n *BaseNode) GetChildren() []Node {
return n.children
}
func (n *BaseNode) SetParent(node Node) {
n.parent = node
}
func (n *BaseNode) SetPrevSibling(node Node) {
n.prevSibling = node
}
@@ -85,7 +57,3 @@ func (n *BaseNode) SetPrevSibling(node Node) {
func (n *BaseNode) SetNextSibling(node Node) {
n.nextSibling = node
}
func (n *BaseNode) SetChildren(nodes []Node) {
n.children = nodes
}