Class ProcessAttribute

    • Constructor Detail

      • ProcessAttribute

        public ProcessAttribute()
        Construct an attribute in the default workspace with an empty string as its name. The object is added to the directory of the workspace. Increment the version number of the workspace.
      • ProcessAttribute

        public ProcessAttribute​(Workspace workspace)
        Construct an attribute in the specified workspace with an empty string as a name. 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.
      • ProcessAttribute

        public ProcessAttribute​(NamedObj container,
                                java.lang.String name)
                         throws IllegalActionException,
                                NameDuplicationException
        Construct an attribute with the given name contained by the specified container. 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. The object is added to the directory of the workspace if the container is null. 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.
    • Method Detail

      • compareTo

        public int compareTo​(java.lang.Object object)
        Implement compareTo method to compare sequence numbers Updated: This method now compares both the process name and the sequence number. - If the process names are different, then "less than" is determined alphabetically - If the process names are the same, then "less than" is determined by the sequence number - If a ProcessAttribute and a SequenceAttribute are compared, then only the sequence number is considered This method assumes that the expression is well-formed (checked in validate())
        Specified by:
        compareTo in interface java.lang.Comparable
        Overrides:
        compareTo in class SequenceAttribute
        Parameters:
        object - The SequenceAttribute or ProcessAttribute object.
        Returns:
        0 if the sequence numbers are the same.
      • equals

        public boolean equals​(java.lang.Object processAttribute)
        Return true if this ProcessAttribute has the same sequence number as the given ProcessAttribute.
        Overrides:
        equals in class SequenceAttribute
        Parameters:
        processAttribute - The ProcessAttribute object that this ProcessAttribute object is compared to.
        Returns:
        True if the two ProcessAttribute objects have the same sequence number, methodName and processName.
      • getMethodName

        public java.lang.String getMethodName()
                                       throws IllegalActionException
        Return the method name to be called on the actor, or an empty string if there is none.
        Returns:
        String method name.
        Throws:
        IllegalActionException - If there is a problem getting the token from the ProcessAttribute.
      • getProcessName

        public java.lang.String getProcessName()
                                        throws IllegalActionException
        Returns the process name, or throws an exception if there is none.
        Returns:
        String process name
        Throws:
        IllegalActionException - If there is a problem getting the token from the ProcessAttribute.
      • hashCode

        public int hashCode()
        Return the hash code for this ProcessAttribute object. If two ProcessAttribute objects contain the same processName, methodName and have the same sequence number, then they will have the same hashCode.
        Overrides:
        hashCode in class SequenceAttribute
        Returns:
        The hash code for this TimedEvent object.