hashset

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 1 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StrHashset

type StrHashset struct {
	// contains filtered or unexported fields
}

StrHashset is a hashset of strings

func NewStrHashset

func NewStrHashset(initVals ...string) StrHashset

NewStrHashset constructs a StrHashet with optional initial values

func (*StrHashset) Add

func (set *StrHashset) Add(items ...string)

Add inserts one or many strings into the hashset. Duplicate entries will be automatically ignored.

func (*StrHashset) Clear

func (set *StrHashset) Clear()

Clear removes all entries from the existing hashset. This is a constant time operation.

func (StrHashset) Contains

func (set StrHashset) Contains(val string) bool

Contains returns true if the set contains the input string

func (StrHashset) ContainsSubstr

func (set StrHashset) ContainsSubstr(substr string, ignoreCase ...bool) bool

ContainsSubstr returns true if any entry in the set contains the given string entry, with an option to ignore case.

func (StrHashset) Equals

func (set StrHashset) Equals(set2 StrHashset) bool

Equals returns true if every entry in two hashsets are the same

func (StrHashset) IsEmpty

func (set StrHashset) IsEmpty() bool

IsEmpty returns true if there are no values in the hashset, false otherwise

func (*StrHashset) Remove

func (set *StrHashset) Remove(key string)

Remove removes a key from the set. Removing a non-existant key does nothing.

func (StrHashset) Size

func (set StrHashset) Size() int

Size returns the number of values currently held within the hashset

func (StrHashset) Values

func (set StrHashset) Values() []string

Values returns a slice of all entries within the hashset

Jump to

Keyboard shortcuts

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