layeredsets

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type String

type String []sets.String

String is a layered set implemented as a slice of sets.String.

func NewString

func NewString(items ...string) String

NewString creates a String from a list of values.

func NewStringFromSlices

func NewStringFromSlices(items ...[]string) String

NewStringFromSlices creates a String from a list of sets.

func (String) Delete

func (s String) Delete(items ...string)

Delete removes all items from the set.

func (String) Difference

func (s String) Difference(s2 sets.String) String

Difference returns a set of objects that are not in s2

func (String) Equal

func (s String) Equal(s2 String) bool

Equal returns true if and only if s1 is equal (as a set) to s2.

func (String) Has

func (s String) Has(item string) bool

Has returns true if and only if item is contained in the set.

func (*String) Insert

func (s *String) Insert(layerID int, items ...string)

Insert adds items to the set.

func (String) Len

func (s String) Len() int

Len returns the size of the set.

func (String) List

func (s String) List() []string

List returns the contents as a sorted string slice, respecting layers.

func (String) PopRandom

func (s String) PopRandom() string

PopRandom randomly selects an element and pops it.

func (String) Set

func (s String) Set() sets.String

Set converts the multiset into a regular sets.String for compatibility.

func (String) Union

func (s String) Union(s2 String) String

Union returns a new set which includes items in either s1 or s2.

func (String) UnsortedList

func (s String) UnsortedList() []string

UnsortedList returns the slice with contents in random order, respecting layers.

Jump to

Keyboard shortcuts

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