Documentation
¶
Overview ¶
Example ¶
l := NewInt() for _, v := range []int{10, 12, 15} { l.Add(v) } if l.Contains(10) { fmt.Println("hashset contains 10") } l.Range(func(value int) bool { fmt.Println("hashset range found ", value) return true }) l.Remove(15) fmt.Printf("hashset contains %d items\r\n", l.Len())
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteSet ¶ added in v1.2.6
type ByteSet map[byte]struct{}
func NewByteWithSize ¶ added in v1.2.6
NewByteWithSize returns an empty byte set initialized with specific size
func (ByteSet) Add ¶ added in v1.2.6
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (ByteSet) Contains ¶ added in v1.2.6
Contains returns true if this set contains the specified element
type Complex128Set ¶ added in v1.2.6
type Complex128Set map[complex128]struct{}
func NewComplex128 ¶ added in v1.2.6
func NewComplex128() Complex128Set
NewComplex128 returns an empty complex128 set
func NewComplex128WithSize ¶ added in v1.2.6
func NewComplex128WithSize(size int) Complex128Set
NewComplex128WithSize returns an empty complex128 set initialized with specific size
func (Complex128Set) Add ¶ added in v1.2.6
func (s Complex128Set) Add(value complex128) bool
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (Complex128Set) Contains ¶ added in v1.2.6
func (s Complex128Set) Contains(value complex128) bool
Contains returns true if this set contains the specified element
func (Complex128Set) Len ¶ added in v1.2.6
func (s Complex128Set) Len() int
func (Complex128Set) Range ¶ added in v1.2.6
func (s Complex128Set) Range(f func(value complex128) bool)
Range calls f sequentially for each value present in the hashset. If f returns false, range stops the iteration.
func (Complex128Set) Remove ¶ added in v1.2.6
func (s Complex128Set) Remove(value complex128) bool
Remove removes the specified element from this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Complex64Set ¶ added in v1.2.6
type Complex64Set map[complex64]struct{}
func NewComplex64 ¶ added in v1.2.6
func NewComplex64() Complex64Set
NewComplex64 returns an empty complex64 set
func NewComplex64WithSize ¶ added in v1.2.6
func NewComplex64WithSize(size int) Complex64Set
NewComplex64WithSize returns an empty complex64 set initialized with specific size
func (Complex64Set) Add ¶ added in v1.2.6
func (s Complex64Set) Add(value complex64) bool
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (Complex64Set) Contains ¶ added in v1.2.6
func (s Complex64Set) Contains(value complex64) bool
Contains returns true if this set contains the specified element
func (Complex64Set) Len ¶ added in v1.2.6
func (s Complex64Set) Len() int
func (Complex64Set) Range ¶ added in v1.2.6
func (s Complex64Set) Range(f func(value complex64) bool)
Range calls f sequentially for each value present in the hashset. If f returns false, range stops the iteration.
func (Complex64Set) Remove ¶ added in v1.2.6
func (s Complex64Set) Remove(value complex64) bool
Remove removes the specified element from this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Float32Set ¶
type Float32Set map[float32]struct{}
func NewFloat32WithSize ¶
func NewFloat32WithSize(size int) Float32Set
NewFloat32WithSize returns an empty float32 set initialized with specific size
func (Float32Set) Add ¶
func (s Float32Set) Add(value float32) bool
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (Float32Set) Contains ¶
func (s Float32Set) Contains(value float32) bool
Contains returns true if this set contains the specified element
func (Float32Set) Len ¶
func (s Float32Set) Len() int
func (Float32Set) Range ¶
func (s Float32Set) Range(f func(value float32) bool)
Range calls f sequentially for each value present in the hashset. If f returns false, range stops the iteration.
func (Float32Set) Remove ¶
func (s Float32Set) Remove(value float32) bool
Remove removes the specified element from this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Float64Set ¶
type Float64Set map[float64]struct{}
func NewFloat64WithSize ¶
func NewFloat64WithSize(size int) Float64Set
NewFloat64WithSize returns an empty float64 set initialized with specific size
func (Float64Set) Add ¶
func (s Float64Set) Add(value float64) bool
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (Float64Set) Contains ¶
func (s Float64Set) Contains(value float64) bool
Contains returns true if this set contains the specified element
func (Float64Set) Len ¶
func (s Float64Set) Len() int
func (Float64Set) Range ¶
func (s Float64Set) Range(f func(value float64) bool)
Range calls f sequentially for each value present in the hashset. If f returns false, range stops the iteration.
func (Float64Set) Remove ¶
func (s Float64Set) Remove(value float64) bool
Remove removes the specified element from this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Int16Set ¶
type Int16Set map[int16]struct{}
func NewInt16WithSize ¶
NewInt16WithSize returns an empty int16 set initialized with specific size
func (Int16Set) Add ¶
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Int32Set ¶
type Int32Set map[int32]struct{}
func NewInt32WithSize ¶
NewInt32WithSize returns an empty int32 set initialized with specific size
func (Int32Set) Add ¶
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Int64Set ¶
type Int64Set map[int64]struct{}
func NewInt64WithSize ¶
NewInt64WithSize returns an empty int64 set initialized with specific size
func (Int64Set) Add ¶
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Int8Set ¶ added in v1.2.6
type Int8Set map[int8]struct{}
func NewInt8WithSize ¶ added in v1.2.6
NewInt8WithSize returns an empty int8 set initialized with specific size
func (Int8Set) Add ¶ added in v1.2.6
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (Int8Set) Contains ¶ added in v1.2.6
Contains returns true if this set contains the specified element
type IntSet ¶
type IntSet map[int]struct{}
func NewIntWithSize ¶
NewIntWithSize returns an empty int set initialized with specific size
func (IntSet) Add ¶
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type RuneSet ¶ added in v1.2.6
type RuneSet map[rune]struct{}
func NewRuneWithSize ¶ added in v1.2.6
NewRuneWithSize returns an empty rune set initialized with specific size
func (RuneSet) Add ¶ added in v1.2.6
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (RuneSet) Contains ¶ added in v1.2.6
Contains returns true if this set contains the specified element
type StringSet ¶ added in v1.2.6
type StringSet map[string]struct{}
func NewStringWithSize ¶ added in v1.2.6
NewStringWithSize returns an empty string set initialized with specific size
func (StringSet) Add ¶ added in v1.2.6
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (StringSet) Contains ¶ added in v1.2.6
Contains returns true if this set contains the specified element
type Uint16Set ¶
type Uint16Set map[uint16]struct{}
func NewUint16WithSize ¶
NewUint16WithSize returns an empty uint16 set initialized with specific size
func (Uint16Set) Add ¶
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Uint32Set ¶
type Uint32Set map[uint32]struct{}
func NewUint32WithSize ¶
NewUint32WithSize returns an empty uint32 set initialized with specific size
func (Uint32Set) Add ¶
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Uint64Set ¶
type Uint64Set map[uint64]struct{}
func NewUint64WithSize ¶
NewUint64WithSize returns an empty uint64 set initialized with specific size
func (Uint64Set) Add ¶
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type Uint8Set ¶ added in v1.2.6
type Uint8Set map[uint8]struct{}
func NewUint8WithSize ¶ added in v1.2.6
NewUint8WithSize returns an empty uint8 set initialized with specific size
func (Uint8Set) Add ¶ added in v1.2.6
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (Uint8Set) Contains ¶ added in v1.2.6
Contains returns true if this set contains the specified element
type UintSet ¶
type UintSet map[uint]struct{}
func NewUintWithSize ¶
NewUintWithSize returns an empty uint set initialized with specific size
func (UintSet) Add ¶
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
type UintptrSet ¶ added in v1.2.6
type UintptrSet map[uintptr]struct{}
func NewUintptr ¶ added in v1.2.6
func NewUintptr() UintptrSet
NewUintptr returns an empty uintptr set
func NewUintptrWithSize ¶ added in v1.2.6
func NewUintptrWithSize(size int) UintptrSet
NewUintptrWithSize returns an empty uintptr set initialized with specific size
func (UintptrSet) Add ¶ added in v1.2.6
func (s UintptrSet) Add(value uintptr) bool
Add adds the specified element to this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension
func (UintptrSet) Contains ¶ added in v1.2.6
func (s UintptrSet) Contains(value uintptr) bool
Contains returns true if this set contains the specified element
func (UintptrSet) Len ¶ added in v1.2.6
func (s UintptrSet) Len() int
func (UintptrSet) Range ¶ added in v1.2.6
func (s UintptrSet) Range(f func(value uintptr) bool)
Range calls f sequentially for each value present in the hashset. If f returns false, range stops the iteration.
func (UintptrSet) Remove ¶ added in v1.2.6
func (s UintptrSet) Remove(value uintptr) bool
Remove removes the specified element from this set Always returns true due to the build-in map doesn't indicate caller whether the given element already exists Reserves the return type for future extension