node

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxIndex = 1<<29 - 1

Variables

This section is empty.

Functions

func Label

func Label(offset, child Index) word.Code

Label : returns c such that offset.Forward(c) == child

Types

type Index

type Index uint32

func (Index) Backward

func (x Index) Backward(c word.Code) Index

Backword : returns x such that x == offset.Forward(c)

func (Index) Forward

func (x Index) Forward(c word.Code) Index

func (Index) Generate

func (x Index) Generate(r *rand.Rand, size int) reflect.Value

type Interface

type Interface interface {
	GetOffset() Index
	SetOffset(Index)

	Terminate()
	IsTerminal() bool

	SetParent(Index)
	IsChildOf(Index) bool

	GetChild(word.Code) Index

	IsUsed() bool

	GetNextEmptyNode() (Index, error)
	GetPrevEmptyNode() (Index, error)
	SetNextEmptyNode(Index) error
	SetPrevEmptyNode(Index) error

	Reset(int)
	String() string
}

type Node

type Node uint64

func New

func New(i int) Node

func Root

func Root() Node

func (Node) Generate

func (x Node) Generate(r *rand.Rand, size int) reflect.Value

func (Node) GetChild

func (x Node) GetChild(label word.Code) Index

func (Node) GetNextEmptyNode

func (x Node) GetNextEmptyNode() (Index, error)

func (Node) GetOffset

func (x Node) GetOffset() Index

func (Node) GetParent

func (x Node) GetParent() Index

func (Node) GetPrevEmptyNode

func (x Node) GetPrevEmptyNode() (Index, error)

func (Node) HasOffset

func (x Node) HasOffset() bool

func (Node) HasParent

func (x Node) HasParent() bool

func (Node) IsChildOf

func (x Node) IsChildOf(parent Index) bool

func (Node) IsTerminal

func (x Node) IsTerminal() bool

func (Node) IsUsed

func (x Node) IsUsed() bool

func (Node) MarshalBinary

func (x Node) MarshalBinary() ([]byte, error)

func (*Node) Reset

func (x *Node) Reset(i int)

func (*Node) SetNextEmptyNode

func (x *Node) SetNextEmptyNode(i Index) error

func (*Node) SetOffset

func (x *Node) SetOffset(i Index)

func (*Node) SetParent

func (x *Node) SetParent(i Index)

func (*Node) SetPrevEmptyNode

func (x *Node) SetPrevEmptyNode(i Index) error

func (Node) String

func (x Node) String() string

func (*Node) Terminate

func (x *Node) Terminate()

func (*Node) UnmarshalBinary

func (x *Node) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL