set

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: GPL-3.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 Set

type Set map[interface{}]interface{}

func New

func New() *Set

Create a new set

func (*Set) Difference

func (s *Set) Difference(set *Set) *Set

Find the difference between two sets (s - set)

func (*Set) Do

func (s *Set) Do(f func(interface{}))

Call f for each item in the set

func (*Set) Get

func (s *Set) Get(key interface{}) interface{}

func (*Set) GetDigest

func (s *Set) GetDigest() (uint64, error)

Digest is the xor sum of the entire set's hash.

func (*Set) Has

func (s *Set) Has(key interface{}) bool

Test to see whether or not the element is in the set

func (*Set) Insert

func (s *Set) Insert(key, val interface{})

Add an element to the set, val can be struct{}

func (*Set) InsertKey

func (s *Set) InsertKey(key interface{})

func (*Set) Intersection

func (s *Set) Intersection(otherSet *Set) *Set

Find the intersection of two sets

func (*Set) Len

func (s *Set) Len() int

Return the number of items in the set

func (*Set) ProperSubsetOf

func (s *Set) ProperSubsetOf(set *Set) bool

Test whether or not this set is a proper subset of "set"

func (*Set) Remove

func (s *Set) Remove(key interface{})

Remove an element from the set

func (*Set) SubsetOf

func (s *Set) SubsetOf(set *Set) bool

Test whether or not this set is a subset of "set"

func (*Set) Union

func (s *Set) Union(set *Set) *Set

Find the union of two sets

Jump to

Keyboard shortcuts

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