id

package
v0.0.0-...-20810c9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

type Area[From constraints.Unsigned, To constraints.Unsigned] struct {
	// contains filtered or unexported fields
}

func NewArea

func NewArea[From constraints.Unsigned, To constraints.Unsigned](opts ...Option) *Area[From, To]

func (*Area[From, To]) Clear

func (a *Area[From, To]) Clear()

func (Area[From, To]) Empty

func (a Area[From, To]) Empty() bool

func (Area[From, To]) Has

func (a Area[From, To]) Has(from From) bool

func (Area[From, To]) Len

func (a Area[From, To]) Len() int

func (*Area[From, To]) Peek

func (a *Area[From, To]) Peek(from From) int

func (*Area[From, To]) Remove

func (a *Area[From, To]) Remove(from From, maintainOrder bool) int

func (*Area[From, To]) Translate

func (a *Area[From, To]) Translate(from From) To

type DenseKeyMap

type DenseKeyMap[V any, A constraints.Unsigned, L constraints.Unsigned] struct {
	// contains filtered or unexported fields
}

func NewDenseKeyMap

func NewDenseKeyMap[V any, A constraints.Unsigned, L constraints.Unsigned](opts ...Option) DenseKeyMap[V, A, L]

func (*DenseKeyMap[V, A, L]) Clear

func (m *DenseKeyMap[V, A, L]) Clear()

func (DenseKeyMap[V, A, L]) Empty

func (m DenseKeyMap[V, A, L]) Empty() bool

func (*DenseKeyMap[V, A, L]) Get

func (m *DenseKeyMap[V, A, L]) Get(key Identifier) V

func (*DenseKeyMap[V, A, L]) Has

func (m *DenseKeyMap[V, A, L]) Has(key Identifier) bool

func (DenseKeyMap[V, A, L]) Keys

func (m DenseKeyMap[V, A, L]) Keys() []Identifier

func (DenseKeyMap[V, A, L]) Len

func (m DenseKeyMap[V, A, L]) Len() int

func (*DenseKeyMap[V, A, L]) Merge

func (m *DenseKeyMap[V, A, L]) Merge(other DenseKeyMap[V, A, L], replace bool, isMissing func(V) bool)

func (*DenseKeyMap[V, A, L]) Ptr

func (m *DenseKeyMap[V, A, L]) Ptr(key Identifier) *V

func (*DenseKeyMap[V, A, L]) Remove

func (m *DenseKeyMap[V, A, L]) Remove(key Identifier, maintainOrder bool) bool

func (*DenseKeyMap[V, A, L]) Set

func (m *DenseKeyMap[V, A, L]) Set(key Identifier, value V)

func (*DenseKeyMap[V, A, L]) SetKeyValues

func (m *DenseKeyMap[V, A, L]) SetKeyValues(kv []KeyValue[V])

func (*DenseKeyMap[V, A, L]) SetMap

func (s *DenseKeyMap[V, A, L]) SetMap(m map[Identifier]V)

func (*DenseKeyMap[V, A, L]) SetStringMap

func (s *DenseKeyMap[V, A, L]) SetStringMap(m map[string]V)

func (*DenseKeyMap[V, A, L]) Take

func (m *DenseKeyMap[V, A, L]) Take(key Identifier) *V

func (DenseKeyMap[V, A, L]) Values

func (m DenseKeyMap[V, A, L]) Values() []V

type DenseMap

type DenseMap[V any, A constraints.Unsigned, L constraints.Unsigned] struct {
	// contains filtered or unexported fields
}

func NewDenseMap

func NewDenseMap[V any, A constraints.Unsigned, L constraints.Unsigned](opts ...Option) DenseMap[V, A, L]

func (*DenseMap[V, A, L]) Clear

func (m *DenseMap[V, A, L]) Clear()

func (DenseMap[V, A, L]) Empty

func (m DenseMap[V, A, L]) Empty() bool

func (*DenseMap[V, A, L]) Get

func (m *DenseMap[V, A, L]) Get(key Identifier) V

func (*DenseMap[V, A, L]) Has

func (m *DenseMap[V, A, L]) Has(key Identifier) bool

func (DenseMap[V, A, L]) Len

func (m DenseMap[V, A, L]) Len() int

func (*DenseMap[V, A, L]) Ptr

