set

package
v0.0.0-...-f53f79a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2019 License: MIT, GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSet

func IsSet(value interface{}) bool

func IsSuperset

func IsSuperset(one Set, other Set) bool

判断集合 one 是否是集合 other 的超集

Types

type HashSet

type HashSet struct {
	// contains filtered or unexported fields
}

func NewHashSet

func NewHashSet() *HashSet

func (*HashSet) Add

func (set *HashSet) Add(e interface{}) bool

func (*HashSet) Clear

func (set *HashSet) Clear()

func (*HashSet) Contains

func (set *HashSet) Contains(e interface{}) bool

func (*HashSet) Elements

func (set *HashSet) Elements() []interface{}

func (*HashSet) Len

func (set *HashSet) Len() int

func (*HashSet) Remove

func (set *HashSet) Remove(e interface{})

func (*HashSet) Same

func (set *HashSet) Same(other Set) bool

func (*HashSet) String

func (set *HashSet) String() string

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 Difference

func Difference(one Set, other Set) Set

生成集合 one 对集合 other 的差集

func Intersect

func Intersect(one Set, other Set) Set

生成集合 one 和集合 other 的交集

func NewSimpleSet

func NewSimpleSet() Set

func SymmetricDifference

func SymmetricDifference(one Set, other Set) Set

生成集合 one 和集合 other 的对称差集

func Union

func Union(one Set, other Set) Set

生成集合 one 和集合 other 的并集

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL