Class OrderedRecordAssembler

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

    public class OrderedRecordAssembler
    extends RecordAssembler
    On each firing, read one token from each input port and assemble them into a RecordToken. The labels for the RecordToken are the names of the input 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 type of each record field is no less than the type of the corresponding input port.

    This actor differs from the RecordAssembler in that it ensures that the order of the fields of the record is preserved, matching the order of the input ports. This is probably not relevant unless you are writing Java code that iterates over the fields of the record.

    Note that if the display name of a port is set, display name is used in the type constraints instead of name. This is useful in case fields to add to the record contain a period, because periods are not allowed in port names.

    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Ben Leinfelder, Christopher Brooks
    See Also:
    RecordAssembler, RecordDisassembler
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Method Detail

      • _newPortMap

        protected java.util.Map<java.lang.String,​TypedIOPort> _newPortMap()
        Return a new _portMap, which is a map between port names and strings. Derived classes like OrderedRecordAssembler return a map with a different ordering.
        Overrides:
        _newPortMap in class RecordAssembler
        Returns:
        a Map from port names to TypedIOPorts.