Documentation ¶
Index ¶
- type Set
- func (s *Set) Add(key string)
- func (s *Set) Cardinality() uint64
- func (s *Set) Contains(key string) bool
- func (s *Set) Difference(other *Set) *Set
- func (s *Set) Intersection(other *Set) *Set
- func (s *Set) IsEmpty() bool
- func (s *Set) Remove(key string)
- func (s *Set) String() string
- func (s *Set) Subset(condition func(string) bool) *Set
- func (s *Set) Union(other *Set) *Set
- func (s *Set) Values() []string
- func (s *Set) Visit(fn func(string))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a wrapper around a hash table containing the actual items. To make it easy, items must be strings in this example so it conforms to my simple hash table structure.
func (*Set) Cardinality ¶
Cardinality returns the number of items in the set.
func (*Set) Difference ¶
Difference returns a new set containing its items that the other set does not contain.
func (*Set) Intersection ¶
Intersection returns a new set containing the values that overlap between both sets.
Click to show internal directories.
Click to hide internal directories.