bitmap

package
v1.3.27 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

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
}

Bitmap is a mapping from some domain (for example, a range of integers) to bits. It is also called a bit array or bitmap index

func New

func New(size uint64) *Bitmap

New creates a new bitmap

func NewFromData

func NewFromData(data []byte) *Bitmap

NewFromData creates a bitmap from the exported data

func (*Bitmap) Clear

func (b *Bitmap) Clear()

Clear clear the bitmap's data

func (*Bitmap) Data

func (b *Bitmap) Data() []byte

Data returns the bitmap's internal data slice

func (*Bitmap) IsSet

func (b *Bitmap) IsSet(pos uint64) bool

IsSet returns true if the position pos is 1

func (*Bitmap) Resize

func (b *Bitmap) Resize(size uint64)

Resize resizes the bitmap with the passed size

func (*Bitmap) Set

func (b *Bitmap) Set(pos uint64) bool

Set sets 1 at position pos

func (*Bitmap) Size

func (b *Bitmap) Size() uint64

Size returns the bitmap's size in bit

func (*Bitmap) Unset

func (b *Bitmap) Unset(pos uint64) bool

Unset sets 0 at position pos

Jump to

Keyboard shortcuts

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