set

package
v1.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: MIT Imports: 2 Imported by: 0

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 NewConcurrent

func NewConcurrent(cap int) Set

NewConcurrent initializes a new concurrent 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

func NewSyncSet

func NewSyncSet(set Set) Set

NewSyncSet initializes a map-based set

Jump to

Keyboard shortcuts

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