maputils

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FixedMap

type FixedMap[KeyT KeyType, ValueT ValueType] struct {
	// contains filtered or unexported fields
}

FixedMap TODO 解决已存在元素不能按顺序弹出的问题

func NewFixedMap

func NewFixedMap[KeyT KeyType, ValueT ValueType](maxSize int) *FixedMap[KeyT, ValueT]

func (*FixedMap[KeyT, ValueT]) Get

func (this *FixedMap[KeyT, ValueT]) Get(key KeyT) (value ValueT, ok bool)

func (*FixedMap[KeyT, ValueT]) Has

func (this *FixedMap[KeyT, ValueT]) Has(key KeyT) bool

func (*FixedMap[KeyT, ValueT]) Keys

func (this *FixedMap[KeyT, ValueT]) Keys() []KeyT

func (*FixedMap[KeyT, ValueT]) Put

func (this *FixedMap[KeyT, ValueT]) Put(key KeyT, value ValueT)

func (*FixedMap[KeyT, ValueT]) RawMap

func (this *FixedMap[KeyT, ValueT]) RawMap() map[KeyT]ValueT

type KeyType

type KeyType interface {
	string | int | int64 | int32 | uint64 | uint32
}

type ValueType

type ValueType interface {
	any
}

Jump to

Keyboard shortcuts

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