set

package
v1.2.2 Latest Latest
Warning

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

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

Documentation

Overview

* @Author: cnzf1 * @Date: 2022-07-20 13:51:53 * @LastEditors: cnzf1 * @LastEditTime: 2023-03-28 18:39:54 * @Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

Set is not thread-safe, for concurrent use, make sure to use it with synchronization.

func NewSet

func NewSet() *Set

NewSet returns a managed Set, can only put the values with the same type.

func NewUnmanagedSet

func NewUnmanagedSet() *Set

NewUnmanagedSet returns an unmanaged Set, which can put values with different types.

func (*Set) Add

func (s *Set) Add(i ...lang.AnyType)

Add adds i into s.

func (*Set) AddInt

func (s *Set) AddInt(ii ...int)

AddInt adds int values ii into s.

func (*Set) AddInt64

func (s *Set) AddInt64(ii ...int64)

AddInt64 adds int64 values ii into s.

func (*Set) AddStr

func (s *Set) AddStr(ss ...string)

AddStr adds string values ss into s.

func (*Set) AddUint

func (s *Set) AddUint(ii ...uint)

AddUint adds uint values ii into s.

func (*Set) AddUint64

func (s *Set) AddUint64(ii ...uint64)

AddUint64 adds uint64 values ii into s.

func (*Set) Contains

func (s *Set) Contains(i lang.AnyType) bool

Contains checks if i is in s.

func (*Set) Count

func (s *Set) Count() int

Count returns the number of items in s.

func (*Set) Keys

func (s *Set) Keys() []lang.AnyType

Keys returns the keys in s.

func (*Set) KeysInt

func (s *Set) KeysInt() []int

KeysInt returns the int keys in s.

func (*Set) KeysInt64

func (s *Set) KeysInt64() []int64

KeysInt64 returns int64 keys in s.

func (*Set) KeysStr

func (s *Set) KeysStr() []string

KeysStr returns string keys in s.

func (*Set) KeysUint

func (s *Set) KeysUint() []uint

KeysUint returns uint keys in s.

func (*Set) KeysUint64

func (s *Set) KeysUint64() []uint64

KeysUint64 returns uint64 keys in s.

func (*Set) Remove

func (s *Set) Remove(i lang.AnyType)

Remove removes i from s.

Jump to

Keyboard shortcuts

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