tree

package module
v0.0.0-...-5d354f0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2017 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package tree provides a data structure of a mutable tree with constant leaves and version counters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalJSON

func MarshalJSON(tree Node) ([]byte, error)

func Move

func Move(dst, src *Slice)

Types

type Leaf

type Leaf struct {
	// contains filtered or unexported fields
}

func MakeLeaf

func MakeLeaf(value constant.Value) *Leaf

func (*Leaf) SetValue

func (l *Leaf) SetValue(value constant.Value)

func (*Leaf) Value

func (l *Leaf) Value() constant.Value

func (Leaf) Version

func (b Leaf) Version() int

type Map

type Map struct {
	// contains filtered or unexported fields
}

func MakeMap

func MakeMap() *Map

func (*Map) Delete

func (m *Map) Delete(key string)

func (*Map) MapIndex

func (m *Map) MapIndex(key string) Node

func (*Map) MapIndex2

func (m *Map) MapIndex2(key string) (Node, bool)

func (*Map) SetMapIndex

func (m *Map) SetMapIndex(key string, value Node)

func (Map) Version

func (b Map) Version() int

type Node

type Node interface {
	Version() int
	// contains filtered or unexported methods
}

func UnmarshalJSON

func UnmarshalJSON(b []byte) (Node, error)

type Slice

type Slice struct {
	// contains filtered or unexported fields
}

func MakeSlice

func MakeSlice(len, cap int) *Slice

func (*Slice) Append

func (s *Slice) Append(values ...Node) *Slice

func (*Slice) Index

func (s *Slice) Index(i int) Node

func (*Slice) SetIndex

func (s *Slice) SetIndex(i int, value Node)

func (*Slice) Slice

func (s *Slice) Slice(i, j int) *Slice

func (*Slice) Slice3

func (s *Slice) Slice3(i, j, k int) *Slice

func (Slice) Version

func (b Slice) Version() int

Jump to

Keyboard shortcuts

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