Class RecordUpdater

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

    public class RecordUpdater
    extends TypedAtomicActor
    On each firing, read one token from each input port and assemble them into a RecordToken that contains the union of the original input record and each of the update ports. To use this class, instantiate it, and then add input ports (instances of TypedIOPort). This actor is polymorphic. The type constraint is that the output record contains all the labels in the input record plus the names of added input ports. The type of a field in the output is the same as the type of the added input port, if that field is updated by an added input port. If a field in the output is not updated by an input port, its type is the same as the corresponding field in the input record. For example, if the input record has type {item: string, value: int}, and this actor has two added input ports with name/type: value/double and id/int, then the output record will have type {item: string, value: double, id: int}
    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Michael Shilman, Steve Neuendorffer, Marten Lohstroh
    See Also:
    RecordAssembler
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (yuhong)