collections: github.com/juju/collections/set Index | Files

package set

import "github.com/juju/collections/set"

Index

Package Files

ints.go strings.go

type Ints Uses

type Ints map[int]bool

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

func NewInts Uses

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 Uses

func (is Ints) Add(value int)

Add puts a value into the set.

func (Ints) Contains Uses

func (is Ints) Contains(value int) bool

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

func (Ints) Difference Uses

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 Uses

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 Uses

func (is Ints) IsEmpty() bool

IsEmpty is true for empty or uninitialized sets.

func (Ints) Remove Uses

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 Uses

func (is Ints) Size() int

Size returns the number of elements in the set.

func (Ints) SortedValues Uses

func (is Ints) SortedValues() []int

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

func (Ints) Union Uses

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 Uses

func (is Ints) Values() []int

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

type Strings Uses

type Strings map[string]bool

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

func NewStrings Uses

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 Uses

func (s Strings) Add(value string)

Add puts a value into the set.

func (Strings) Contains Uses

func (s Strings) Contains(value string) bool

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

func (Strings) Difference Uses

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 Uses

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 Uses

func (s Strings) IsEmpty() bool

IsEmpty is true for empty or uninitialized sets.

func (Strings) Remove Uses

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 Uses

func (s Strings) Size() int

Size returns the number of elements in the set.

func (Strings) SortedValues Uses

func (s Strings) SortedValues() []string

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

func (Strings) Union Uses

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 Uses

func (s Strings) Values() []string

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

Package set imports 1 packages (graph) and is imported by 251 packages. Updated 2018-05-17. Refresh now. Tools for package owners.