| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class TupleId implements IComparable |
||
| 18 | { |
||
| 19 | use ComparableWithPhpOperators; |
||
| 20 | |||
| 21 | private $blockNumber; |
||
| 22 | private $tupleIndex; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param int $blockNumber number of block within which the row is stored |
||
| 26 | * @param int $tupleIndex index with the block where the row is stored |
||
| 27 | * @return TupleId |
||
| 28 | */ |
||
| 29 | public static function fromCoordinates(int $blockNumber, int $tupleIndex): TupleId |
||
| 30 | { |
||
| 31 | return new TupleId($blockNumber, $tupleIndex); |
||
| 32 | } |
||
| 33 | |||
| 34 | private function __construct(int $blockNumber, int $tupleIndex) |
||
| 35 | { |
||
| 36 | $this->blockNumber = $blockNumber; |
||
| 37 | $this->tupleIndex = $tupleIndex; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return int number of block within which the row is stored |
||
| 42 | */ |
||
| 43 | public function getBlockNumber(): int |
||
| 44 | { |
||
| 45 | return $this->blockNumber; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return int index with the block where the row is stored |
||
| 50 | */ |
||
| 51 | public function getTupleIndex(): int |
||
| 54 | } |
||
| 55 | } |
||
| 56 |