Documentation ¶
Overview ¶
Package datastructure implements some data structure. hashmap structure.
Index ¶
- type HashMap
- func (hm *HashMap) Contains(key any) bool
- func (hm *HashMap) Delete(key any)
- func (hm *HashMap) Get(key any) any
- func (hm *HashMap) GetOrDefault(key any, defaultValue any) any
- func (hm *HashMap) Iterate(iteratee func(key, value any))
- func (hm *HashMap) Keys() []any
- func (hm *HashMap) Put(key any, value any)
- func (hm *HashMap) Values() []any
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 implements a hash map
func NewHashMapWithCapacity ¶
NewHashMapWithCapacity return a HashMap instance with given size and capacity
func (*HashMap) GetOrDefault ¶ added in v2.2.5
GetOrDefault return the value of given key in hashmap, if not found return default value
func (*HashMap) Iterate ¶ added in v2.1.7
Iterate executes iteratee funcation for every key and value pair of hashmap (random order)
Click to show internal directories.
Click to hide internal directories.