set

package
v0.4.43 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package set provide many useful methods to deal with set Deprecated: please use new set (instead of current deprecated aset)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

func Intersection

func Intersection(sets ...*Set) *Set

Intersection 返回若干个 set 的交集

func New

func New(initial ...interface{}) *Set

New Create a new set

func NewFromString

func NewFromString(list []string) *Set

func (*Set) All

func (s *Set) All() []interface{}

func (*Set) Difference

func (s *Set) Difference(set *Set) *Set

Difference Find the difference between two sets 返回的是自己存在而传入的 set 不存在的元素集合

func (*Set) Do

func (s *Set) Do(f func(interface{}))

Do Call f for each item in the set

func (*Set) DoE

func (s *Set) DoE(f func(interface{}) error) error

DoE Call f for each item in the set

func (*Set) Has

func (s *Set) Has(element interface{}) bool

Has Test to see whether or not the element is in the set

func (*Set) Insert

func (s *Set) Insert(elements ...interface{})

Insert Add element(s) to the set

func (*Set) Intersection

func (s *Set) Intersection(set *Set) *Set

Intersection Find the intersection of two sets

func (*Set) Len

func (s *Set) Len() int

Len Return the number of items in the set

func (*Set) ProperSubsetOf

func (s *Set) ProperSubsetOf(set *Set) bool

ProperSubsetOf Test whether or not this set is a proper subset of "set"

func (*Set) Remove

func (s *Set) Remove(element interface{})

Remove an element from the set

func (*Set) SubsetOf

func (s *Set) SubsetOf(set *Set) bool

SubsetOf Test whether or not this set is a subset of "set"

func (*Set) ToStringList

func (s *Set) ToStringList() ([]string, bool)

func (*Set) Union

func (s *Set) Union(set *Set) *Set

Union Find the union of two sets

Jump to

Keyboard shortcuts

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