hashmap

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

可以指定比较函数的HashMap. go语言内置的map要求key类型支持==和!=运算符, 有时候不能满足我们的要求.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EqualFunc

type EqualFunc func(a, b interface{}) bool

type HashFunc

type HashFunc func(interface{}) uint32

type HashMap

type HashMap struct {
	// contains filtered or unexported fields
}

func NewHashMap

func NewHashMap(hashFunc HashFunc, equalFunc EqualFunc) *HashMap

func (*HashMap) Delete

func (this *HashMap) Delete(k interface{}) (interface{}, bool)

func (*HashMap) Find

func (this *HashMap) Find(k interface{}) (interface{}, bool)

func (*HashMap) Init

func (this *HashMap) Init(hashFunc HashFunc, equalFunc EqualFunc)

func (*HashMap) Insert

func (this *HashMap) Insert(k, v interface{}) (*Node, bool)

func (*HashMap) Len

func (this *HashMap) Len() int

type Node

type Node struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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