Class FileWriter

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

    public class FileWriter
    extends Sink
    This actor reads tokens from any number of input channels and writes their string values to the specified output file. The input type can be anything. If a StringToken is received, then its stringValue() method will be used to get the string to write to the file. Otherwise, the toString() method of the received token will be used. If no file name is given, then the values are written to the standard output. If multiple input channels are provided on the input port, then the values received are written separated by a tab character. Each time a new name is received on the filename input, a new file will be opened for writing. If no new filename is received, then the data will be appended to previously used file. When appending, the values received on subsequent firings are separated by a newline character (a newline character will be inserted if one is not already provide by the input string). Unlike @see{ExpressionWriter}, this actor makes no changes to the input string. It writes to the file exactly what it receives on its input.
    Since:
    Ptolemy II 0.4
    Version:
    $Id$
    Author:
    Yuhong Xiong, Edward A. Lee
    Pt.AcceptedRating:
    Yellow (mudit)
    Pt.ProposedRating:
    Yellow (yuhong)