Documentation ¶
Index ¶
- Constants
- type BitArray
- func (b *BitArray) Cap() int
- func (b *BitArray) Get(index int64) (res bool)
- func (b *BitArray) HasRoom() bool
- func (b *BitArray) IsEmpty() bool
- func (b *BitArray) Len() int
- func (b *BitArray) Mark(index int64)
- func (b *BitArray) MarkFree() (index int64)
- func (b *BitArray) Reset()
- func (b *BitArray) Set(index int64, mark bool) (changed bool)
- func (b *BitArray) Unmark(index int64)
- type BitBlock
Constants ¶
View Source
const (
BitBlockNotFound = -1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitArray ¶
type BitArray struct {
// contains filtered or unexported fields
}
BitArray array of binary values.
func NewBitArray ¶
NewBitArray creates and initializes a new BitArray using capacity as its initial capacity.
func (*BitArray) Cap ¶
Cap returns the BitArray capacity, that is, the total bits allocated for the data.
func (*BitArray) HasRoom ¶
HasRoom reports true if this BitArray contains bits that are set to true.
func (*BitArray) IsEmpty ¶
IsEmpty reports true if this BitArray contains no bits that are set to true.
func (*BitArray) MarkFree ¶
MarkFree finds the index of the first bit that is set to false and sets the bit to true. Returns index of changed bit. Returns BitBlockNotFound unless array has room.
Click to show internal directories.
Click to hide internal directories.