set

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands() []internal.Command

Types

type Set

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

func Intersection

func Intersection(limit int, sets ...*Set) (*Set, bool)

The Intersection accepts limit parameter of type int and a list of sets whose intersects are to be calculated. When limit is greater than 0, then the calculation will stop once the intersect cardinality reaches limit without calculating the full intersect.

func NewSet

func NewSet(elems []string) *Set

func Union

func Union(sets ...*Set) *Set

Union takes a slice of sets and generates a union

func (*Set) Add

func (set *Set) Add(elems []string) int

func (*Set) Cardinality

func (set *Set) Cardinality() int

func (*Set) Contains

func (set *Set) Contains(e string) bool

func (*Set) Get

func (set *Set) Get(e string) interface{}

func (*Set) GetAll

func (set *Set) GetAll() []string

func (*Set) GetRandom

func (set *Set) GetRandom(count int) []string

func (*Set) Move

func (set *Set) Move(destination *Set, e string) int

func (*Set) Pop

func (set *Set) Pop(count int) []string

func (*Set) Remove

func (set *Set) Remove(elems []string) int

func (*Set) Subtract

func (set *Set) Subtract(others []*Set) *Set

Subtract received a list of sets and finds the difference between sets provided

Jump to

Keyboard shortcuts

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