concurrenthashmap

package
v0.0.0-...-a261c41 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentHashMap

type ConcurrentHashMap[T comparable, V comparable] struct {
	// contains filtered or unexported fields
}

func NewConcurrentHashMap

func NewConcurrentHashMap[T comparable, V comparable]() *ConcurrentHashMap[T, V]

创建一个新的并发安全的哈希表

func (*ConcurrentHashMap[T, V]) Delete

func (h *ConcurrentHashMap[T, V]) Delete(key T) bool

删除并发安全的哈希表中指定键的键值对

func (*ConcurrentHashMap[T, V]) Get

func (h *ConcurrentHashMap[T, V]) Get(key T) (V, bool)

根据键获取并发安全的哈希表中对应的值

func (*ConcurrentHashMap[T, V]) Put

func (h *ConcurrentHashMap[T, V]) Put(key T, value V)

将键值对添加到并发安全的哈希表中

func (*ConcurrentHashMap[T, V]) Size

func (h *ConcurrentHashMap[T, V]) Size() int

返回并发安全的哈希表中元素的数量

func (*ConcurrentHashMap[T, V]) String

func (h *ConcurrentHashMap[T, V]) String() string

实现fmt.Stringer接口,将并发安全的哈希表转换为字符串表示形式

Jump to

Keyboard shortcuts

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