Documentation ¶
Index ¶
- type SetMatrix
- func (s *SetMatrix[T]) Cardinality(key string) (cardinality int, ok bool)
- func (s *SetMatrix[T]) Contains(key string, value T) (containsElement, setExists bool)
- func (s *SetMatrix[T]) Get(key string) ([]T, bool)
- func (s *SetMatrix[T]) Insert(key string, value T) (inserted bool, cardinality int)
- func (s *SetMatrix[T]) Keys() []string
- func (s *SetMatrix[T]) Remove(key string, value T) (removed bool, cardinality int)
- func (s *SetMatrix[T]) String(key string) (v string, ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetMatrix ¶
type SetMatrix[T 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[T]) Cardinality ¶
Cardinality returns the number of elements in the set for a key.
func (*SetMatrix[T]) Contains ¶
Contains is used to verify if an element is in a set for a specific key.
func (*SetMatrix[T]) 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.
Click to show internal directories.
Click to hide internal directories.