* 将位集合转换为可读字符串 * @returns 格式为"Bits[index1, index2, ...]"的字符串
()
| 222 | * @returns 格式为"Bits[index1, index2, ...]"的字符串 |
| 223 | */ |
| 224 | public toString(): string { |
| 225 | const bits: string[] = []; |
| 226 | for (let i = 0; i < 64; i++) { |
| 227 | if (this.get(i)) { |
| 228 | bits.push(i.toString()); |
| 229 | } |
| 230 | } |
| 231 | return `Bits[${bits.join(', ')}]`; |
| 232 | } |
| 233 | |
| 234 | /** |
| 235 | * 将位集合转换为二进制字符串 |
no test coverage detected