Class CreationAttribute

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

    public class CreationAttribute
    extends MatchingAttribute
    An attribute to identify an object in the pattern to be created. When an object in the pattern contains one such attribute, it is essentially not part of the pattern because it is ignored in pattern matching. When a match is found, the object would be created in the result.
    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Thomas Huining Feng
    Pt.AcceptedRating:
    Red (tfeng)
    Pt.ProposedRating:
    Yellow (tfeng)
    • Constructor Detail

      • CreationAttribute

        public CreationAttribute​(NamedObj container,
                                 java.lang.String name)
                          throws NameDuplicationException,
                                 IllegalActionException
        Construct an attribute with the given name contained by the specified entity. 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.
      • CreationAttribute

        public CreationAttribute​(Workspace workspace)
        Construct an attribute in the specified workspace with an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. The object is added to the directory of the workspace. Increment the version number of the workspace.
        Parameters:
        workspace - The workspace that will list the attribute.