Documentation
¶
Index ¶
- type Interface
- type Set
- func (s *Set) Add(elem interface{})
- func (s *Set) Contains(elem interface{}) bool
- func (s *Set) CopyTo(other Interface)
- func (s *Set) FromSlice(input []interface{})
- func (s *Set) Intersection(other Interface) Interface
- func (s *Set) IsSubsetOf(other Interface) bool
- func (s *Set) IsSupersetOf(other Interface) bool
- func (s *Set) Remove(elem interface{})
- func (s *Set) Size() int
- func (s *Set) ToSlice() []interface{}
- func (s *Set) Union(other Interface) Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface {
// Add element to the set
Add(interface{})
//Remove element from the set
Remove(interface{})
// CopyTo another set
CopyTo(other Interface)
// Returns the union set with other set
Union(other Interface) Interface
// Returns the intersection set with other set
Intersection(other Interface) Interface
// Is current set subset (contained in) of the provided set
IsSubsetOf(other Interface) bool
// Is current set superset of the provided set
IsSupersetOf(other Interface) bool
// Returns true if set contains the element, -1, false otherwise
Contains(interface{}) bool
// Size of the set
Size() int
// Creates a slice from the set
ToSlice() []interface{}
// Initializes the set from slice
FromSlice([]interface{})
}
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is implementation of set.Interface Comparisons to match elements are based on KeyFunc
func (*Set) Intersection ¶
func (*Set) IsSubsetOf ¶
func (*Set) IsSupersetOf ¶
Click to show internal directories.
Click to hide internal directories.