Documentation ¶ Overview ¶ Package bitmap provides a sparsed bitmap implementation. Index ¶ type Bitmap func New(option *Option) *Bitmap func (b *Bitmap) Capacity() int func (b *Bitmap) Clear(n int) func (b *Bitmap) ClearAll() func (b *Bitmap) Gc() func (b *Bitmap) Set(n int) func (b *Bitmap) Size() int func (b *Bitmap) Test(n int) bool type Option Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Bitmap ¶ type Bitmap struct { // contains filtered or unexported fields } func New ¶ func New(option *Option) *Bitmap Return back a new Bitmap according the option passed in func (*Bitmap) Capacity ¶ func (b *Bitmap) Capacity() int How many bits can be set in this bitmap func (*Bitmap) Clear ¶ func (b *Bitmap) Clear(n int) Clear one bit func (*Bitmap) ClearAll ¶ func (b *Bitmap) ClearAll() Reinit the whole Bitmap func (*Bitmap) Gc ¶ func (b *Bitmap) Gc() Recycle unused pages func (*Bitmap) Set ¶ func (b *Bitmap) Set(n int) Set one bit func (*Bitmap) Size ¶ func (b *Bitmap) Size() int Total count of bits setted func (*Bitmap) Test ¶ func (b *Bitmap) Test(n int) bool Test whether one bit is set or not type Option ¶ type Option struct { // Automatically to alloc more spaces for coming elements AutoExpand bool // Automatically to recycle resources after delete elements from the bitmap AutoRecycle bool // Initial capacity of this Bitmap Capacity int } Option used to construct the Bitmap Source Files ¶ View all Source files bitmap.go option.go Click to show internal directories. Click to hide internal directories.