linktable

package
v1.4.1-beta5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkTable

type LinkTable[T any] struct {
	// contains filtered or unexported fields
}

func NewBoolLinkTable

func NewBoolLinkTable(value bool, size int, onSizeExceeded func(*LinkTable[bool])) *LinkTable[bool]

便捷函数 - 布尔链表

func NewFloat64LinkTable

func NewFloat64LinkTable(value float64, size int, onSizeExceeded func(*LinkTable[float64])) *LinkTable[float64]

便捷函数 - 浮点数链表

func NewIntLinkTable

func NewIntLinkTable(value int, size int, onSizeExceeded func(*LinkTable[int])) *LinkTable[int]

便捷函数 - 整数链表

func NewLinkTable

func NewLinkTable[T any](value T, size int, onSizeExceeded func(*LinkTable[T])) *LinkTable[T]

func NewStringLinkTable

func NewStringLinkTable(value string, size int, onSizeExceeded func(*LinkTable[string])) *LinkTable[string]

便捷函数 - 字符串链表

func NewUnlimitedBoolLinkTable

func NewUnlimitedBoolLinkTable(value bool) *LinkTable[bool]

func NewUnlimitedFloat64LinkTable

func NewUnlimitedFloat64LinkTable(value float64) *LinkTable[float64]

func NewUnlimitedIntLinkTable

func NewUnlimitedIntLinkTable(value int) *LinkTable[int]

func NewUnlimitedLinkTable

func NewUnlimitedLinkTable[T any](value T) *LinkTable[T]

NewUnlimitedLinkTable 创建一个无限容量的链表

func NewUnlimitedStringLinkTable

func NewUnlimitedStringLinkTable(value string) *LinkTable[string]

func (*LinkTable[T]) ForEach

func (l *LinkTable[T]) ForEach(fn func(T) bool)

添加遍历全部节点的便捷方法

func (*LinkTable[T]) Len

func (l *LinkTable[T]) Len() int

获取链表长度

func (*LinkTable[T]) Parent

func (l *LinkTable[T]) Parent() *LinkTable[T]

func (*LinkTable[T]) Push

func (l *LinkTable[T]) Push(value T)

func (*LinkTable[T]) ToSlice

func (l *LinkTable[T]) ToSlice() []T

获取所有值的切片

func (*LinkTable[T]) Value

func (l *LinkTable[T]) Value() T

Jump to

Keyboard shortcuts

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