Documentation
¶
Overview ¶
Package bitmap provides a datatype for long vectors of bits.
Index ¶
- Variables
- type Bitmap
- func (h *Bitmap) Bits() uint64
- func (h *Bitmap) IsSet(ordinal uint64) bool
- func (h *Bitmap) MarshalBinary() ([]byte, error)
- func (h *Bitmap) MarshalJSON() ([]byte, error)
- func (h *Bitmap) Set(ordinal uint64) error
- func (h *Bitmap) SetAny(serial bool) (uint64, error)
- func (h *Bitmap) SetAnyInRange(start, end uint64, serial bool) (uint64, error)
- func (h *Bitmap) String() string
- func (h *Bitmap) UnmarshalBinary(ba []byte) error
- func (h *Bitmap) UnmarshalJSON(data []byte) error
- func (h *Bitmap) Unselected() uint64
- func (h *Bitmap) Unset(ordinal uint64) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoBitAvailable is returned when no more bits are available to set ErrNoBitAvailable = errors.New("no bit available") // ErrBitAllocated is returned when the specific bit requested is already set ErrBitAllocated = errors.New("requested bit is already allocated") )
Functions ¶
This section is empty.
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
Bitmap is a fixed-length bit vector. It is not safe for concurrent use.
The data is stored as a list of run-length encoded blocks. It operates directly on the encoded representation, without decompressing.
func (*Bitmap) IsSet ¶
IsSet atomically checks if the ordinal bit is set. In case ordinal is outside of the bit sequence limits, false is returned.
func (*Bitmap) MarshalBinary ¶
func (h *