Documentation ¶
Index ¶
- func IsSet(value interface{}) bool
- func IsSuperset(one Set, other Set) bool
- type HashSet
- func (set *HashSet) Add(e interface{}) bool
- func (set *HashSet) Clear()
- func (set *HashSet) Contains(e interface{}) bool
- func (set *HashSet) Elements() []interface{}
- func (set *HashSet) Len() int
- func (set *HashSet) Range(callback func(element interface{}))
- func (set *HashSet) Remove(e interface{})
- func (set *HashSet) Same(other Set) bool
- func (set *HashSet) String() string
- type Set
- type StringList
- type StringSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HashSet ¶
type HashSet struct {
// contains filtered or unexported fields
}
func NewHashSet ¶
func NewHashSet() *HashSet
type Set ¶
type Set interface { Add(e interface{}) bool Remove(e interface{}) Clear() Contains(e interface{}) bool Len() int Same(other Set) bool Elements() []interface{} String() string }
func NewSimpleSet ¶
func NewSimpleSet() Set
func SymmetricDifference ¶
生成集合 one 和集合 other 的对称差集
type StringList ¶
type StringList []string
StringList is a list of string (slice)
func (*StringList) Append ¶
func (sl *StringList) Append(elem string)
Append add the string to the end of StringList
func (*StringList) Find ¶
func (sl *StringList) Find(s string) int
Find get the index of string in StringList, returns -1 if not found
func (*StringList) Remove ¶
func (sl *StringList) Remove(elem string)
Remove removes the string from StringList
type StringSet ¶
type StringSet map[string]struct{}
StringSet is a collection of strings
Click to show internal directories.
Click to hide internal directories.