The OpenD Programming Language

Interval.isAdjacent

Whether the given interval is adjacent to this interval.

  1. bool isAdjacent(Interval interval)
    struct Interval(TP)
    const pure
    bool
    isAdjacent
    (
    scope const Interval interval
    )
  2. bool isAdjacent(PosInfInterval!TP interval)
  3. bool isAdjacent(NegInfInterval!TP interval)

Parameters

interval Interval

The interval to check whether its adjecent to this interval.

Throws

std.datetime.date.DateTimeException if either interval is empty.

Examples

assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
            Interval!Date(Date(1990, 7, 6), Date(1996, 1, 2))));

assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
            Interval!Date(Date(2012, 3, 1), Date(2013, 9, 17))));

assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
            Interval!Date(Date(1989, 3, 1), Date(2012, 3, 1))));

Meta