set

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSuperset

func IsSuperset(set, other Set) bool

超集

Types

type HashSet

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

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 NewSet

func NewSet(items ...interface{}) Set

Jump to

Keyboard shortcuts

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