| Package | flare.util |
| Class | public class Stats |
| Property | Defined by | ||
|---|---|---|---|
| average : Number [read-only] The average of all the values (for numerical data).
| Stats | ||
| count : Number [read-only] The total number of values.
| Stats | ||
| dataType : int [read-only] The data type of the collection, one of NUMBER, DATE, or OBJECT.
| Stats | ||
| distinct : Number [read-only] The total number of distinct values.
| Stats | ||
| distinctValues : Array [read-only] A sorted array of all unique values in the collection.
| Stats | ||
| maxDate : Date [read-only] The maximum value (for date/time values).
| Stats | ||
| maximum : Number [read-only] The maximum value (for numerical data).
| Stats | ||
| maxObject : Object [read-only] The maximum value (for arbitrary objects).
| Stats | ||
| minDate : Date [read-only] The minimum value (for date/time values).
| Stats | ||
| minimum : Number [read-only] The minimum value (for numerical data).
| Stats | ||
| minObject : Object [read-only] The minimum value (for arbitrary objects).
| Stats | ||
| stddev : Number [read-only] The standard deviation of all the values (for numerical data).
| Stats | ||
| stderr : Number [read-only] The standard error of all the values (for numerical data).
| Stats | ||
| sum : Number [read-only] The sum of all the values (for numerical data).
| Stats | ||
| values : Array [read-only] A sorted array of all the values.
| Stats | ||
| Method | Defined by | ||
|---|---|---|---|
|
Stats(data:Array, field:String = null, comparator:Function = null, copy:Boolean = true)
Creates a new Stats instance using the given input data.
| Stats | ||
|
equal(a:*, b:*):Boolean
[static]
Tests for equality between two values.
| Stats | ||
| Constant | Defined by | ||
|---|---|---|---|
| DATE : int = 1 [static] Constant indicating date/time values.
| Stats | ||
| NUMBER : int = 0 [static] Constant indicating numerical values.
| Stats | ||
| OBJECT : int = 2 [static] Constant indicating arbitrary object values.
| Stats | ||
| average | property |
average:Number [read-only]The average of all the values (for numerical data).
Implementation public function get average():Number
| count | property |
count:Number [read-only]The total number of values.
Implementation public function get count():Number
| dataType | property |
dataType:int [read-only]The data type of the collection, one of NUMBER, DATE, or OBJECT.
Implementation public function get dataType():int
| distinct | property |
distinct:Number [read-only]The total number of distinct values.
Implementation public function get distinct():Number
| distinctValues | property |
distinctValues:Array [read-only]A sorted array of all unique values in the collection.
Implementation public function get distinctValues():Array
| maxDate | property |
maxDate:Date [read-only]The maximum value (for date/time values).
Implementation public function get maxDate():Date
| maximum | property |
maximum:Number [read-only]The maximum value (for numerical data).
Implementation public function get maximum():Number
| maxObject | property |
maxObject:Object [read-only]The maximum value (for arbitrary objects).
Implementation public function get maxObject():Object
| minDate | property |
minDate:Date [read-only]The minimum value (for date/time values).
Implementation public function get minDate():Date
| minimum | property |
minimum:Number [read-only]The minimum value (for numerical data).
Implementation public function get minimum():Number
| minObject | property |
minObject:Object [read-only]The minimum value (for arbitrary objects).
Implementation public function get minObject():Object
| stddev | property |
stddev:Number [read-only]The standard deviation of all the values (for numerical data).
Implementation public function get stddev():Number
| stderr | property |
stderr:Number [read-only]The standard error of all the values (for numerical data).
Implementation public function get stderr():Number
| sum | property |
sum:Number [read-only]The sum of all the values (for numerical data).
Implementation public function get sum():Number
| values | property |
values:Array [read-only]A sorted array of all the values.
Implementation public function get values():Array
| Stats | () | constructor |
public function Stats(data:Array, field:String = null, comparator:Function = null, copy:Boolean = true)Creates a new Stats instance using the given input data. If the field argument is null, it is assumed that the input data array directly contains the values to analyze. If the field argument is non-null, values will be extracted from the objects in the input array using the specified property name.
Parametersdata:Array — an input data array. The data to analyze may be
contained directly in the array, or may be properties of the
objects contained in the array.
|
|
field:String (default = null) — a property name. This property will be used to extract
data values from the objects in the data array. If null, the
objects in the data array will be used directly.
|
|
comparator:Function (default = null) — the comparator function to use to sort the data.
If null, the natural sort order will be used.
|
|
copy:Boolean (default = true) — flag indicating if the input data array should be
copied to a new array. This flag only applied when the field
argument is null. In false, the input data array will be sorted.
If true, the array will be copied before being sorted. The default
behavior is to make a copy.
|
| equal | () | method |
public static function equal(a:*, b:*):Boolean
Tests for equality between two values. This method is necessary
because the == operator checks object equality and
not value equality for Date instances.
a:* — the first object to compare
|
|
b:* — the second object to compare
|
Boolean |
| DATE | constant |
public static const DATE:int = 1Constant indicating date/time values.
| NUMBER | constant |
public static const NUMBER:int = 0Constant indicating numerical values.
| OBJECT | constant |
public static const OBJECT:int = 2Constant indicating arbitrary object values.