structure_old/priority_list/plist_node.go

19 lines
390 B
Go
Raw Permalink Normal View History

2018-12-20 17:35:26 +00:00
package plist
// NodeInt plist 现成的Int节点, 可以作为例子
type NodeInt struct {
Node
}
// Compare plist 现成的Int节点Compare覆盖
func (fl *NodeInt) Compare(v INode) bool {
return fl.GetValue().(int) > v.GetValue().(int)
}
// NewNodeInt plist 现成的Int节点, New一个NodeInt
func NewNodeInt(v int) (fl *NodeInt) {
fl = new(NodeInt)
fl.SetValue(v)
return fl
}