Antidot PHP API  version 0.16.0
##PHP API to simplify integration of Antidot components
 All Classes Files Functions Variables Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
AfsInterval Class Reference

Helper to make intervals. More...

Public Member Functions

 __construct ($lower_bound, $upper_bound=null)
 Constructs new interval helper.
 get_lower_bound ()
 Retrieves interval lower bound.
 exclude_lower_bound ()
 Excludes lower bound from the interval.
 is_lower_bound_excluded ()
 Checks wether lower bound is excluded or not.
 get_upper_bound ()
 Retrieves interval upper bound.
 exclude_upper_bound ()
 Excludes upper bound from the interval.
 is_upper_bound_excluded ()
 Checks wether upper bound is excluded or not.
 __toString ()
 Serialize this instance in string format.

Static Public Member Functions

static create ($lower_bound=null, $upper_bound=null)
 Creates new interval helper.
static parse ($value)
 Creates new interval helper from string.

Detailed Description

Helper to make intervals.

Constructor & Destructor Documentation

__construct (   $lower_bound,
  $upper_bound = null 
)

Constructs new interval helper.

Initialize new AfsInterval with at least one interval bound.

Parameters
$lower_bound[in] Lower bound of the interval.
$upper_bound[in] Upper bound of the interval (default: null).
Exceptions
AfsIntervalBoundExceptionwhen both boundaries are null.

Member Function Documentation

__toString ( )

Serialize this instance in string format.

Returned value can be used to recreate new interval using AfsInterval::parse method.

Returns
string representation of the instance.
static create (   $lower_bound = null,
  $upper_bound = null 
)
static

Creates new interval helper.

Initialize new AfsInterval with at least one interval bound.

Parameters
$lower_bound[in] Lower bound of the interval (default: null).
$upper_bound[in] Upper bound of the interval (default: null).
Exceptions
AfsIntervalBoundExceptionwhen both boundaries are null.
exclude_lower_bound ( )

Excludes lower bound from the interval.

By default, both boundaries are included.

exclude_upper_bound ( )

Excludes upper bound from the interval.

By default, both boundaries are included.

get_lower_bound ( )

Retrieves interval lower bound.

Returns
lower bound of the interval.
get_upper_bound ( )

Retrieves interval upper bound.

Returns
upper bound of the interval.
is_lower_bound_excluded ( )

Checks wether lower bound is excluded or not.

Returns
True when lower bound is excluded from the interval, false otherwise.
is_upper_bound_excluded ( )

Checks wether upper bound is excluded or not.

Returns
True when upper bound is excluded from the interval, false otherwise.
static parse (   $value)
static

Creates new interval helper from string.

Parameters
$value[in] String value to parse in order to create new AfsInterval instance.
Returns
newly created instance.