A bit-vector using fast "alchemy-memory" for data storage.

Constructor

new (size:Int, ?name:String)

Creates a bit vector capable of storing a total of size bits.

Variables

read onlysize:Int

The size measured in bits.

Methods

clone ():BitMemory

Creates a deep copy of this object.

inline clr (i:Int):Void

Sets the bit at index i to 0.

inline get (i:Int):Int

Returns 1 if the bit at index i is set, otherwise zero.

inline getAddr (i:Int):Int

Returns the memory byte offset for the byte storing the bit at index i.

inline has (i:Int):Bool

Returns true if the bit at index i is 1.

inline ofBool (i:Int, cond:Bool):Void

Sets the bit at index i to 1 if cond is true or clears the bit at index i if cond is false.

resize (newSize:Int):Void

Adjusts the size of this object so it's capable of storing newSize bits.

inline set (i:Int):Void

Sets the bit at index i to 1.

setAll (x:Int):BitMemory

Sets all bits to the value x.

toString ():String

Prints out all elements.

Static methods

staticofByteArray (input:ByteArray, ?min:Int, ?max:Int):BitMemory

Converts input in the range [min, max] to a ByteMemory object. If no range is specified, all input bytes are copied.

staticofBytesData (input:BytesData, ?min:Int, ?max:Int):BitMemory

Converts input in the range [min, max] to a ByteMemory object. If no range is specified, all input bytes are copied.

statictoBitVector (input:BitMemory):BitVector

Converts input to a BitVector object.

statictoByteArray (input:BitMemory):ByteArray

Converts input to a ByteArray object. The bytes are written in little endian format.

statictoBytesData (input:BitMemory):BytesData

Converts input to a BytesData object. The bytes are written in little endian format.

Inherited Variables

Defined by MemoryAccess

read onlybytes:Int

The number of allocated bytes.

read onlykey:Int

A unique identifier for this object. A hash table transforms this key into an index of an array element by using a hash function.

name:String

read onlyoffset:Int

The memory offset in bytes.

Inherited Methods