sets

package
v0.0.0-...-471d277 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: Apache-2.0 Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapSet

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

Map based Set implementation

func (*MapSet) Add

func (s *MapSet) Add(elem string)

Add an element to the Set

func (*MapSet) Contains

func (s *MapSet) Contains(elem string) bool

Checks for an existence of an element

func (*MapSet) Equal

func (s *MapSet) Equal(another Set) bool

Equal another Set

func (*MapSet) Intersect

func (s *MapSet) Intersect(another Set) Set

Intersect another Set to this Set and returns that

func (*MapSet) IsSupersetOf

func (s *MapSet) IsSupersetOf(another Set) bool

IsSupersetOf another Set

func (*MapSet) Remove

func (s *MapSet) Remove(elem string) bool

Remove an element if it exists in the Set Returns if the value was present and removed

func (*MapSet) Size

func (s *MapSet) Size() int

Size of the set

func (*MapSet) Union

func (s *MapSet) Union(another Set) Set

Union another Set to this set and returns that

func (*MapSet) Values

func (s *MapSet) Values() []string

Values of the underlying set

type Set

type Set interface {
	Contains(elem string) bool
	Add(elem string)
	Union(another Set) Set
	Intersect(another Set) Set
	IsSupersetOf(another Set) bool
	Equal(another Set) bool
	Size() int
	Remove(elem string) bool
	Values() []string
}

Set datastructure for strings

func Empty

func Empty() Set

Empty set of strings

func FromSlice

func FromSlice(slice []string) Set

Creates a new Set from a slice of strings

Jump to

Keyboard shortcuts

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