set

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package set provides a built-in implementation of a generic set

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T0

type T0 string

T0 is a generic type variable placeholder of a set element. It will not appear in the generated code

type T0Set

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

T0Set represents a set of T0 elements

func NewT0Set

func NewT0Set(vals ...T0) *T0Set

NewT0Set creates an instance of T0Set filled with provided elements

func (*T0Set) Add

func (s *T0Set) Add(vals ...T0)

Add adds an element to a set

func (*T0Set) All

func (s *T0Set) All() <-chan T0

All returns a channel iterator over this set

func (*T0Set) Contains

func (s *T0Set) Contains(x T0) bool

Contains checks if a given element belongs to a set

func (*T0Set) Intersect

func (s *T0Set) Intersect(y *T0Set) *T0Set

Intersect finds intersection of y and this set

func (*T0Set) Len

func (s *T0Set) Len() int

Len returns elements number in the set

func (*T0Set) Remove

func (s *T0Set) Remove(x T0)

Remove removes an element from a set

func (*T0Set) Subtract

func (s *T0Set) Subtract(b *T0Set) *T0Set

Subtract subtracts b from this set

func (*T0Set) Union

func (s *T0Set) Union(b *T0Set) *T0Set

Union applies union operation to this set and a given set

Jump to

Keyboard shortcuts

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