Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TypeRange<T>

Represents a simple range with a minimum and a maximum. Inclusivity is controlled through bounds.

Type parameters

  • T

Hierarchy

Implements

Index

Constructors

constructor

  • Parameters

    • cf: DualCompareFunction<T>

      A compare function that is used to compare two T

    • Optional min: T

      The minimum value

    • Optional max: T

      The maximum value

    • Default value bounds: RangeBounds = RangeBounds.LCGC

      The inclusivity bounds to use

    Returns TypeRange

Properties

bounds

bounds: RangeBounds

The inclusivity bounds to use

Readonly cf

A compare function that is used to compare two T

Optional max

max: T

The maximum value

Optional min

min: T

The minimum value

Accessors

def_max

  • get def_max(): boolean

def_min

  • get def_min(): boolean
  • Returns boolean

    True if min is defined (not negative infinity)

undef_max

  • get undef_max(): boolean
  • Returns boolean

    True if max is undefined (Representing infinity)

undef_min

  • get undef_min(): boolean
  • Returns boolean

    True if min is undefined (Representing negative infinity)

Methods

bound_def

bound_undef

compareEndpoints

  • Compares this range's endpoints to endpoints of another range. The comparison is relative to this (ex, it will be 1 if this is greater)

    Parameters

    Returns CompareResult

    The result of the comparison

contains

  • contains(t: T): boolean

doesContainInRange

  • doesContainInRange(r: TypeRange<T>): boolean

getRangeSection

  • Finds out if t is less than (-1), inside (0), or greater than (1) this range

    Parameters

    • t: T

      The object to compare

    Returns CompareResult

mayContainInRange

  • mayContainInRange(r: TypeRange<T>): boolean

toString

  • toString(): string

Static all

Static gt

Static gteq

Static lt

Static lteq

Generated using TypeDoc