Class Reader

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    @Deprecated
    public class Reader
    extends Source
    Deprecated.
    Use ExpressionReader instead.
    This actor reads tokens from an URL, and output them. Each entry in the file corresponds to one iteration. If there are multiple fires in the iteration, the same token will be repeated. This actor has a multiport, where each port corresponds to one column in the data file.

    The file format at the URL is assumed as the following. A newline character separates the rows, and a tab or a space character separates the columns.

    The sourceURL parameter should be set to the name of the file, specified as a fully qualified URL. If the sourceURL parameter is an empty string, then the System.in is used for input. It is possible to load a file from the local file system by using the prefix "file://" instead of "http://". Relative file paths are allowed. To specify a file relative to the current directory, use "../" or "./". For example, if the current directory contains a file called "test.txt", then sourceURL should be set to "file:./test.txt". If the parent directory contains a file called "test.txt", then sourceURL should be set to "file:../test.txt". To reference the file test.txt, located at "/tmp/test.txt", sourceURL should be set to "file:///tmp/test.txt" The default value is "file:///tmp/test.txt".

    FIXME: The type of the output ports is set to Double for now. It should read a line in the prefire() and refer the type from there.

    FIXME: Reader should read in expressions and serialized tokens

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Jie Liu
    Pt.AcceptedRating:
    Red (liuj)
    Pt.ProposedRating:
    Red (liuj)