Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Interval<T>

An interval, defined by a minimum and maximum with respective open or closed endpoints.

Type parameters

  • T

    The data type used in the interval. E.g. {@link Double}.

Hierarchy

  • Interval

Index

Constructors

constructor

  • Initializes a new instance of an Interval.

    Parameters

    • minimum: T

      The minimum value in the interval.

    • maximum: T

      The maximum value in the interval.

    • minimumEndPoint: IntervalEndPoint

      The end point type for the minimum value.

    • maximumEndPoint: IntervalEndPoint

      The end point type for the maximum value.

    Returns Interval

  • Initializes a new instance of an Interval.

    Returns Interval

Accessors

maximum

  • get maximum(): T
  • set maximum(value: T): void
  • Gets the maximum interval value.

    Returns T

    The maximum value in the interval.

  • Sets the maximum interval value.

    Parameters

    • value: T

      The maximum value in the interval.

    Returns void

    The maximum value in the interval.

maximumEndPoint

  • Gets the end point type for the maximum value of the interval.

    Returns IntervalEndPoint

  • Sets the end point type for the maximum value of the interval.

    Parameters

    Returns void

minimum

  • get minimum(): T
  • set minimum(value: T): void
  • Gets the minimum interval value.

    Returns T

    The minimum value in the interval.

  • Sets the minimum interval value.

    Parameters

    • value: T

      The minimum value in the interval.

    Returns void

    The minimum value in the interval.

minimumEndPoint

  • Gets the end point type for the minimum value of the interval.

    Returns IntervalEndPoint

  • Sets the end point type for the minimum value of the interval.

    Parameters

    Returns void

Methods

compareTo

  • compareTo(value: T): number
  • inheritdoc

    Parameters

    • value: T

    Returns number

contains

  • contains(value: T): boolean
  • Determines whether a value is within this interval.

    Parameters

    • value: T

      The value to check.

    Returns boolean

    true if the value is contained in the interval, false otherwise.

toString

  • toString(): string
  • inheritdoc

    Returns string