| package |
Interval |
| since |
1.0.0 |
| todo |
Declare properties |
Methods
Create a new interval
__construct(float $inf, boolean $infIncluded, float $sup, boolean $supIncluded)
Parameters
$infIncluded
booleanThe included inf mark flag
$supIncluded
booleanThe included sup mark flag
Magic get method
__get(string $property) : mixed
Parameters
$property
stringThe property
Exceptions
\RuntimeException |
If the property does not exist |
Returns
mixedThe value associated to the property
Magic set method
__set(string $property, mixed $value) : void
Parameters
$property
stringThe property
$value
mixedThe new value
Exceptions
\RuntimeException |
If the property does not exist |
Convert the object to a string
__toString() : string
Returns
stringString representation of this object
Create a new closed Interval
closed(float $inf, float $sup) : \chdemko\Interval\Interval
Static
Parameters
Returns
\chdemko\Interval\IntervalA new Interval
Test if a value is contained in the interval
contains(float $value) : boolean
Parameters
$value
floatValue to be tested
Returns
booleanMembership of value
Copy an Interval
copy(\chdemko\Interval\Interval $interval) : \chdemko\Interval\Interval
Parameters
$interval
Returns
\chdemko\Interval\Interval$this for chaining
Create a new Interval from json
fromJson(string $json) : \chdemko\Interval\Interval
Static
Parameters
$json
stringA json encoded value
Returns
\chdemko\Interval\IntervalA new Interval
Create a new Interval from string
fromString(string $string) : \chdemko\Interval\Interval
Static
Parameters
$string
stringAn interval as a string
Returns
\chdemko\Interval\IntervalA new Interval
Compute the intersection with another interval
intersection(\chdemko\Interval\Interval $interval) : \chdemko\Interval\Interval
Parameters
$interval
\chdemko\Interval\IntervalInterval from which to compute intersection
Returns
\chdemko\Interval\Interval$this for chaining
Test if an interval is empty
isEmpty() : boolean
Returns
booleanTrue if the interval is empty
Serialize the object
jsonSerialize() : array
Returns
arrayArray of values
Create a new opened Interval
opened(float $inf, float $sup) : \chdemko\Interval\Interval
Static
Parameters
Returns
\chdemko\Interval\IntervalA new Interval
Create a new Interval containing all the real line
universe() : \chdemko\Interval\Interval
Static
Returns
\chdemko\Interval\IntervalA new Interval
Properties
inf mark
$inf : \chdemko\Interval\number
included inf mark flag
$infIncluded : boolean
sup mark
$sup : \chdemko\Interval\number
included sup mark flag
$supIncluded : boolean