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) FilterByValue(perdicate func(value any) bool) *HashMap
- 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) Size() uint64
- 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) FilterByValue ¶
FilterByValue returns a filtered HashMap. If any value is not matching the perdicate function then it returns nil otherwise it returns the HashMap with selected values.
func (*HashMap) GetOrDefault ¶
GetOrDefault return the value of given key in hashmap, if not found return default value
func (*HashMap) Iterate ¶
Iterate executes iteratee funcation for every key and value pair of hashmap (random order)
Click to show internal directories.
Click to hide internal directories.