Package ptolemy.domains.sequence.kernel
Class ProcessAttribute
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.AbstractSettableAttribute
-
- ptolemy.data.expr.Variable
-
- ptolemy.data.expr.Parameter
-
- ptolemy.domains.sequence.kernel.SequenceAttribute
-
- ptolemy.domains.sequence.kernel.ProcessAttribute
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Comparable
,HasTypeConstraints
,Typeable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Settable
,ValueListener
public class ProcessAttribute extends SequenceAttribute
ProcessAttribute is a subclass of Parameter with support for strings.A ProcessAttribute is a tuple (string processName, int sequenceNumber, (optionally) string methodName).
The ProcessDirector collects the ProcessAttributes to determine the order in which order the actors in the model are fired.
- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Elizabeth Latronico (Bosch)
- Pt.AcceptedRating:
- Red (beth)
- Pt.ProposedRating:
- Red (beth)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.data.expr.Variable
Variable.CircularDependencyError, Variable.VariableScope
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
Nested classes/interfaces inherited from interface ptolemy.kernel.util.Settable
Settable.Visibility
-
-
Field Summary
-
Fields inherited from class ptolemy.data.expr.Variable
_currentExpression, _needsEvaluation, _parserScope, _parseTreeValid, _suppressVariableSubstitution, _valueListeners
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
Fields inherited from interface ptolemy.kernel.util.Settable
EXPERT, FULL, NONE, NOT_EDITABLE
-
-
Constructor Summary
Constructors Constructor Description ProcessAttribute()
Construct an attribute in the default workspace with an empty string as its name.ProcessAttribute(NamedObj container, java.lang.String name)
Construct an attribute with the given name contained by the specified container.ProcessAttribute(Workspace workspace)
Construct an attribute in the specified workspace with an empty string as a name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.boolean
equals(java.lang.Object processAttribute)
Return true if this ProcessAttribute has the same sequence number as the given ProcessAttribute.java.lang.String
getMethodName()
Return the method name to be called on the actor, or an empty string if there is none.java.lang.String
getProcessName()
Returns the process name, or throws an exception if there is none.int
getSequenceNumber()
Returns the sequence number as an int, or throws an exception if there is none.int
hashCode()
Return the hash code for this ProcessAttribute object.-
Methods inherited from class ptolemy.domains.sequence.kernel.SequenceAttribute
validate
-
Methods inherited from class ptolemy.data.expr.Parameter
addChoice, clone, exportMoML, getChoices, removeAllChoices, removeChoice
-
Methods inherited from class ptolemy.data.expr.Variable
_description, _evaluate, _getCurrentExpression, _notifyValueListeners, _parseIfNecessary, _propagate, _propagateToValueListeners, _propagateValue, _setToken, _setTokenAndNotify, addValueListener, attributeChanged, getDeclaredType, getExpression, getFreeIdentifiers, getParserScope, getScope, getScope, getToken, getType, getTypeTerm, getValueAsString, getVariable, getVisibility, invalidate, isKnown, isLazy, isStringMode, isSuppressVariableSubstitution, isTypeAcceptable, removeValueListener, reset, setContainer, setExpression, setLazy, setName, setParseTreeEvaluator, setStringMode, setSuppressVariableSubstitution, setToken, setToken, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, setUnknown, setValueListenerAsWeakDependency, setVisibility, stringRepresentation, toString, typeConstraintList, typeConstraints, valueChanged
-
Methods inherited from class ptolemy.kernel.util.AbstractSettableAttribute
getDefaultExpression
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getFullName, getName, getName
-
Methods inherited from interface ptolemy.kernel.util.Settable
getDisplayName
-
-
-
-
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 interfacejava.lang.Comparable
- Overrides:
compareTo
in classSequenceAttribute
- 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 classSequenceAttribute
- 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.
-
getSequenceNumber
public int getSequenceNumber() throws IllegalActionException
Returns the sequence number as an int, or throws an exception if there is none.- Overrides:
getSequenceNumber
in classSequenceAttribute
- Returns:
- int sequence number
- 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 classSequenceAttribute
- Returns:
- The hash code for this TimedEvent object.
-
-