Package | org.axiis.data |
Class | public class DataSet |
Inheritance | DataSet ![]() |
Property | Defined By | ||
---|---|---|---|
columnCount : int [read-only]
The number of columns (attributes) in each Object in the data object. | DataSet | ||
data : Object [read-only]
The object produced during the most recent call to either
processXmlString, processCsvAsTable, pivotTable, or
aggregateData. | DataSet | ||
nullValues : String = NA, null
A comma-delimited string of values that DataSet should convert to
nulls as it encounters them while processing a CSV. | DataSet | ||
rowCount : int [read-only]
The number of rows (Objects) in the data object. | DataSet |
Method | Defined By | ||
---|---|---|---|
DataSet() | DataSet | ||
aggregateData(data:Object, collectionName:String, properties:Array):void
Perform simple aggregations against the "data" property by dynamically adding properties to the parent object. | DataSet | ||
aggregateTable(name:String, groupings:Array, summaryCols:Array = null):void
Groups table data into a hierarchal collection of | DataSet | ||
pivotTable(pivotColumn:int):void
Pivots a table, converting rows to columns and columns to rows. | DataSet | ||
processCsvAsTable(payload:String, addSummaryFields:Boolean = false):void
Converts a CSV Payload into a table structure
The structure has the following format:
data.rows[]
row.index = ordinal position
row.columns[] = array of columns
column.index = ordinal position
column.name = header name for column
- column.value = value
| DataSet | ||
processTsvAsTable(payload:String, addSummaryFields:Boolean = false):void
Converts a TSV Payload into a table structure
The structure has the following format:
data.rows[]
row.index = ordinal position
row.columns[] = array of columns
column.index = ordinal position
column.name = header name for column
- column.value = value
| DataSet | ||
processXmlString(payload:String):void
Converts XML into ActionScript objects. | DataSet |
Constant | Defined By | ||
---|---|---|---|
AGGREGATE_AVG : int = 2 [static] | DataSet | ||
AGGREGATE_SUM : int = 0 [static] | DataSet |
columnCount | property |
columnCount:int
[read-only] The number of columns (attributes) in each Object in the data object.
public function get columnCount():int
data | property |
data:Object
[read-only] The object produced during the most recent call to either processXmlString, processCsvAsTable, pivotTable, or aggregateData.
This property can be used as the source for data binding.
public function get data():Object
nullValues | property |
public var nullValues:String = NA, null
A comma-delimited string of values that DataSet should convert to nulls as it encounters them while processing a CSV.
rowCount | property |
rowCount:int
[read-only] The number of rows (Objects) in the data object.
public function get rowCount():int
DataSet | () | Constructor |
public function DataSet()
aggregateData | () | method |
public function aggregateData(data:Object, collectionName:String, properties:Array):void
Perform simple aggregations against the "data" property by dynamically adding properties to the parent object. Collections are traversed hierarchally (if you target a nested collection) and aggregations roll up the hierarchy. Aggregations are added as a dynamic object to the owner of the collection.
ownerObject.aggregates.propertyName_sum;
ownerObject.aggregates.propertyName_min;
ownerObject.aggregates.propertyName_max;
ownerObject.aggregates.propertyName_avg;
If data is a shapedDataSet (created from flattened hierachal CSV data) or TableData with columns,
aggregation will occur for each column under the aggregates object
aggregates.columns
where columns is an ArrayCollection of obj.min, obj.max, obj.sum, obj.avg
Parameters
data:Object — The name of the collection within the "data" property. You can use "." notation to drill down to it
| |
collectionName:String — An array of collection item properties you want to aggregate. You can use "." notation to drill down to specific objects within a collection item.
DEVELOPER NOTE: aggregateData will most likely be deprecated in a future release in favor of a more universal grouping and aggregation format.
| |
properties:Array |
aggregateTable | () | method |
public function aggregateTable(name:String, groupings:Array, summaryCols:Array = null):void
Groups table data into a hierarchal collection of
Parameters
name:String —
This function assumes you have already created a table structure within the DataSet, which currently can only be generated
via the processCsvAsTable() function;
| |
groupings:Array — property
SUM is currently the only aggregation supported and is stored in the | |
summaryCols:Array (default = null ) — property.
|
pivotTable | () | method |
public function pivotTable(pivotColumn:int):void
Pivots a table, converting rows to columns and columns to rows. Converted Column are given the new field "RowName" indicating their header.
Parameters
pivotColumn:int — The column to pivot
|
processCsvAsTable | () | method |
public function processCsvAsTable(payload:String, addSummaryFields:Boolean = false):void
Converts a CSV Payload into a table structure
The structure has the following format:
Parameters
payload:String — The CSV formatted text to convert.
| |
addSummaryFields:Boolean (default = false ) — When true, this method will dynamically add
min and max values to each row for each column.
|
processTsvAsTable | () | method |
public function processTsvAsTable(payload:String, addSummaryFields:Boolean = false):void
Converts a TSV Payload into a table structure
The structure has the following format:
Parameters
payload:String — The TSV formatted text to convert.
| |
addSummaryFields:Boolean (default = false ) — When true, this method will dynamically add
min and max values to each row for each column.
|
processXmlString | () | method |
public function processXmlString(payload:String):void
Converts XML into ActionScript objects. Each element becomes and object and each attribute becomes a property.
Parameters
payload:String — The XML string to be converted.
|
AGGREGATE_AVG | Constant |
public static const AGGREGATE_AVG:int = 2
AGGREGATE_SUM | Constant |
public static const AGGREGATE_SUM:int = 0