chained

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashMap

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

HashMap represents a closed hashing hashtable implementation

func NewHashMap

func NewHashMap(size uint) *HashMap

NewHashMap returns a new HashMap instantiated with the specified size or the defaultMapSize, whichever is larger

func (*HashMap) Close

func (m *HashMap) Close()

Close closes and frees the current hashmap. Calling any method on the HashMap after this will most likely result in a panic

func (*HashMap) Del

func (m *HashMap) Del(key keyType) (valType, bool)

Del removes a value for a given key and returns the deleted value, or false Del can be considered the exported version of the delete call

func (*HashMap) Get

func (m *HashMap) Get(key keyType) (valType, bool)

Get returns a value for a given key, or returns false if none could be found Get can be considered the exported version of the lookup call

func (*HashMap) Len

func (m *HashMap) Len() int

Len returns the number of entries currently in the HashMap

func (*HashMap) PercentFull

func (m *HashMap) PercentFull() float64

PercentFull returns the current load factor of the HashMap

func (*HashMap) Put

func (m *HashMap) Put(key keyType, value valType) (valType, bool)

Put inserts a key value entry and returns the previous value or false Put can be considered the exported version of the insert call

func (*HashMap) Range

func (m *HashMap) Range(it Iterator)

Range takes an Iterator and ranges the HashMap as long as long as the iterator function continues to be true. Range is not safe to perform an insert or remove operation while ranging!

type Iterator

type Iterator func(key keyType, value valType) bool

Iterator is an iterator function type

type ShardedHashMap

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

func NewShardedHashMap

func NewShardedHashMap(size uint) *ShardedHashMap

NewShardedHashMap returns a new hashMap instantiated with the specified size or the defaultMapSize, whichever is larger

func (*ShardedHashMap) Close

func (s *ShardedHashMap) Close()

func (*ShardedHashMap) Del

func (s *ShardedHashMap) Del(key keyType) (valType, bool)

func (*ShardedHashMap) Get

func (s *ShardedHashMap) Get(key keyType) (valType, bool)

func (*ShardedHashMap) Len

func (s *ShardedHashMap) Len() int

func (*ShardedHashMap) Put

func (s *ShardedHashMap) Put(key keyType, val valType) (valType, bool)

func (*ShardedHashMap) Range

func (s *ShardedHashMap) Range(it Iterator)

func (*ShardedHashMap) Stats

func (s *ShardedHashMap) Stats()

Jump to

Keyboard shortcuts

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