TextFile2Array

Kind of class:class
Inherits from:TextFile2Collection < Dispatcher
Author:Arthur Clemens
Classpath:org.asapframework.data.filedatatransform.TextFile2Array
File last modified:Sunday, 17 September 2006, 01:57:17
Transforms the contents of a text file to an array by splitting the text in lines.
Lines that start with '#' are ignored.

Important: the file's text file should have Unix or DOS line endings.
Events broadcasted to listeners:

Summary


Constructor
  • TextFile2Array (inFileUrl:String, inListener:Object, inArray:Array)
    • Creates a new TextFile2Array instance.
Instance properties
Instance properties inherited from TextFile2Collection
Instance methods
  • parse (inSource:String) : Void
    • Splits the received text data in lines and adds them to the Array passed in TextFile2Array; if no Array was passed to the constructor, a new Array object is created.
  • notifyFinished : Void
    • Called when parsing is done.

Constructor

TextFile2Array

function TextFile2Array (
inFileUrl:String, inListener:Object, inArray:Array)

Creates a new TextFile2Array instance.
Parameters:
inFileUrl :
url of the text file with data to parse
inListener :
(optional) object that receives a TextFile2ArrayEvent.FINISHED after parsing
inCollection:
(optional) existing Array to store the data in; if not provided a new Array will be created

Instance properties

mItemDelimiter

private mItemDelimiter:String = newline
(read)

Property delimiter.

Instance methods

notifyFinished

private function notifyFinished (
) : Void

Called when parsing is done.
Events broadcasted to listeners:

parse

private function parse (
inSource:String) : Void

Splits the received text data in lines and adds them to the Array passed in TextFile2Array; if no Array was passed to the constructor, a new Array object is created.
Parameters:
inSource:
the file data
Implementation note: