hashset

package
v0.1.301 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyType

type KeyType generic.Type

KeyType ...

type KeyTypeSet

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

KeyTypeSet holds elements in go's native map

func NewKeyTypeSet

func NewKeyTypeSet(values ...KeyType) *KeyTypeSet

NewKeyTypeSet instantiates a new empty set and adds the passed values, if any, to the set

func (*KeyTypeSet) Add

func (set *KeyTypeSet) Add(items ...KeyType)

Add adds the items (one or more) to the set.

func (*KeyTypeSet) Clear

func (set *KeyTypeSet) Clear()

Clear clears all values in the set.

func (*KeyTypeSet) Contains

func (set *KeyTypeSet) Contains(items ...KeyType) bool

Contains check if items (one or more) are present in the set. All items have to be present in the set for the method to return true. Returns true if no arguments are passed at all, i.e. set is always superset of empty set.

func (*KeyTypeSet) Empty

func (set *KeyTypeSet) Empty() bool

Empty returns true if set does not contain any elements.

func (*KeyTypeSet) FromJSON

func (set *KeyTypeSet) FromJSON(data []byte) error

FromJSON populates the set from the input JSON representation.

func (*KeyTypeSet) Remove

func (set *KeyTypeSet) Remove(items ...KeyType)

Remove removes the items (one or more) from the set.

func (*KeyTypeSet) Size

func (set *KeyTypeSet) Size() int

Size returns number of elements within the set.

func (*KeyTypeSet) String

func (set *KeyTypeSet) String() string

String returns a string representation of container

func (*KeyTypeSet) ToJSON

func (set *KeyTypeSet) ToJSON() ([]byte, error)

ToJSON outputs the JSON representation of the set.

func (*KeyTypeSet) Values

func (set *KeyTypeSet) Values() []KeyType

Values returns all items in the set.

Jump to

Keyboard shortcuts

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