The OpenD Programming Language

PosInfInterval

Represents an interval of time which has positive infinity as its end point.

Any ranges which iterate over a PosInfInterval are infinite. So, the main purpose of using PosInfInterval is to create an infinite range which starts at a fixed point in time and goes to positive infinity.

struct PosInfInterval (
TP
) {}

Constructors

this
this(TP begin)

Members

Functions

contains
bool contains(TP timePoint)

Whether the given time point is within this interval.

contains
bool contains(Interval!TP interval)

Whether the given interval is completely within this interval.

contains
bool contains(PosInfInterval interval)

Whether the given interval is completely within this interval.

contains
bool contains(NegInfInterval!TP interval)

Whether the given interval is completely within this interval.

expand
void expand(T years, T months, AllowDayOverflow allowOverflow)

Expands the interval forwards and/or backwards in time. Effectively, it subtracts the given number of months/years from begin.

expand
void expand(D duration)

Expands the interval backwards in time. Effectively, it does begin -= duration.

fwdRange
PosInfIntervalRange!(TP) fwdRange(TP delegate(scope const TP) func, PopFirst popFirst)

Returns a range which iterates forward over the interval, starting at begin, using func to generate each successive time point.

intersection
Interval!TP intersection(Interval!TP interval)

Returns the intersection of two intervals

intersection
PosInfInterval intersection(PosInfInterval interval)

Returns the intersection of two intervals

intersection
Interval!TP intersection(NegInfInterval!TP interval)

Returns the intersection of two intervals

intersects
bool intersects(Interval!TP interval)

Whether the given interval overlaps this interval.

intersects
bool intersects(PosInfInterval interval)

Whether the given interval overlaps this interval.

intersects
bool intersects(NegInfInterval!TP interval)

Whether the given interval overlaps this interval.

isAdjacent
bool isAdjacent(Interval!TP interval)

Whether the given interval is adjacent to this interval.

isAdjacent
bool isAdjacent(PosInfInterval interval)

Whether the given interval is adjacent to this interval.

isAdjacent
bool isAdjacent(NegInfInterval!TP interval)

Whether the given interval is adjacent to this interval.

isAfter
bool isAfter(TP timePoint)

Whether this interval is after the given time point.

isAfter
bool isAfter(Interval!TP interval)

Whether this interval is after the given interval and does not intersect it.

isAfter
bool isAfter(PosInfInterval interval)

Whether this interval is after the given interval and does not intersect it.

isAfter
bool isAfter(NegInfInterval!TP interval)

Whether this interval is after the given interval and does not intersect it.

isBefore
bool isBefore(TP timePoint)

Whether this interval is before the given time point.

isBefore
bool isBefore(Interval!TP interval)

Whether this interval is before the given interval and does not intersect it.

isBefore
bool isBefore(PosInfInterval interval)

Whether this interval is before the given interval and does not intersect it.

isBefore
bool isBefore(NegInfInterval!TP interval)

Whether this interval is before the given interval and does not intersect it.

merge
PosInfInterval merge(Interval!TP interval)

Returns the union of two intervals

merge
PosInfInterval merge(PosInfInterval interval)

Returns the union of two intervals

opAssign
PosInfInterval opAssign(PosInfInterval rhs)
opAssign
PosInfInterval opAssign(PosInfInterval rhs)
shift
void shift(D duration)

Shifts the begin of this interval forward or backwards in time by the given duration (a positive duration shifts the interval forward; a negative duration shifts it backward). Effectively, it does begin += duration.

shift
void shift(T years, T months, AllowDayOverflow allowOverflow)

Shifts the begin of this interval forward or backwards in time by the given number of years and/or months (a positive number of years and months shifts the interval forward; a negative number shifts it backward). It adds the years the given years and months to begin. It effectively calls add!"years"() and then add!"months"() on begin with the given number of years and months.

span
PosInfInterval span(Interval!TP interval)

Returns an interval that covers from the earliest time point of two intervals up to (but not including) the latest time point of two intervals.

span
PosInfInterval span(PosInfInterval interval)

Returns an interval that covers from the earliest time point of two intervals up to (but not including) the latest time point of two intervals.

toString
string toString()

Converts this interval to a string.

Properties

begin
TP begin [@property getter]

The starting point of the interval. It is included in the interval.

begin
TP begin [@property setter]

The starting point of the interval. It is included in the interval.

Variables

empty
enum bool empty;

Whether the interval's length is 0. Always returns false.

Meta