bitset

package
v0.0.0-...-df4236e Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2015 License: MIT Imports: 2 Imported by: 3

Documentation

Overview

Package bitset provides an interface for bit-string data-structures and also provides a memory-efficient bit-string implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitSet

type BitSet interface {
	// Has tests whether the bit at pos has been set.
	Has(pos int) bool
	// Set sets the bit at pos to one.
	Set(pos int)
	// Clear sets the bit at pos to zero.
	Clear(pos int)
	// CopyBit copies the bit at index from the source into the bit-string.
	CopyBit(src BitSet, index int)
	// CopyBits copies the bits at indices from the source into the bit-string.
	CopyBits(src BitSet, indices []int)
	// Len returns the length of the bit-string.
	Len() int
}

BitSet provides an interface for manipulating bit-strings by accessing individual bits and recombining partial bit-sets.

func FromString

func FromString(s string) (BitSet, error)

FromString converts a string in big-endian notation to a new bit-set.

func FromUInt32s

func FromUInt32s(ints []uint32, length int) (BitSet, error)

func New

func New(len int) BitSet

New returns an interface to the dense bit-string implementation.

Jump to

Keyboard shortcuts

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