bitmap

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitMapStruct

type BitMapStruct struct {
	Name       string `json:"Name"`
	ByteBuffer []byte `json:"byteBuffer"`
	BitLength  uint64 `json:"length"`
}

func GetBitMap

func GetBitMap(name string) *BitMapStruct

GetBitMap get the bitmap instance GetBitMap 获取bitmap实例 parameter name name of bitmap instance

func NewBitMap

func NewBitMap(name string, n uint64) *BitMapStruct

NewBitMap create the bitmap instance NewBitMap 生成bitmap对象 parameter name name of bitmap parameter n the length of the bitmap

func (*BitMapStruct) Clean

func (bt *BitMapStruct) Clean()

Clean set all bit zero Clean 清零所有位

func (*BitMapStruct) Del

func (bt *BitMapStruct) Del(n uint64) error

Del unset the bit Del 设置对应bit为0 parameter n the n bit

func (*BitMapStruct) Destroy

func (bt *BitMapStruct) Destroy()

Destroy destory current bitmap instance Destroy 删除当前bitmap

func (*BitMapStruct) IsExist

func (bt *BitMapStruct) IsExist(n uint64) bool

IsExist returns true if the specified IsExist 返回是否置位 parameter n is position of bitmap

func (*BitMapStruct) MDel

func (bt *BitMapStruct) MDel(elements ...uint64) error

MDel Unset multiple bits at once MDel 批量删除对应bit parameter n bit array

func (*BitMapStruct) MExist

func (bt *BitMapStruct) MExist(elements ...uint64) map[uint64]bool

MExist returns true if the specified list MExist 批量判断是否置位 parameter elements is position array of bitmap

func (*BitMapStruct) MSet

func (bt *BitMapStruct) MSet(n ...uint64) error

MSet set multiple bits at once Mset 一次设置多个bit parameter n bit array

func (*BitMapStruct) PrintAllBits

func (bt *BitMapStruct) PrintAllBits()

PrintAllBits Print all bits and all values PrintAllBits 打印整个bitmap

func (*BitMapStruct) Set

func (bt *BitMapStruct) Set(n uint64) error

Set set the bit Set 设置对应位置的位数为1 parameter m, the n bit of the bitmap

Jump to

Keyboard shortcuts

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