Documentation ¶
Index ¶
- type Generic
- func (g Generic) Delete(items ...SetObject)
- func (g Generic) Difference(g2 Generic) Generic
- func (g Generic) Equal(s2 Generic) bool
- func (g Generic) Has(item SetObject) bool
- func (g Generic) HasAll(items ...SetObject) bool
- func (g Generic) HasAny(items ...SetObject) bool
- func (g Generic) Insert(items ...SetObject)
- func (g Generic) Intersection(s2 Generic) Generic
- func (g Generic) IsSuperset(s2 Generic) bool
- func (g Generic) Len() int
- func (g Generic) List() []SetObject
- func (g Generic) ListKeys() []string
- func (g Generic) PopAny() (SetObject, bool)
- func (g Generic) Union(s2 Generic) Generic
- func (g Generic) UnsortedList() []SetObject
- func (g Generic) UnsortedListKeys() []string
- type SetObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generic ¶
func NewGeneric ¶
New creates a Generic from a list of values.
func (Generic) Difference ¶
Difference returns a set of objects that are not in s2 For example: s1 = {a1, a2, a3} s2 = {a1, a2, a4, a5} s1.Difference(s2) = {a3} s2.Difference(s1) = {a4, a5}
func (Generic) Equal ¶
Equal returns true if and only if s1 is equal (as a set) to s2. Two sets are equal if their membership is identical. (In practice, this means same elements, order doesn't matter)
func (Generic) Intersection ¶
Intersection returns a new set which includes the item in BOTH s1 and s2 For example: s1 = {a1, a2} s2 = {a2, a3} s1.Intersection(s2) = {a2}
func (Generic) IsSuperset ¶
IsSuperset returns true if and only if s1 is a superset of s2.
func (Generic) Union ¶
Union returns a new set which includes items in either s1 or s2. For example: s1 = {a1, a2} s2 = {a3, a4} s1.Union(s2) = {a1, a2, a3, a4} s2.Union(s1) = {a1, a2, a3, a4}
func (Generic) UnsortedList ¶
UnsortedList returns the slice with contents in random order.
func (Generic) UnsortedListKeys ¶
UnsortedList returns the slice with contents in random order.