tree

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeCreator

type NodeCreator func(common.History, common.NameVersion) Object

type Object

type Object interface {
	common.HistorySource
	IsNode() *common.NameVersion
}

type Objects

type Objects []Object

func ObjectSlice

func ObjectSlice(s data.Iterable) Objects

func (Objects) Get

func (o Objects) Get(i int) interface{}

func (Objects) Iterator

func (o Objects) Iterator() data.Iterator

func (Objects) Len

func (o Objects) Len() int

type TreeNode

type TreeNode struct {
	common.NameVersion
	History  common.History
	CausedBy Object // the object causing the synthesized node to be inserted
}

type TreeObject

type TreeObject struct {
	Graph  string
	Object Object
	Node   *TreeNode // for synthesized nodes this entry is used if no object can be synthesized
}

TreeObject is an element enriched by a textual tree graph prefix line.

func (*TreeObject) String

func (t *TreeObject) String() string

type TreeObjects

type TreeObjects []*TreeObject

func MapToTree

func MapToTree(objs Objects, creator NodeCreator, symbols ...string) TreeObjects

MapToTree maps a list of elements featuring a resolution history into a list of elements providing an ascii tree graph field Intermediate nodes are synthesized, so only leaf elements are required. If an element should act as explicit node, it must state to be a node, in this case the node will be tagged with the nodeSymbol. If this is not desired, pass an empty symbol string.

func (TreeObjects) Get

func (o TreeObjects) Get(i int) interface{}

func (TreeObjects) Iterator

func (o TreeObjects) Iterator() data.Iterator

func (TreeObjects) Len

func (o TreeObjects) Len() int

func (TreeObjects) String added in v0.16.0

func (o TreeObjects) String() string

type Typed

type Typed interface {
	GetKind() string
}

type ValidTreeElement

type ValidTreeElement interface {
	IsValid() bool
}

Jump to

Keyboard shortcuts

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