hierarchy

package
v0.0.0-...-157c9c8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hierarchy

type Hierarchy[ID constraints.Integer, Name comparable] struct {
	*bimap.Bimap[Key[ID, Name], ID]
	Children map[ID]*lset.Set[Name]
	MaxID    ID
}

func New

func New[ID constraints.Integer, Name comparable](size int) *Hierarchy[ID, Name]

func (*Hierarchy[ID, Name]) Get

func (h *Hierarchy[ID, Name]) Get(path []Name, create bool) (id ID, found bool)

func (*Hierarchy[ID, Name]) Key

func (h *Hierarchy[ID, Name]) Key(id ID, name Name, create bool) (ID, bool)

type Key

type Key[ID, Name comparable] struct {
	ID   ID
	Name Name
}

Jump to

Keyboard shortcuts

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