Packageflare.data
Classpublic class DataUtil

Utility class for parsing and representing data field values.



Public Methods
 MethodDefined by
  
inferSchema(tuples:Array):DataSchema
[static] Infers the data schema by checking values of the input data.
DataUtil
  
parseValue(val:Object, type:int):Object
[static] Parse an input value given its data type.
DataUtil
  
type(s:String):int
[static] Returns the data type for the input string value.
DataUtil
Public Constants
 ConstantDefined by
  BOOLEAN : int = 5
[static] Constant indicating a boolean data type.
DataUtil
  DATE : int = 2
[static] Constant indicating a Date data type.
DataUtil
  INT : int = 1
[static] Constant indicating an integer data type.
DataUtil
  NUMBER : int = 0
[static] Constant indicating a numeric data type.
DataUtil
  OBJECT : int = 4
[static] Constant indicating an arbitrary Object data type.
DataUtil
  STRING : int = 3
[static] Constant indicating a String data type.
DataUtil
Method detail
inferSchema()method
public static function inferSchema(tuples:Array):DataSchema

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

Parameters
tuples:Array — an array of data tuples

Returns
DataSchema — the inferred schema
parseValue()method 
public static function parseValue(val:Object, type:int):Object

Parse an input value given its data type.

Parameters
val:Object — the value to parse
 
type:int — the data type to parse as

Returns
Object — the parsed data value
type()method 
public static function type(s:String):int

Returns the data type for the input string value. This method attempts to parse the value as a number of different data types. If successful, the matching data type is returned. If no parse succeeds, this method returns the STRING constant.

Parameters
s:String — the string to parse

Returns
int — the inferred data type of the string contents
Constant detail
BOOLEANconstant
public static const BOOLEAN:int = 5

Constant indicating a boolean data type.

DATEconstant 
public static const DATE:int = 2

Constant indicating a Date data type.

INTconstant 
public static const INT:int = 1

Constant indicating an integer data type.

NUMBERconstant 
public static const NUMBER:int = 0

Constant indicating a numeric data type.

OBJECTconstant 
public static const OBJECT:int = 4

Constant indicating an arbitrary Object data type.

STRINGconstant 
public static const STRING:int = 3

Constant indicating a String data type.