BitArray32

value class BitArray32(value: Int) : BitArray

Implements bitset based on Int. Index 0 is the most left bit. For example: index 30 in value 0b010 is 1, index 31 and 29 is 0

Example:

var data = Bitset32()
assertFalse(data[0])
assertFalse(data[1])
data = data.set(0,true)
assertTrue(data[0])
assertFalse(data[1])

Constructors

Link copied to clipboard
fun BitArray32(value: Int = 0)

Functions

Link copied to clipboard
open override fun full(value: Boolean, startIndex: Int, endIndex: Int): BitArray32
Link copied to clipboard
open operator override fun get(index: Int): Boolean
Link copied to clipboard
open override fun getByte4(index: Int): Byte

Returns byte from 4 bites using index

Link copied to clipboard
open override fun getByte8(index: Int): Byte

Returns byte from 8 bites using index

Link copied to clipboard
open override fun inverted(): BitArray32
Link copied to clipboard
open operator override fun iterator(): BitArrayListIterator
Link copied to clipboard
open fun toByteArray(): BooleanArray
Link copied to clipboard
fun toInt(): Int
Link copied to clipboard
open override fun toString(): String

Returns value as unsigned int in radix 2

Link copied to clipboard
fun toUInt(): UInt
Link copied to clipboard
open override fun update(index: Int, value: Boolean): BitArray32
Link copied to clipboard
open override fun updateByte4(index: Int, value: Byte): BitArray32

Sets 4 bits value to this inline value using offset index. value must be less or equals 0xF

Properties

Link copied to clipboard
open val lastIndex: Int
Link copied to clipboard
open override val size: Int
Link copied to clipboard
val value: Int = 0