1 | <?php |
||
15 | class ArrayBitSet implements BitSet |
||
16 | { |
||
17 | const BITS = \PHP_INT_SIZE * 8; |
||
18 | |||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | public $numBits; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | public $array; |
||
28 | |||
29 | /** |
||
30 | * ArrayBitset constructor. |
||
31 | * |
||
32 | * @param int $numBits |
||
33 | */ |
||
34 | public function __construct(int $numBits) |
||
39 | |||
40 | /** |
||
41 | * @return void |
||
42 | */ |
||
43 | public function __clone() |
||
47 | |||
48 | /** |
||
49 | * @param int $i |
||
50 | * |
||
51 | * @return bool |
||
52 | */ |
||
53 | public function testBit(int $i): bool |
||
57 | |||
58 | /** |
||
59 | * @param int $i |
||
60 | */ |
||
61 | public function setBit(int $i) |
||
65 | |||
66 | /** |
||
67 | * @param int $i |
||
68 | */ |
||
69 | public function clearBit(int $i) |
||
73 | |||
74 | /** |
||
75 | * @param BitSet $other |
||
76 | * |
||
77 | * @return bool |
||
78 | */ |
||
79 | public function or(BitSet $other): bool |
||
92 | |||
93 | /** |
||
94 | * @return \Generator |
||
95 | */ |
||
96 | public function getIterator(): \Generator |
||
110 | } |
||
111 |