Class ContainmentExtender

  • All Implemented Interfaces:
    java.lang.Cloneable, ContainmentExtender, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class ContainmentExtender
    extends Attribute
    implements ContainmentExtender
    An implementation of containment extender for modal models as an attribute. This attribute defines a special containment relationship that is slightly different from the containment relationship defined by NamedObj.getContainer(). The getExtendedContainer() method returns the container of the object that contains the implementing attribute. The returned container is supposed to be the object that visually contains the object that owns the implementing attribute, as seen by the model designer. In particular, for a modal model (either FSM or Ptera), even though a refinement is visually contained by a state or an event, NamedObj.getContainer() of that refinement does not return the state or event because of a difference between the visual representation and internal data representation. In that case, getExtendedContainer() of this class returns the state or event.
    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Thomas Huining Feng
    Pt.AcceptedRating:
    Red (tfeng)
    Pt.ProposedRating:
    Red (tfeng)
    • Constructor Detail

      • ContainmentExtender

        public ContainmentExtender​(RefinementActor container,
                                   java.lang.String name)
                            throws IllegalActionException,
                                   NameDuplicationException
        Construct a ContainmentExtender attribute with the given name contained by the specified Refinement. The container argument must not be null, or a NullPointerException will be thrown. This attribute will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.
        Parameters:
        container - The container.
        name - The name of this attribute.
        Throws:
        IllegalActionException - If the attribute is not of an acceptable class for the container, or if the name contains a period.
        NameDuplicationException - If the name coincides with an attribute already in the container.
      • ContainmentExtender

        public ContainmentExtender​(State container,
                                   java.lang.String name)
                            throws IllegalActionException,
                                   NameDuplicationException
        Construct a ContainmentExtender attribute with the given name contained by the specified State. The container argument must not be null, or a NullPointerException will be thrown. This attribute will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.
        Parameters:
        container - The container.
        name - The name of this attribute.
        Throws:
        IllegalActionException - If the attribute is not of an acceptable class for the container, or if the name contains a period.
        NameDuplicationException - If the name coincides with an attribute already in the container.