Interval on the real line

package Interval
since 1.0.0
todo Declare properties

 Methods

Create a new interval

__construct(float $inf, boolean $infIncluded, float $sup, boolean $supIncluded) 
since 1.0.0

Parameters

$inf

float

The inf mark

$infIncluded

boolean

The included inf mark flag

$sup

float

The sup mark

$supIncluded

boolean

The included sup mark flag

Magic get method

__get(string $property) : mixed
since 1.0.0

Parameters

$property

string

The 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
since 1.0.0

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
since 1.0.0

Returns

stringString representation of this object

Create a new closed Interval

closed(float $inf, float $sup) : \chdemko\Interval\Interval
Static
since 1.0.0

Parameters

$inf

float

The inf mark

$sup

float

The sup mark

Returns

\chdemko\Interval\IntervalA new Interval

Test if a value is contained in the interval

contains(float $value) : boolean
since 1.0.0

Parameters

$value

float

Value to be tested

Returns

booleanMembership of value

Copy an Interval

copy(\chdemko\Interval\Interval $interval) : \chdemko\Interval\Interval
since 1.0.0

Parameters

$interval

Returns

\chdemko\Interval\Interval$this for chaining

Create a new Interval from json

fromJson(string $json) : \chdemko\Interval\Interval
Static
since 1.0.0

Parameters

$json

string

A json encoded value

Returns

\chdemko\Interval\IntervalA new Interval

Create a new Interval from string

fromString(string $string) : \chdemko\Interval\Interval
Static
since 1.0.0

Parameters

$string

string

An interval as a string

Returns

\chdemko\Interval\IntervalA new Interval

Compute the intersection with another interval

intersection(\chdemko\Interval\Interval $interval) : \chdemko\Interval\Interval
since 1.0.0

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
since 1.0.0

Returns

booleanTrue if the interval is empty

Serialize the object

jsonSerialize() : array
since 1.0.0

Returns

arrayArray of values

Create a new opened Interval

opened(float $inf, float $sup) : \chdemko\Interval\Interval
Static
since 1.0.0

Parameters

$inf

float

The inf mark

$sup

float

The sup mark

Returns

\chdemko\Interval\IntervalA new Interval

Create a new Interval containing all the real line

universe() : \chdemko\Interval\Interval
Static
since 1.0.0

Returns

\chdemko\Interval\IntervalA new Interval

 Properties

 

inf mark

$inf : \chdemko\Interval\number

Default

since 1.0.0
 

included inf mark flag

$infIncluded : boolean

Default

since 1.0.0
 

sup mark

$sup : \chdemko\Interval\number

Default

since 1.0.0
 

included sup mark flag

$supIncluded : boolean

Default

since 1.0.0