Documentation ¶
Index ¶
- type Bitmap
- func AndBitmaps(nbits int, bitmaps ...*Bitmap) *Bitmap
- func AndNotBitmap(a *Bitmap, b *Bitmap) *Bitmap
- func FlipBitmap(b *Bitmap, start, stop int) *Bitmap
- func NewBitmap(nbits int) *Bitmap
- func NewBitmapFromBuf(buf []byte, nbits int, copyBuffer bool) (*Bitmap, error)
- func OrBitmaps(nbits int, bitmaps ...*Bitmap) *Bitmap
- func (b *Bitmap) Add(v uint32)
- func (b *Bitmap) AddInt(v int)
- func (b *Bitmap) And(o *Bitmap)
- func (b *Bitmap) AndNot(o *Bitmap)
- func (b *Bitmap) Bytes() []byte
- func (b *Bitmap) Clone() *Bitmap
- func (b *Bitmap) Contains(v uint32) bool
- func (b *Bitmap) Equals(o *Bitmap) bool
- func (b *Bitmap) FlipInt(start, stop int)
- func (b *Bitmap) GetCardinality() uint64
- func (b *Bitmap) IsEmpty() bool
- func (b *Bitmap) Marshal() ([]byte, error)
- func (b *Bitmap) Or(o *Bitmap)
- func (b *Bitmap) Remove(v uint32)
- func (b *Bitmap) ToArray() []uint32
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 AndBitmaps ¶
And computes the intersection between the bitmaps and returns the result.
func AndNotBitmap ¶
AndNot computes the difference between the bitmaps and returns the result.
func FlipBitmap ¶
FlipBitmap negates the bits in the the bitmaps range and returns the result.
func NewBitmapFromBuf ¶
NewBitmapFromBuf returns a fixed size bitmap with a capacity for nbits of storage. The bitmap is initialized from the marshaled form. If copyBuffer is true, the buffer is copied, otherwise it may be used by the bitmap itself.
func (*Bitmap) AddInt ¶
AddInt adds the integer x to the bitmap (convenience method: the parameter is casted to uint32 and we call Add).
func (*Bitmap) And ¶
And computes the intersection between two bitmaps and stores the result in the current bitmap.
func (*Bitmap) AndNot ¶
Or computes the union between two bitmaps and stores the result in the current bitmap.
func (*Bitmap) FlipInt ¶
Flip negates the bits in the given range (i.e., [start,stop)), any integer present in this range and in the bitmap is removed, and any integer present in the range and not in the bitmap is added.
func (*Bitmap) GetCardinality ¶
GetCardinality returns the number of integers contained in the bitmap.
func (*Bitmap) Marshal ¶
Marshal returns a binary encoding of the bitmap. The data returned may point to the internals of the bitmap itself, and if the bitmap is subsequently changed the marshaled form may change.