Documentation ¶
Index ¶
- type HashMultiMap
- func (s *HashMultiMap[K, V]) Clear()
- func (s *HashMultiMap[K, V]) Contains(key K) bool
- func (s *HashMultiMap[K, V]) ContainsAll(keys ...K) bool
- func (s *HashMultiMap[K, V]) ContainsAny(keys ...K) bool
- func (s *HashMultiMap[K, V]) GetKeys() []K
- func (s *HashMultiMap[K, V]) GetValues(key K) []V
- func (s *HashMultiMap[K, V]) IsEmpty() bool
- func (s *HashMultiMap[K, V]) Merge(maps ...*HashMultiMap[K, V])
- func (s *HashMultiMap[K, V]) Put(key K, value V)
- func (s *HashMultiMap[K, V]) PutAll(key K, values ...V)
- func (s *HashMultiMap[K, V]) Remove(key K, value V)
- func (s *HashMultiMap[K, V]) RemoveKey(keys ...K)
- func (s *HashMultiMap[K, V]) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashMultiMap ¶
type HashMultiMap[K, V comparable] struct { // contains filtered or unexported fields }
HashMultiMap a data structure representing a map of keys with lists of values
func New ¶
func New[K, V comparable]() *HashMultiMap[K, V]
New factory that creates a new Hash Multi Map
func (*HashMultiMap[K, V]) Contains ¶
func (s *HashMultiMap[K, V]) Contains(key K) bool
Contains checks if a key is in the multi map
func (*HashMultiMap[K, V]) ContainsAll ¶
func (s *HashMultiMap[K, V]) ContainsAll(keys ...K) bool
ContainsAll checks if all keys are in the multi map
func (*HashMultiMap[K, V]) ContainsAny ¶
func (s *HashMultiMap[K, V]) ContainsAny(keys ...K) bool
ContainsAny checks if any keys are in the multi map
func (*HashMultiMap[K, V]) GetKeys ¶
func (s *HashMultiMap[K, V]) GetKeys() []K
GetKeys returns a list of the multi map's keys
func (*HashMultiMap[K, V]) GetValues ¶
func (s *HashMultiMap[K, V]) GetValues(key K) []V
GetValues returns values associated with the key
func (*HashMultiMap[K, V]) IsEmpty ¶
func (s *HashMultiMap[K, V]) IsEmpty() bool
IsEmpty checks if the multiMap is empty
func (*HashMultiMap[K, V]) Merge ¶
func (s *HashMultiMap[K, V]) Merge(maps ...*HashMultiMap[K, V])
Merge merge multiple multi maps
func (*HashMultiMap[K, V]) Put ¶
func (s *HashMultiMap[K, V]) Put(key K, value V)
Put key/value pair to the multi map
func (*HashMultiMap[K, V]) PutAll ¶
func (s *HashMultiMap[K, V]) PutAll(key K, values ...V)
PutAll put key/values to the multi map
func (*HashMultiMap[K, V]) Remove ¶
func (s *HashMultiMap[K, V]) Remove(key K, value V)
Remove removes a value from a key's values
func (*HashMultiMap[K, V]) RemoveKey ¶
func (s *HashMultiMap[K, V]) RemoveKey(keys ...K)
RemoveKey removes a key and all its values
func (*HashMultiMap[K, V]) Size ¶
func (s *HashMultiMap[K, V]) Size() int
Size returns size of the multiMap