bytearray

package
v0.0.0-...-1640c59 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteArray

type ByteArray interface {
	Len() int
	Set(idx int, b byte)
	Get(idx int) byte
	Insert(idx int, b []byte)
	PopCount(start, end int) uint64
	Copy(from, to, n int)
}

type FrontSlice

type FrontSlice struct {
	// contains filtered or unexported fields
}

func NewFrontSlice

func NewFrontSlice(pagesize int) *FrontSlice

func (*FrontSlice) Copy

func (f *FrontSlice) Copy(from, to, n int)

func (*FrontSlice) Get

func (f *FrontSlice) Get(idx int) byte

func (*FrontSlice) Insert

func (f *FrontSlice) Insert(idx int, b []byte)

func (*FrontSlice) Len

func (f *FrontSlice) Len() int

func (*FrontSlice) PopCount

func (f *FrontSlice) PopCount(start, end int) uint64

func (*FrontSlice) Set

func (f *FrontSlice) Set(idx int, b byte)

type Int16Index

type Int16Index struct {
	// contains filtered or unexported fields
}

func NewInt16Index

func NewInt16Index(b ByteArray) *Int16Index

func (*Int16Index) Copy

func (ix *Int16Index) Copy(from, to, n int)

func (*Int16Index) Get

func (ix *Int16Index) Get(at int) byte

Get returns the value stored at `at`.

func (*Int16Index) Insert

func (ix *Int16Index) Insert(at int, b []byte)

Insert extends the bitarray by `n` bits. The bits are zeroed and start at index `at`. Example: Initial string: 11101 Insert(3, 2) Resulting string: 11000101

func (*Int16Index) Len

func (ix *Int16Index) Len() int

Len returns the number of bytes in the bytearray.

func (*Int16Index) PopCount

func (ix *Int16Index) PopCount(from int, to int) uint64

Count returns the number of set bits in the interval [from, to).

func (*Int16Index) Set

func (ix *Int16Index) Set(at int, val byte)

Set sets the bit at an index `at` to the value `val`.

type PagedArray

type PagedArray struct {
	// contains filtered or unexported fields
}

func NewPaged

func NewPaged(pagesize int, highwaterPercentage, lowUtilization float64) *PagedArray

func (*PagedArray) Copy

func (p *PagedArray) Copy(from int, to int, n int)

func (*PagedArray) Get

func (p *PagedArray) Get(idx int) byte

func (*PagedArray) Insert

func (p *PagedArray) Insert(idx int, b []byte)

func (*PagedArray) Len

func (p *PagedArray) Len() int

func (*PagedArray) PopCount

func (p *PagedArray) PopCount(start int, end int) uint64

func (*PagedArray) Set

func (p *PagedArray) Set(idx int, b byte)

type SliceArray

type SliceArray struct {
	// contains filtered or unexported fields
}

func NewSlice

func NewSlice() *SliceArray

func (*SliceArray) Copy

func (s *SliceArray) Copy(from, to, n int)

func (*SliceArray) Get

func (s *SliceArray) Get(idx int) byte

func (*SliceArray) Insert

func (s *SliceArray) Insert(idx int, b []byte)

func (*SliceArray) Len

func (s *SliceArray) Len() int

func (*SliceArray) PopCount

func (s *SliceArray) PopCount(start, end int) uint64

func (*SliceArray) Set

func (s *SliceArray) Set(idx int, b byte)

type SpilloverArray

type SpilloverArray struct {
	// contains filtered or unexported fields
}

func NewSpillover

func NewSpillover(pagesize int, highwaterPercentage, lowUtilization float64, multiplier bool) *SpilloverArray

func (*SpilloverArray) Copy

func (a *SpilloverArray) Copy(from, to, n int)

func (*SpilloverArray) Get

func (a *SpilloverArray) Get(idx int) byte

func (*SpilloverArray) Insert

func (a *SpilloverArray) Insert(idx int, b []byte)

func (*SpilloverArray) Len

func (a *SpilloverArray) Len() int

func (*SpilloverArray) PopCount

func (a *SpilloverArray) PopCount(start, end int) uint64

func (*SpilloverArray) Set

func (a *SpilloverArray) Set(idx int, b byte)

Jump to

Keyboard shortcuts

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