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 ¶
type ByteSet map[byte]struct{}
func NewByteWithSize ¶
NewByteWithSize returns an empty byte set initialized with specific size
func (ByteSet) 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 Complex128Set ¶
type Complex128Set map[complex128]struct{}
func NewComplex128 ¶
func NewComplex128() Complex128Set
NewComplex128 returns an empty complex128 set
func NewComplex128WithSize ¶
func NewComplex128WithSize(size int) Complex128Set
NewComplex128WithSize returns an empty complex128 set initialized with specific size
func (Complex128Set) Add ¶
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 ¶
func (s Complex128Set) Contains(value complex128) bool
Contains returns true if this set contains the specified element
func (Complex128Set) Len ¶
func (s Complex128Set) Len() int
func (Complex128Set) Range ¶
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 ¶
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 ¶
type Complex64Set map[complex64]struct{}
func NewComplex64WithSize ¶
func NewComplex64WithSize(size int) Complex64Set
NewComplex64WithSize returns an empty complex64 set initialized with specific size
func (Complex64Set) Add ¶
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 ¶
func (s Complex64Set) Contains(value complex64) bool
Contains returns true if this set contains the specified element
func (Complex64Set) Len ¶
func (s Complex64Set) Len() int
func (Complex64Set) Range ¶
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 ¶
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 ¶
type Int8Set map[int8]struct{}
func NewInt8WithSize ¶
NewInt8WithSize returns an empty int8 set initialized with specific size
func (Int8Set) 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 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 ¶
type RuneSet map[rune]struct{}
func NewRuneWithSize ¶
NewRuneWithSize returns an empty rune set initialized with specific size
func (RuneSet) 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 StringSet ¶
type StringSet map[string]struct{}
func NewStringWithSize ¶
NewStringWithSize returns an empty string set initialized with specific size
func (StringSet) 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 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 ¶
type Uint8Set map[uint8]struct{}
func NewUint8WithSize ¶
NewUint8WithSize returns an empty uint8 set initialized with specific size
func (Uint8Set) 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 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 ¶
type UintptrSet map[uintptr]struct{}
func NewUintptrWithSize ¶
func NewUintptrWithSize(size int) UintptrSet
NewUintptrWithSize returns an empty uintptr set initialized with specific size
func (UintptrSet) Add ¶
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 ¶
func (s UintptrSet) Contains(value uintptr) bool
Contains returns true if this set contains the specified element
func (UintptrSet) Len ¶
func (s UintptrSet) Len() int
func (UintptrSet) Range ¶
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 ¶
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