Options
All
  • Public
  • Public/Protected
  • All
Menu

A pair of minimum and maximum values. A range can be fixed which means the minimum and maximum are equivalent - in which case the range behaves like a Value.

Hierarchy

  • Range

Index

Constructors

constructor

  • Creates a new instance of Range given the minimum and maximum values.

    Parameters

    • min: Value

      The minimum value for the range.

    • max: Value

      The maximum value for the range.

    Returns Range

Properties

max

max: Value

The maximum value in the range.

min

min: Value

The minimum value in the range.

Static INVALID

INVALID: Range = new Range( Value.INVALID, Value.INVALID )

A range instance which contains invalid values.

Accessors

average

average:

The average number between the min and max.

isDecimal

isDecimal:

True if the min and max are decimal.

isFixed

isFixed:

True if the min and max are the same value.

isFraction

isFraction:

True if the min or max are a fraction.

isRange

isRange:

True if the min and max are not the same value.

isRate

isRate:

True if one of min and max are rates.

isSingular

isSingular:

True if the min and max are both singular (1 or -1).

isValid

isValid:

True if the min and max are both valid.

isZero

isZero:

True if the min and max are both equal to zero.

maximum

maximum:

The maximum value of this range.

minimum

minimum:

The minimum value of this range.

unit

unit:

The unit which identifies the group of the minimum value or null if the minimum value does not have a group.

value

value:

The minimum value of this range.

Methods

add

  • Adds this range and a given range (optionally scaled by a factor) together.

    see

    Value.add

    Parameters

    • addend: Range

      The range to add to this instance.

    • Default value scale: number = 1

      The factor to multiply the addend by when added it to this instance.

    Returns Range

    a new range.

fractioned

  • Returns a range which is coerced into being represented by fractions if a valid fraction can be determined from the units valid denominators.

    see

    Value.fractioned

    Returns Range

    A new range if the minimum and maximum are not fractions, otherwise the reference to this range is returned.

isExactMatch

  • isExactMatch(range: Range): boolean
  • Determines if the given range matches this range enough to allow a simple mathematical operation between the two ranges.

    Parameters

    • range: Range

      The range to test.

    Returns boolean

    True if the groups of the given range match this range.

isMatch

  • Determines if the given range matches this range enough to allow a complex mathematical operation between the two ranges.

    Parameters

    • min: Value

      The minimum of the range to test.

    • max: Value

      The maximum of the range to test.

    Returns boolean

    True if the min and max have compatible values.

maxd

  • Returns Range

    A range with only the maximum value from this range.

mind

  • Returns Range

    A range with only the minimum value from this range.

mul

  • Multiplies this range by a scale value.

    see

    Value.mul

    Parameters

    • scale: Value

      The amount to multiply the range by.

    Returns Range

    A new range.

negative

  • Returns Range

    A range which has only negative values. If the range is entirely positive then null is returned.

nonzero

  • Returns Range

    A range which has a non-zero min and max. If both are equial to zero then null is returned.

normalize

  • Creates a range with with units that best represent the values. This may cause the minimum and maximum values to have different units.

    see

    Value.normalize

    Parameters

    • transform: Transform

      Options to control which units and values are acceptable.

    • forOutput: Output

      The output options that should be used to determine which value & unit is best.

    Returns Range

    A new range.

numbered

  • Returns a range which has any fraction values converted to numbers.

    see

    Value.numbered

    Returns Range

    A new range if the mimimum or maximum are fractions, otherwise the the reference to this range is returned.

output

  • Converts this range to a string with the given output options taking into account the global options.

    see

    Output

    Parameters

    • Optional options: OutputInput

      The options to override the global output options.

    Returns string

    The string representation of this instance.

positive

  • Returns Range

    A range which has only positive values. If the range is entirely negative then null is returned.

preferred

scale

  • scale(scale: number): Range
  • Multiplies this range by a scalar factor.

    see

    Value.scale

    Parameters

    • scale: number

      The amount to multiply the range by.

    Returns Range

    A new range.

sub

  • Subtracts a given range (optionally scaled by a factor) from this range.

    see

    Value.sub

    Parameters

    • subtrahend: Range

      The range to remove from this instance.

    • Default value scale: number = 1

      The factor to multiply the subtrahend by when subtracting it from this instance.

    Returns Range

    A new range.

Static fromFixed

  • Creates a fixed range from a given value. A fixed range behaves essentially as a value since the minimum and maximum are equivalent.

    Parameters

    • fixed: Value

      The value to be used as the min and max of the range.

    Returns Range

    A new fixed range.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc