TextFile2Collection
| Kind of class: | class |
|---|---|
| Inherits from: | Dispatcher |
| Known subclasses: | |
| Author: | Arthur Clemens |
| Classpath: | org.asapframework.data.filedatatransform.TextFile2Collection |
| File last modified: | Thursday, 09 November 2006, 10:57:18 |
Base class that takes a text file url, loads the file data and converts the text contents to a collection structure (Tree or Array). Actual parsing is not provided in this class, see the subclasses for implementations.
Summary
Constructor
- TextFile2Collection (inFileUrl:String, inListener:Object, inCollection:Object)
- Creates a TextFile2Collection instance.
Instance properties
- mCollection : Object
- mListener : Object
- mFileUrl : String
Instance properties inherited from Dispatcher
Instance methods
- load : Void
- Loads the text file and starts the parser.
- handleDataLoaded (inSource:String) : Void
- Invoked by LoadVars when data is received.
- parse (inSource:String) : Void
- The text data parsing method - implemented by subclasses.
- notifyFinished : Void
- Sends 'finished' message - implemented by subclasses.
Constructor
TextFile2Collection
function TextFile2Collection (
inFileUrl:String,
inListener:Object,
inCollection:Object)
Creates a TextFile2Collection instance.
Parameters:
inFileUrl :
url of the text file with data to parse
inListener :
(optional) object that receives a 'finished' event after parsing; most likely the listener will be the invoker of this constructor
inCollection:
(optional) existing object to store the data in; if not provided a new object will be created
Instance properties
mCollection
private mCollection:Object
(read)
mFileUrl
private mFileUrl:String
(read)
mListener
private mListener:Object
(read)
Instance methods
handleDataLoaded
private function handleDataLoaded (
inSource:String) : Void
Invoked by LoadVars when data is received.
Parameters:
inSource:
the file data
load
function load (
) : Void
Loads the text file and starts the parser.
notifyFinished
private function notifyFinished (
) : Void
Sends 'finished' message - implemented by subclasses.
parse
private function parse (
inSource:String) : Void
The text data parsing method - implemented by subclasses.
Implementation note:
- Subclass implementation should always call notifyFinished.