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
boolean
The included inf mark flag
$supIncluded
boolean
The included sup mark flag
Magic get method
__get(string $property) : mixed
Parameters
$property
string
The property
Exceptions
\RuntimeException |
If the property does not exist |
Returns
mixed
The value associated to the property
Magic set method
__set(string $property, mixed $value) : void
Parameters
$property
string
The property
$value
mixed
The new value
Exceptions
\RuntimeException |
If the property does not exist |
Convert the object to a string
__toString() : string
Returns
string
String representation of this object
Create a new closed Interval
closed(float $inf, float $sup) : \chdemko\Interval\Interval
Static
Parameters
Returns
\chdemko\Interval\Interval
A new Interval
Test if a value is contained in the interval
contains(float $value) : boolean
Parameters
$value
float
Value to be tested
Returns
boolean
Membership 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
string
A json encoded value
Returns
\chdemko\Interval\Interval
A new Interval
Create a new Interval from string
fromString(string $string) : \chdemko\Interval\Interval
Static
Parameters
$string
string
An interval as a string
Returns
\chdemko\Interval\Interval
A new Interval
Compute the intersection with another interval
intersection(\chdemko\Interval\Interval $interval) : \chdemko\Interval\Interval
Parameters
$interval
\chdemko\Interval\Interval
Interval from which to compute intersection
Returns
\chdemko\Interval\Interval
$this for chaining
Test if an interval is empty
isEmpty() : boolean
Returns
boolean
True if the interval is empty
Serialize the object
jsonSerialize() : array
Returns
array
Array of values
Create a new opened Interval
opened(float $inf, float $sup) : \chdemko\Interval\Interval
Static
Parameters
Returns
\chdemko\Interval\Interval
A new Interval
Create a new Interval containing all the real line
universe() : \chdemko\Interval\Interval
Static
Returns
\chdemko\Interval\Interval
A 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