ILIAS
release_8 Revision v8.23
|
A simple class to express a range of whole positive numbers. More...
Public Member Functions | |
__construct (int $start, int $length) | |
unpack () | |
getStart () | |
getLength () | |
getEnd () | |
getEnd will return the (excluded) endpoint. More... | |
withStart (int $start) | |
withLength (int $length) | |
croppedTo (int $max) | |
This will create a range that is guaranteed to not exceed $max. More... | |
Protected Member Functions | |
checkStart (int $start) | |
checkLength (int $length) | |
Protected Attributes | |
int | $start |
int | $length |
A simple class to express a range of whole positive numbers.
Range is a half-open interval (right-open): [a,b) = {x ∈ ℕ: a ≤ x < b}. Since the endpoint is excluded, a Range of 0,3 means: records 0,1,2, but not 3.
ILIAS\Data\Range::__construct | ( | int | $start, |
int | $length | ||
) |
Definition at line 35 of file Range.php.
References ILIAS\Data\Range\$length, ILIAS\Data\Range\$start, ILIAS\Data\Range\checkLength(), and ILIAS\Data\Range\checkStart().
|
protected |
Definition at line 50 of file Range.php.
Referenced by ILIAS\Data\Range\__construct(), and ILIAS\Data\Range\withLength().
|
protected |
Definition at line 43 of file Range.php.
Referenced by ILIAS\Data\Range\__construct(), and ILIAS\Data\Range\withStart().
ILIAS\Data\Range::croppedTo | ( | int | $max | ) |
This will create a range that is guaranteed to not exceed $max.
Definition at line 104 of file Range.php.
References ILIAS\Data\Range\getEnd(), ILIAS\Data\Range\getStart(), and ILIAS\Data\Range\withLength().
Referenced by ILIAS\UI\Implementation\Component\Table\Data\applyViewControls().
ILIAS\Data\Range::getEnd | ( | ) |
getEnd will return the (excluded) endpoint.
For a Range of (4,2), e.g.: getEnd is 4 + 2 = 6, so valid records are 4 and 5, but not 6.
Definition at line 76 of file Range.php.
References ILIAS\Data\Range\$length.
Referenced by ILIAS\Data\Range\croppedTo(), RangeTest\testEndCalculation(), RangeTest\testWithLength(), and RangeTest\testWithStart().
ILIAS\Data\Range::getLength | ( | ) |
Definition at line 67 of file Range.php.
References ILIAS\Data\Range\$length.
Referenced by ILIAS\UI\examples\Table\Data\base(), ILIAS\UI\Implementation\Component\Table\Data\getViewControlPagination(), RangeTest\testValues(), RangeTest\testWithLength(), and RangeTest\testWithStart().
ILIAS\Data\Range::getStart | ( | ) |
Definition at line 62 of file Range.php.
References ILIAS\Data\Range\$start.
Referenced by ILIAS\UI\examples\Table\Data\base(), ILIAS\Data\Range\croppedTo(), ILIAS\UI\Implementation\Component\Table\Data\getViewControlPagination(), RangeTest\testValues(), RangeTest\testWithLength(), and RangeTest\testWithStart().
ILIAS\Data\Range::unpack | ( | ) |
Definition at line 57 of file Range.php.
References ILIAS\Data\Range\$length, and ILIAS\Data\Range\$start.
Referenced by ILIAS\UI\examples\Table\Data\DataTableDemoRepo\doSelect(), ILIAS\UI\Implementation\Component\Input\ViewControl\Pagination\getCorrectOffsetForPageSize(), and RangeTest\testUnpack().
ILIAS\Data\Range::withLength | ( | int | $length | ) |
Definition at line 93 of file Range.php.
References ILIAS\Data\Range\$length, and ILIAS\Data\Range\checkLength().
Referenced by ILIAS\Data\Range\croppedTo(), RangeTest\testNegativeLength(), and RangeTest\testWithLength().
ILIAS\Data\Range::withStart | ( | int | $start | ) |
Definition at line 85 of file Range.php.
References ILIAS\Data\Range\$start, and ILIAS\Data\Range\checkStart().
Referenced by RangeTest\testNegativeStart(), and RangeTest\testWithStart().
|
protected |
Definition at line 33 of file Range.php.
Referenced by ILIAS\Data\Range\__construct(), ILIAS\Data\Range\getEnd(), ILIAS\Data\Range\getLength(), ILIAS\Data\Range\unpack(), and ILIAS\Data\Range\withLength().
|
protected |
Definition at line 32 of file Range.php.
Referenced by ILIAS\Data\Range\__construct(), ILIAS\Data\Range\getStart(), ILIAS\Data\Range\unpack(), and ILIAS\Data\Range\withStart().