Documentation
¶
Overview ¶
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Copyright 2020 hashset Author(https://github.com/yudeguang17/hashset). All Rights Reserved.
This Source Code Form is subject to the terms of the MIT License. If a copy of the MIT was not distributed with this file, You can obtain one at https://github.com/yudeguang17/hashset.
Index ¶
- type SetAny
- func (set *SetAny) Add(Items ...interface{})
- func (set *SetAny) Clear()
- func (set *SetAny) Contains(Items ...interface{}) bool
- func (set *SetAny) Empty() bool
- func (set *SetAny) Remove(Items ...interface{})
- func (set *SetAny) Size() int
- func (set *SetAny) String() string
- func (set *SetAny) ToSlice() []interface{}
- type SetByte
- type SetComplex64
- func (set *SetComplex64) Add(items ...complex64)
- func (set *SetComplex64) Clear()
- func (set *SetComplex64) Contains(items ...complex64) bool
- func (set *SetComplex64) Empty() bool
- func (set *SetComplex64) Remove(items ...complex64)
- func (set *SetComplex64) Size() int
- func (set *SetComplex64) String() string
- func (set *SetComplex64) ToSlice() []complex64
- type SetComplex128
- func (set *SetComplex128) Add(items ...complex128)
- func (set *SetComplex128) Clear()
- func (set *SetComplex128) Contains(items ...complex128) bool
- func (set *SetComplex128) Empty() bool
- func (set *SetComplex128) Remove(items ...complex128)
- func (set *SetComplex128) Size() int
- func (set *SetComplex128) String() string
- func (set *SetComplex128) ToSlice() []complex128
- type SetFloat32
- func (set *SetFloat32) Add(items ...float32)
- func (set *SetFloat32) Clear()
- func (set *SetFloat32) Contains(items ...float32) bool
- func (set *SetFloat32) Empty() bool
- func (set *SetFloat32) Remove(items ...float32)
- func (set *SetFloat32) Size() int
- func (set *SetFloat32) String() string
- func (set *SetFloat32) ToSlice() []float32
- type SetFloat64
- func (set *SetFloat64) Add(items ...float64)
- func (set *SetFloat64) Clear()
- func (set *SetFloat64) Contains(items ...float64) bool
- func (set *SetFloat64) Empty() bool
- func (set *SetFloat64) Remove(items ...float64)
- func (set *SetFloat64) Size() int
- func (set *SetFloat64) String() string
- func (set *SetFloat64) ToSlice() []float64
- type SetInt
- type SetInt8
- type SetInt16
- func (set *SetInt16) Add(items ...int16)
- func (set *SetInt16) Clear()
- func (set *SetInt16) Contains(items ...int16) bool
- func (set *SetInt16) Empty() bool
- func (set *SetInt16) Remove(items ...int16)
- func (set *SetInt16) Size() int
- func (set *SetInt16) String() string
- func (set *SetInt16) ToSlice() []int16
- type SetInt32
- func (set *SetInt32) Add(items ...int32)
- func (set *SetInt32) Clear()
- func (set *SetInt32) Contains(items ...int32) bool
- func (set *SetInt32) Empty() bool
- func (set *SetInt32) Remove(items ...int32)
- func (set *SetInt32) Size() int
- func (set *SetInt32) String() string
- func (set *SetInt32) ToSlice() []int32
- type SetInt64
- func (set *SetInt64) Add(items ...int64)
- func (set *SetInt64) Clear()
- func (set *SetInt64) Contains(items ...int64) bool
- func (set *SetInt64) Empty() bool
- func (set *SetInt64) Remove(items ...int64)
- func (set *SetInt64) Size() int
- func (set *SetInt64) String() string
- func (set *SetInt64) ToSlice() []int64
- type SetRune
- type SetString
- func (set *SetString) Add(items ...string)
- func (set *SetString) Clear()
- func (set *SetString) Contains(items ...string) bool
- func (set *SetString) Empty() bool
- func (set *SetString) Remove(items ...string)
- func (set *SetString) Size() int
- func (set *SetString) String() string
- func (set *SetString) ToSlice() []string
- type SetStringThreadSafeNoGC
- func (set *SetStringThreadSafeNoGC) Add(Items ...string)
- func (set *SetStringThreadSafeNoGC) Clear()
- func (set *SetStringThreadSafeNoGC) Contains(Items ...string) bool
- func (set *SetStringThreadSafeNoGC) Empty() bool
- func (set *SetStringThreadSafeNoGC) Remove(Items ...string)
- func (set *SetStringThreadSafeNoGC) Size() int
- type SetThreadSafe
- func (set *SetThreadSafe) Add(Items ...interface{})
- func (set *SetThreadSafe) Clear()
- func (set *SetThreadSafe) Contains(Items ...interface{}) bool
- func (set *SetThreadSafe) Empty() bool
- func (set *SetThreadSafe) Remove(Items ...interface{})
- func (set *SetThreadSafe) Size() int
- func (set *SetThreadSafe) String() string
- func (set *SetThreadSafe) ToSlice() []interface{}
- type SetUint
- type SetUint8
- func (set *SetUint8) Add(items ...uint8)
- func (set *SetUint8) Clear()
- func (set *SetUint8) Contains(items ...uint8) bool
- func (set *SetUint8) Empty() bool
- func (set *SetUint8) Remove(items ...uint8)
- func (set *SetUint8) Size() int
- func (set *SetUint8) String() string
- func (set *SetUint8) ToSlice() []uint8
- type SetUint16
- func (set *SetUint16) Add(items ...uint16)
- func (set *SetUint16) Clear()
- func (set *SetUint16) Contains(items ...uint16) bool
- func (set *SetUint16) Empty() bool
- func (set *SetUint16) Remove(items ...uint16)
- func (set *SetUint16) Size() int
- func (set *SetUint16) String() string
- func (set *SetUint16) ToSlice() []uint16
- type SetUint32
- func (set *SetUint32) Add(items ...uint32)
- func (set *SetUint32) Clear()
- func (set *SetUint32) Contains(items ...uint32) bool
- func (set *SetUint32) Empty() bool
- func (set *SetUint32) Remove(items ...uint32)
- func (set *SetUint32) Size() int
- func (set *SetUint32) String() string
- func (set *SetUint32) ToSlice() []uint32
- type SetUint64
- func (set *SetUint64) Add(items ...uint64)
- func (set *SetUint64) Clear()
- func (set *SetUint64) Contains(items ...uint64) bool
- func (set *SetUint64) Empty() bool
- func (set *SetUint64) Remove(items ...uint64)
- func (set *SetUint64) Size() int
- func (set *SetUint64) String() string
- func (set *SetUint64) ToSlice() []uint64
- type SetUintptr
- func (set *SetUintptr) Add(items ...uintptr)
- func (set *SetUintptr) Clear()
- func (set *SetUintptr) Contains(items ...uintptr) bool
- func (set *SetUintptr) Empty() bool
- func (set *SetUintptr) Remove(items ...uintptr)
- func (set *SetUintptr) Size() int
- func (set *SetUintptr) String() string
- func (set *SetUintptr) ToSlice() []uintptr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetAny ¶
type SetAny struct {
Items map[interface{}]struct{}
}
Set holds elements in go's native map
func New ¶
func New(values ...interface{}) *SetAny
New instantiates a new empty set and adds the passed values, if any, to the set
func (*SetAny) Add ¶
func (set *SetAny) Add(Items ...interface{})
Add adds the Items (one or more) to the set.
func (*SetAny) Contains ¶
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 (*SetAny) Remove ¶
func (set *SetAny) Remove(Items ...interface{})
Remove removes the Items (one or more) from the set.
type SetByte ¶
type SetByte struct {
Items map[byte]struct{}
}
byte类型
type SetComplex64 ¶
type SetComplex64 struct {
Items map[complex64]struct{}
}
complex64类型
func (*SetComplex64) Contains ¶
func (set *SetComplex64) Contains(items ...complex64) bool
判断时候包含传入的所有元素,不传入任何元素也被认为是true
type SetComplex128 ¶
type SetComplex128 struct {
Items map[complex128]struct{}
}
complex128类型
func NewComplex128 ¶
func NewComplex128(values ...complex128) *SetComplex128
初始化Set,支持在初始化的时候插入任意数量的元素
func (*SetComplex128) Contains ¶
func (set *SetComplex128) Contains(items ...complex128) bool
判断时候包含传入的所有元素,不传入任何元素也被认为是true
type SetFloat32 ¶
type SetFloat32 struct {
Items map[float32]struct{}
}
float32类型
func (*SetFloat32) Contains ¶
func (set *SetFloat32) Contains(items ...float32) bool
判断时候包含传入的所有元素,不传入任何元素也被认为是true
type SetFloat64 ¶
type SetFloat64 struct {
Items map[float64]struct{}
}
float64类型
func (*SetFloat64) Contains ¶
func (set *SetFloat64) Contains(items ...float64) bool
判断时候包含传入的所有元素,不传入任何元素也被认为是true
type SetInt ¶
type SetInt struct {
Items map[int]struct{}
}
Int类型
type SetInt8 ¶
type SetInt8 struct {
Items map[int8]struct{}
}
int8类型
type SetInt16 ¶
type SetInt16 struct {
Items map[int16]struct{}
}
int16类型
type SetInt32 ¶
type SetInt32 struct {
Items map[int32]struct{}
}
int32类型
type SetInt64 ¶
type SetInt64 struct {
Items map[int64]struct{}
}
int64类型
type SetRune ¶
type SetRune struct {
Items map[rune]struct{}
}
rune类型
type SetString ¶
type SetString struct {
Items map[string]struct{}
}
Int类型
type SetStringThreadSafeNoGC ¶
type SetStringThreadSafeNoGC struct {
Items *noGCMap.NoGcMapAny //核心部分
}
线程安全
func NewStringThreadSafeNoGC ¶
func NewStringThreadSafeNoGC() *SetStringThreadSafeNoGC
New instantiates a new empty set and adds the passed values, if any, to the set
func (*SetStringThreadSafeNoGC) Add ¶
func (set *SetStringThreadSafeNoGC) Add(Items ...string)
Add adds the Items (one or more) to the set.
func (*SetStringThreadSafeNoGC) Clear ¶
func (set *SetStringThreadSafeNoGC) Clear()
Clear clears all values in the set.
func (*SetStringThreadSafeNoGC) Contains ¶
func (set *SetStringThreadSafeNoGC) Contains(Items ...string) 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 (*SetStringThreadSafeNoGC) Empty ¶
func (set *SetStringThreadSafeNoGC) Empty() bool
Empty returns true if set does not contain any elements.
func (*SetStringThreadSafeNoGC) Remove ¶
func (set *SetStringThreadSafeNoGC) Remove(Items ...string)
Remove removes the Items (one or more) from the set.
func (*SetStringThreadSafeNoGC) Size ¶
func (set *SetStringThreadSafeNoGC) Size() int
Size returns number of elements within the set.
type SetThreadSafe ¶
线程安全
func InnerJoinThreadSafe ¶
func InnerJoinThreadSafe(m, n *SetThreadSafe) *SetThreadSafe
两集合的交集,这里不能同其它类型一样,先用Size函数得到长度,再计算,性能会较差
func NewThreadSafe ¶
func NewThreadSafe(values ...interface{}) *SetThreadSafe
New instantiates a new empty set and adds the passed values, if any, to the set
func (*SetThreadSafe) Add ¶
func (set *SetThreadSafe) Add(Items ...interface{})
Add adds the Items (one or more) to the set.
func (*SetThreadSafe) Contains ¶
func (set *SetThreadSafe) Contains(Items ...interface{}) 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 (*SetThreadSafe) Empty ¶
func (set *SetThreadSafe) Empty() bool
Empty returns true if set does not contain any elements.
func (*SetThreadSafe) Remove ¶
func (set *SetThreadSafe) Remove(Items ...interface{})
Remove removes the Items (one or more) from the set.
func (*SetThreadSafe) Size ¶
func (set *SetThreadSafe) Size() int
Size returns number of elements within the set.
func (*SetThreadSafe) String ¶
func (set *SetThreadSafe) String() string
String returns a string representation of container
func (*SetThreadSafe) ToSlice ¶
func (set *SetThreadSafe) ToSlice() []interface{}
Values returns all Items in the set.
type SetUint ¶
type SetUint struct {
Items map[uint]struct{}
}
uint类型
type SetUint8 ¶
type SetUint8 struct {
Items map[uint8]struct{}
}
uint8类型
type SetUint16 ¶
type SetUint16 struct {
Items map[uint16]struct{}
}
uint16类型
type SetUint32 ¶
type SetUint32 struct {
Items map[uint32]struct{}
}
uint32类型
type SetUint64 ¶
type SetUint64 struct {
Items map[uint64]struct{}
}
uint64类型
type SetUintptr ¶
type SetUintptr struct {
Items map[uintptr]struct{}
}
uintptr类型
func (*SetUintptr) Contains ¶
func (set *SetUintptr) Contains(items ...uintptr) bool
判断时候包含传入的所有元素,不传入任何元素也被认为是true