Packagecom.asterisq.graph.parsers
Classpublic class AsyncGraphParser
InheritanceAsyncGraphParser Inheritance GraphParser Inheritance flash.events.EventDispatcher
ImplementsIGraphParser

Base class for parsing graph data asynchornously. This implementation uses an AsyncProcessor to split the processing across multiple frames. This class is useful for parsing large amounts of data without freezing up the UI or causing script timeout errors.

When subclassing the AsyncGraphParser, you will need to set override two methods: parse and parseStep. The parse method should be used to initialize the parsing and make a call to startParsing. The parseStep method should be used to perform a small step in the parsing, such as reading and parsing an single line of graph data. This method will be called repeatedly each frame until the processing time limit is reached or the job parsing is complete.



Public Properties
 PropertyDefined by
  processingTimeLimit : Number
The maximum amount of time allowed for processing during a single frame.
AsyncGraphParser
Public Methods
 MethodDefined by
  
Creates a new graph parser.
AsyncGraphParser
 Inherited
fromXML(graphParserElem:XML):IGraphParser
[static] Creates an IGraphParser instance and initializes it with the given XML data.
GraphParser
  
parse(graph:IGraph, data:*):void
Starts parsing a graph from raw data.
AsyncGraphParser
Protected Methods
 MethodDefined by
 Inherited
loadValuesFromXML(graphParserElem:XML):void
Load values from the given XML element into this GraphParser.
GraphParser
  
parseStep():Boolean
Performs a small step in the parsing.
AsyncGraphParser
  
startParsing():void
Starts asynchronous parsing of the graph data.
AsyncGraphParser
Property detail
processingTimeLimitproperty
processingTimeLimit:Number  [read-write]

The maximum amount of time allowed for processing during a single frame. Keep this number below the duration of each frame.

Implementation
    public function get processingTimeLimit():Number
    public function set processingTimeLimit(value:Number):void
Constructor detail
AsyncGraphParser()constructor
public function AsyncGraphParser()

Creates a new graph parser.

Method detail
parse()method
public override function parse(graph:IGraph, data:*):void

Starts parsing a graph from raw data. This method should be overridden to setup the parsing and make a call to startParsing.

Parameters
graph:IGraph
 
data:*
parseStep()method 
protected function parseStep():Boolean

Performs a small step in the parsing. This method should be overridden to do a small portion of parsing. The method should return true if parsing is complete, or false otherwise. When this method returns true, it will no longer be called until startParsing is called again.

When this method returns true, the graph parser will dispatch a Event.COMPLETE event.

Returns
Boolean
startParsing()method 
protected function startParsing():void

Starts asynchronous parsing of the graph data. This causes parseStep to be called repeatedly until it returns true.