Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace OpenSpout\Reader\ODS;
6
 
7
use OpenSpout\Reader\SheetWithVisibilityInterface;
8
 
9
/**
10
 * @implements SheetWithVisibilityInterface<RowIterator>
11
 */
1441 ariadna 12
final readonly class Sheet implements SheetWithVisibilityInterface
1 efrain 13
{
14
    /** @var RowIterator To iterate over sheet's rows */
1441 ariadna 15
    private RowIterator $rowIterator;
1 efrain 16
 
17
    /** @var int Index of the sheet, based on order in the workbook (zero-based) */
1441 ariadna 18
    private int $index;
1 efrain 19
 
20
    /** @var string Name of the sheet */
1441 ariadna 21
    private string $name;
1 efrain 22
 
23
    /** @var bool Whether the sheet was the active one */
1441 ariadna 24
    private bool $isActive;
1 efrain 25
 
26
    /** @var bool Whether the sheet is visible */
1441 ariadna 27
    private bool $isVisible;
1 efrain 28
 
29
    /**
30
     * @param RowIterator $rowIterator    The corresponding row iterator
31
     * @param int         $sheetIndex     Index of the sheet, based on order in the workbook (zero-based)
32
     * @param string      $sheetName      Name of the sheet
33
     * @param bool        $isSheetActive  Whether the sheet was defined as active
34
     * @param bool        $isSheetVisible Whether the sheet is visible
35
     */
36
    public function __construct(RowIterator $rowIterator, int $sheetIndex, string $sheetName, bool $isSheetActive, bool $isSheetVisible)
37
    {
38
        $this->rowIterator = $rowIterator;
39
        $this->index = $sheetIndex;
40
        $this->name = $sheetName;
41
        $this->isActive = $isSheetActive;
42
        $this->isVisible = $isSheetVisible;
43
    }
44
 
45
    public function getRowIterator(): RowIterator
46
    {
47
        return $this->rowIterator;
48
    }
49
 
50
    /**
51
     * @return int Index of the sheet, based on order in the workbook (zero-based)
52
     */
53
    public function getIndex(): int
54
    {
55
        return $this->index;
56
    }
57
 
58
    /**
59
     * @return string Name of the sheet
60
     */
61
    public function getName(): string
62
    {
63
        return $this->name;
64
    }
65
 
66
    /**
67
     * @return bool Whether the sheet was defined as active
68
     */
69
    public function isActive(): bool
70
    {
71
        return $this->isActive;
72
    }
73
 
74
    /**
75
     * @return bool Whether the sheet is visible
76
     */
77
    public function isVisible(): bool
78
    {
79
        return $this->isVisible;
80
    }
81
}