Class ExpressionWriter

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

    @Deprecated
    public class ExpressionWriter
    extends LineWriter
    Deprecated.
    Use TokenToExpression followed by LineWriter.
    This actor reads input tokens and writes them, one line at a time, to a specified file. The format it uses is that generated by the toString() method of the token, which for most tokens is an expression that can be read back in using ExpressionReader. String tokens, for example, include the enclosing quotation marks in the output. If you do not want the enclosing quotation marks, use LineWriter.

    The file is specified by the fileName attribute using any form acceptable to FileParameter.

    If the append attribute has value true, then the file will be appended to. If it has value false, then if the file exists, the user will be queried for permission to overwrite, and if granted, the file will be overwritten.

    If the confirmOverwrite parameter has value false, then this actor will overwrite the specified file if it exists without asking. If true (the default), then if the file exists, then this actor will ask for confirmation before overwriting.

    Since:
    Ptolemy II 2.2
    Version:
    $Id$
    Author:
    Edward A. Lee
    See Also:
    ExpressionReader, FileParameter, LineWriter
    Pt.AcceptedRating:
    Yellow (cxh)
    Pt.ProposedRating:
    Green (eal)
    • Method Detail

      • _writeToken

        protected void _writeToken​(Token token)
        Deprecated.
        Write the specified token to the current writer using the toString() method of the token, which usually results in an expression that can be read back in using the expression parser.
        Overrides:
        _writeToken in class LineWriter
        Parameters:
        token - The token to write.