Documentation
¶
Index ¶
- type SetMatrix
- func (s *SetMatrix[K, V]) Cardinality(key K) (cardinality int, ok bool)
- func (s *SetMatrix[K, V]) Contains(key K, value V) (containsElement, setExists bool)
- func (s *SetMatrix[K, V]) Get(key K) ([]V, bool)
- func (s *SetMatrix[K, V]) Insert(key K, value V) (inserted bool, cardinality int)
- func (s *SetMatrix[K, V]) Keys() []K
- func (s *SetMatrix[K, V]) Remove(key K, value V) (removed bool, cardinality int)
- func (s *SetMatrix[K, V]) String(key K) (v string, ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetMatrix ¶
type SetMatrix[K, V comparable] struct { // contains filtered or unexported fields }
SetMatrix is a map of Sets. The zero value is an empty set matrix ready to use.
SetMatrix values are safe for concurrent use.
func (*SetMatrix[K, V]) Cardinality ¶
Cardinality returns the number of elements in the set for a key.
func (*SetMatrix[K, V]) Contains ¶
Contains is used to verify if an element is in a set for a specific key.
func (*SetMatrix[K, V]) Insert ¶
Insert inserts the value in the set of a key and returns whether the value is inserted (was not already in the set) and the number of elements in the set.
func (*SetMatrix[K, V]) Keys ¶
func (s *SetMatrix[K, V]) Keys() []K
Keys returns all the keys in the map.
Click to show internal directories.
Click to hide internal directories.