Packageflare.data.converters
Classpublic class DelimitedTextConverter
ImplementsIDataConverter

Converts data between delimited text (e.g., tab delimited) and flare DataSet instances.



Public Properties
 PropertyDefined by
  delimiter : String
DelimitedTextConverter
Public Methods
 MethodDefined by
  
DelimitedTextConverter(delim:String = " ")
Creates a new DelimitedTextConverter.
DelimitedTextConverter
  
parse(text:String, schema:DataSchema = null):DataSet
Converts data from a tab-delimited string into ActionScript objects.
DelimitedTextConverter
  
read(input:IDataInput, schema:DataSchema = null):DataSet
Converts data from an external format into ActionScript objects.
DelimitedTextConverter
  
write(data:DataSet, output:IDataOutput = null):IDataOutput
Converts data from ActionScript objects into an external format.
DelimitedTextConverter
Protected Methods
 MethodDefined by
  
inferSchema(lines:Array):DataSchema
Infers the data schema by checking values of the input data.
DelimitedTextConverter
Property detail
delimiterproperty
delimiter:String  [read-write]Implementation
    public function get delimiter():String
    public function set delimiter(value:String):void
Constructor detail
DelimitedTextConverter()constructor
public function DelimitedTextConverter(delim:String = " ")

Creates a new DelimitedTextConverter.

Parameters
delim:String (default = " ") — the delimiter string separating values (tab by default)
Method detail
inferSchema()method
protected function inferSchema(lines:Array):DataSchema

Infers the data schema by checking values of the input data.

Parameters
lines:Array — an array of lines of input text

Returns
DataSchema — the inferred schema
parse()method 
public function parse(text:String, schema:DataSchema = null):DataSet

Converts data from a tab-delimited string into ActionScript objects.

Parameters
text:String — the loaded input data
 
schema:DataSchema (default = null) — a data schema describing the structure of the data. Schemas are optional in many but not all cases.

Returns
DataSet — an array of converted data objects. If the data argument is non-null, it is returned.
read()method 
public function read(input:IDataInput, schema:DataSchema = null):DataSet

Converts data from an external format into ActionScript objects.

Parameters
input:IDataInput — the loaded input data
 
schema:DataSchema (default = null) — a data schema describing the structure of the data. Schemas are optional in many but not all cases.

Returns
DataSet — a DataSet instance containing converted data objects.
write()method 
public function write(data:DataSet, output:IDataOutput = null):IDataOutput

Converts data from ActionScript objects into an external format.

Parameters
data:DataSet — the data set to write.
 
output:IDataOutput (default = null) — an object to which to write the output. If this value is null, a new ByteArray will be created.

Returns
IDataOutput — the converted data. If the output parameter is non-null, it is returned. Otherwise the return value will be a newly created ByteArray