array

package
v0.0.0-...-25a2715 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(src interface{}, arr interface{}) interface{}

Append defined slice append func

Types

type MapSet

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

MapSet 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

Contains defined 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

FromSlice defined 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