set

package
v0.0.0-...-9d78121 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: LGPL-3.0 Imports: 3 Imported by: 447

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ints

type Ints map[int]bool

Ints represents the classic "set" data structure, and contains ints.

func NewInts

func NewInts(initial ...int) Ints

NewInts creates and initializes an Ints and populates it with initial values as specified in the parameters.

func (Ints) Add

func (is Ints) Add(value int)

Add puts a value into the set.

func (Ints) Contains

func (is Ints) Contains(value int) bool

Contains returns true if the value is in the set, and false otherwise.

func (Ints) Difference

func (is Ints) Difference(other Ints) Ints

Difference returns a new Ints representing all the values in the target that are not in the parameter.

func (Ints) Intersection

func (is Ints) Intersection(other Ints) Ints

Intersection returns a new Ints representing a intersection of the elments in the method target and the parameter.

func (Ints) IsEmpty

func (is Ints) IsEmpty() bool

IsEmpty is true for empty or uninitialized sets.

func (Ints) Remove

func (is Ints) Remove(value int)

Remove takes a value out of the set. If value wasn't in the set to start with, this method silently succeeds.

func (Ints) Size

func (is Ints) Size() int

Size returns the number of elements in the set.

func (Ints) SortedValues

func (is Ints) SortedValues() []int

SortedValues returns an ordered slice containing all the values in the set.

func (Ints) Union

func (is Ints) Union(other Ints) Ints

Union returns a new Ints representing a union of the elments in the method target and the parameter.

func (Ints) Values

func (is Ints) Values() []int

Values returns an unordered slice containing all the values in the set.

type Strings

type Strings map[string]bool

Strings represents the classic "set" data structure, and contains strings.

func NewStrings

func NewStrings(initial ...string) Strings

NewStrings creates and initializes a Strings and populates it with initial values as specified in the parameters.

func (Strings) Add

func (s Strings) Add(value string)

Add puts a value into the set.

func (Strings) Contains

func (s Strings) Contains(value string) bool

Contains returns true if the value is in the set, and false otherwise.

func (Strings) Difference

func (s Strings) Difference(other Strings) Strings

Difference returns a new Strings representing all the values in the target that are not in the parameter.

func (Strings) Intersection

func (s Strings) Intersection(other Strings) Strings

Intersection returns a new Strings representing a intersection of the elments in the method target and the parameter.

func (Strings) IsEmpty

func (s Strings) IsEmpty() bool

IsEmpty is true for empty or uninitialized sets.

func (Strings) Remove

func (s Strings) Remove(value string)

Remove takes a value out of the set. If value wasn't in the set to start with, this method silently succeeds.

func (Strings) Size

func (s Strings) Size() int

Size returns the number of elements in the set.

func (Strings) SortedValues

func (s Strings) SortedValues() []string

SortedValues returns an ordered slice containing all the values in the set.

func (Strings) Union

func (s Strings) Union(other Strings) Strings

Union returns a new Strings representing a union of the elments in the method target and the parameter.

func (Strings) Values

func (s Strings) Values() []string

Values returns an unordered slice containing all the values in the set.

type Tags

type Tags map[names.Tag]bool

Tags represents the Set data structure, it implements tagSet and contains names.Tags.

func NewTags

func NewTags(initial ...names.Tag) Tags

NewTags creates and initializes a Tags and populates it with inital values as specified in the parameters.

func NewTagsFromStrings

func NewTagsFromStrings(initial ...string) (Tags, error)

NewTagsFromStrings creates and initializes a Tags and populates it by using names.ParseTag on the initial values specified in the parameters.

func (Tags) Add

func (t Tags) Add(value names.Tag)

Add puts a value into the set.

func (Tags) Contains

func (t Tags) Contains(value names.Tag) bool

Contains returns true if the value is in the set, and false otherwise.

func (Tags) Difference

func (t Tags) Difference(other Tags) Tags

Difference returns a new Tags representing all the values in the target that are not in the parameter.

func (Tags) Intersection

func (t Tags) Intersection(other Tags) Tags

Intersection returns a new Tags representing a intersection of the elments in the method target and the parameter.

func (Tags) IsEmpty

func (t Tags) IsEmpty() bool

IsEmpty is true for empty or uninitialized sets.

func (Tags) Remove

func (t Tags) Remove(value names.Tag)

Remove takes a value out of the set. If value wasn't in the set to start with, this method silently succeeds.

func (Tags) Size

func (t Tags) Size() int

Size returns the number of elements in the set.

func (Tags) SortedValues

func (t Tags) SortedValues() []names.Tag

SortedValues returns an ordered slice containing all the values in the set.

func (Tags) Union

func (t Tags) Union(other Tags) Tags

Union returns a new Tags representing a union of the elments in the method target and the parameter.

func (Tags) Values

func (t Tags) Values() []names.Tag

Values returns an unordered slice containing all the values in the set.

Jump to

Keyboard shortcuts

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