bitmap

package
v0.0.0-...-4ff26d5 Latest Latest
Warning

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

Go to latest
Published: May 4, 2014 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package bitmap provides a sparsed bitmap implementation.

Index

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

Jump to

Keyboard shortcuts

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