func (m *DenseMap[V, A, L]) Ptr(key Identifier) *V

func (*DenseMap[V, A, L]) Remove

func (m *DenseMap[V, A, L]) Remove(key Identifier, maintainOrder bool) bool

func (*DenseMap[V, A, L]) Set

func (m *DenseMap[V, A, L]) Set(key Identifier, value V)

func (*DenseMap[V, A, L]) SetKeyValues

func (m *DenseMap[V, A, L]) SetKeyValues(kv []KeyValue[V])

func (*DenseMap[V, A, L]) SetMap

func (s *DenseMap[V, A, L]) SetMap(m map[Identifier]V)

func (*DenseMap[V, A, L]) SetStringMap

func (s *DenseMap[V, A, L]) SetStringMap(m map[string]V)

func (*DenseMap[V, A, L]) Take

func (m *DenseMap[V, A, L]) Take(key Identifier) *V

func (DenseMap[V, A, L]) Values

func (m DenseMap[V, A, L]) Values() []V

type HasArea

type HasArea[A any] interface {
	// contains filtered or unexported methods
}

type HasCapacity

type HasCapacity interface {
	// contains filtered or unexported methods
}

type HasResizeBuffer

type HasResizeBuffer interface {
	// contains filtered or unexported methods
}

type HasSet

type HasSet[V any] interface {
	Set(key Identifier, value V)
}

type Identifier

type Identifier int32
const (
	None  Identifier = -1
	Empty Identifier = 0
)

func Get

func Get(s string) Identifier

Returns the identifier for the given string.

func Lower

func Lower(s string) Identifier

Returns the identifier for the lowercase version of the given string.

func Maybe

func Maybe(s string) Identifier

Returns an identifier and if the string has not been added as one then -1 is returned.

func (Identifier) Empty

func (i Identifier) Empty() bool

func (Identifier) Exists

func (i Identifier) Exists() bool

func (Identifier) String

func (i Identifier) String() string

type KeyValue

type KeyValue[V any] struct {
	Key   Identifier
	Value V
}

type LargeArea

type LargeArea = Area[uint32, uint32]

type MediumArea

type MediumArea = Area[uint32, uint16]

type Option

type Option func(optionable any)

func WithArea

func WithArea[A any](area *A) Option

func WithCapacity

func WithCapacity(capacity int) Option

func WithKeyValues

func WithKeyValues[V any](kv []KeyValue[V]) Option

func WithMap

func WithMap[V any](m map[Identifier]V) Option

func WithResizeBuffer

func WithResizeBuffer(resizeBuffer int) Option

func WithStringMap

func WithStringMap[V any](m map[string]V) Option

type SmallArea

type SmallArea = Area[uint32, uint8]

type SparseMap

type SparseMap[V any, SID constraints.Unsigned] struct {
	// contains filtered or unexported fields
}

func NewSparseMap

func NewSparseMap[V any, SID constraints.Unsigned](opts ...Option) SparseMap[V, SID]

func (SparseMap[V, SID]) Empty

func (m SparseMap[V, SID]) Empty() bool

func (*SparseMap[V, SID]) Get

func (m *SparseMap[V, SID]) Get(key Identifier) V

func (*SparseMap[V, SID]) Has

func (m *SparseMap[V, SID]) Has(key Identifier) bool

func (SparseMap[V, SID]) Len

func (m SparseMap[V, SID]) Len() int

func (*SparseMap[V, SID]) Ptr

func (m *SparseMap[V, SID]) Ptr(key Identifier) *V

func (*SparseMap[V, SID]) Set

func (m *SparseMap[V, SID]) Set(key Identifier, value V)

func (*SparseMap[V, SID]) SetKeyValues

func (m *SparseMap[V, SID]) SetKeyValues(kv []KeyValue[V])

func (*SparseMap[V, SID]) SetMap

func (s *SparseMap[V, SID]) SetMap(m map[Identifier]V)

func (*SparseMap[V, SID]) SetStringMap

func (s *SparseMap[V, SID]) SetStringMap(m map[string]V)

func (*SparseMap[V, SID]) Take

func (m *SparseMap[V, SID]) Take(key Identifier) *V

func (SparseMap[V, SID]) Values

func (m SparseMap[V, SID]) Values() []V

Jump to

Keyboard shortcuts

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