bee.typing

class String:

String type.

String(length)
len
class Array:

Array type.

Array(size: int)
class LongArray:

unsigned Long Array type. unsigned long 64 bit.

LongArray(size: int)
class Bitmap:

Bitmap type base LongArray.
since 1.6.2

Bitmap(num_bits: int)

Initialize a bitmap, using LongArray as the underlying storage.

Parameters
  • num_bits: The total number of bits in a bitmap.
def set_bit(self, bit_index: int) -> None:

将指定位设置为 1。

Parameters
  • bit_index: 位的索引(从 0 开始)。
def clear_bit(self, bit_index: int) -> None:

将指定位设置为 0。

Parameters
  • bit_index: 位的索引(从 0 开始)。
def get_bit(self, bit_index: int) -> int:

获取指定位的值(0 或 1)。

Parameters
  • bit_index: 位的索引(从 0 开始)。
Returns

0 或 1。

def is_bit_set(self, bit_index: int) -> bool:

判断指定位是否为 1。

Parameters
  • bit_index: 位的索引(从 0 开始)。
Returns

True(1)或 False(0)。