Interval is a pair of numbers or a pair of any comparable objects on which may be defined predicates equal, less and method max(p1, p1) that returns maximum in a pair. When interval is an object rather than pair of numbers, this object should have properties low, high, max and implement methods lessThan(), equalTo(), intersect(), notIntersect(), clone(), output(). Two static methods comparable_max(), comparable_less_than() define how to compare values in pair.
This interface is described in typescript definition file index.d.ts

Axis aligned rectangle is an example of such interval. We may look at rectangle as an interval between its low left and top right corners. See Box class Box library as the example of Interval interface implementation

interface Interval {
    high: any;
    low: any;
    max: any;
    clone(): Interval;
    equalTo(otherInterval: Interval): boolean;
    intersect(otherInterval: Interval): boolean;
    lessThan(otherInterval: Interval): boolean;
    merge(otherInterval: Interval): Interval;
    notIntersect(otherInterval: Interval): boolean;
    output(): [any, any];
}

Implemented by

Properties

high: any
low: any
max: any

Methods

  • Returns Interval

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns Interval

  • Parameters

    Returns boolean

  • Returns [any, any]