Access keys

Range

Kind of class: class
Inherits from: CoreObject
Version: 11/30/06
Author: Aaron Clinger
Classpath: org.casaframework.math.Range
File last modified: Monday, 08 January 2007, 09:57:51
Creates a standardized way of describing and storing an amount or extent of variation/a value range.
Example:
var valueRange:Range = new Range(-100, 100);
trace(valueRange.getValueOfPercent(new Percent(.25)));

Summary

Constructor
Instance properties
Instance properties inherited from CoreObject

Constructor

Range

function Range (
startValue:Number, endValue:Number)
Creates and defines a Range object.
Parameters:
startValue:
[optional] Beginning value of the range.
endValue :
[optional] Ending value of the range.
Usage note:
You are not required to define the range in the contructor you can do it at any point by calling setRange.

Instance methods

clone

function clone (
) : Range
Returns:
A new range object with the same values as this range.

destroy

function destroy (
) : Void

equals

function equals (
range:Range) : Boolean
Determines whether the range specified in the range parameter is equal to this range object.
Parameters:
percent:
A defined Range object.
Returns:
Returns true if ranges are identical; otherwise false.

getEndValue

function getEndValue (
) : Number
Returns:
Returns the value of "endValue" as defined by Range or setRange.

getMaxValue

function getMaxValue (
) : Number
Returns:
Returns the maximum value of the range.

getMinValue

function getMinValue (
) : Number
Returns:
Returns the minimum value of the range.

getPercentOfValue

function getPercentOfValue (
value:Number) : Percent
Returns the percentage the value represents out of the range.
Parameters:
value:
An integer.
Returns:
A Percent object.

getStartValue

function getStartValue (
) : Number
Returns:
Returns the value of "startValue" as defined by Range or setRange.

getValueOfPercent

function getValueOfPercent (
percent:Percent) : Number
Calculates the percent of the range.
Parameters:
percent:
A defined Percent object.
Returns:
The value the percent represent of the range.

isWithinRange

function isWithinRange (
value:Number) : Boolean
Determines if value is included in the range including the range's start and end values.
Returns:
Returns true if value was included in range; otherwise false.

setRange

function setRange (
startValue:Number, endValue:Number) : Void
Defines or redefines range.
Parameters:
startValue:
Beginning value of the range.
endValue :
Ending value of the range.