set

package
v1.21.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2017 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set interface {
	// Clear clears the set
	Clear()
	// Empty checks if the set is empty
	Empty() bool
	// Count returns the size of the set
	Count() int
	// Insert adds a key to the set
	Insert(key string)
	// Contains checks if the key exists in the set
	Contains(key string) bool
	// Remove removes the key from the set
	Remove(key string)
	// Keys returns the set of keys
	Keys() []string
	// Equals compares the set against another set
	Equals(s Set) bool
	// Subset checks if this set is a subset of another
	Subset(s Set) bool
	// Superset checks if this set is a superset of another
	Superset(s Set) bool
}

Set defines the interface for a set

func New

func New(cap int) Set

New initializes a new set, picking the appropriate underlying implementation based on the specified expected capacity

func NewMapSet

func NewMapSet(cap int) Set

NewMapSet initializes a map-based set

func NewSliceSet

func NewSliceSet(cap int) Set

NewSliceSet initializes a slice-based set

func NewSortedSet

func NewSortedSet(cap int) Set

NewSortedSet initializes a sorted-slice based set

Jump to

Keyboard shortcuts

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