(indent string)
| 314 | } |
| 315 | |
| 316 | func (bA *BitArray) stringIndented(indent string) string { |
| 317 | lines := []string{} |
| 318 | bits := "" |
| 319 | for i := 0; i < bA.Bits; i++ { |
| 320 | if bA.getIndex(i) { |
| 321 | bits += "x" |
| 322 | } else { |
| 323 | bits += "_" |
| 324 | } |
| 325 | if i%100 == 99 { |
| 326 | lines = append(lines, bits) |
| 327 | bits = "" |
| 328 | } |
| 329 | if i%10 == 9 { |
| 330 | bits += indent |
| 331 | } |
| 332 | if i%50 == 49 { |
| 333 | bits += indent |
| 334 | } |
| 335 | } |
| 336 | if len(bits) > 0 { |
| 337 | lines = append(lines, bits) |
| 338 | } |
| 339 | return fmt.Sprintf("BA{%v:%v}", bA.Bits, strings.Join(lines, indent)) |
| 340 | } |
| 341 | |
| 342 | // Bytes returns the byte representation of the bits within the bitarray. |
| 343 | func (bA *BitArray) Bytes() []byte { |
no test coverage detected