Package ptolemy.domains.sequence.kernel
Class SequenceAttribute
- 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
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Comparable
,HasTypeConstraints
,Typeable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Settable
,ValueListener
- Direct Known Subclasses:
ProcessAttribute
public class SequenceAttribute extends Parameter implements java.lang.Comparable
The sequence number for actor in the sequence domain. This parameter stores an integer value that is required to be unique within the portion of the model under the control of a single SequenceDirector. Duplicate sequence numbers will trigger an exception. FIXME: Shouldn't these numbers be forced to be unique, like by their position in the XML file?- 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 SequenceAttribute()
Construct an attribute in the default workspace with an empty string as its name.SequenceAttribute(NamedObj container, java.lang.String name)
Construct an attribute with the given name contained by the specified container.SequenceAttribute(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 Only the sequence numbers are compared (independent of any process name).boolean
equals(java.lang.Object sequenceAttribute)
Return true if this SequenceAttribute has the same sequence number as the given SequenceAttribute.int
getSequenceNumber()
Construct an attribute with the given name contained by the specified /** Returns the sequence number as an int, or 0 if there is none.int
hashCode()
Return the hash code for this SequenceAttribute object.java.util.Collection
validate()
Implement validate method to validate the SequenceAttribute and ProcessAttributes.-
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
-
SequenceAttribute
public SequenceAttribute()
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.
-
SequenceAttribute
public SequenceAttribute(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.
-
SequenceAttribute
public SequenceAttribute(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. type is set to Integer for sequence number
-
-
Method Detail
-
compareTo
public int compareTo(java.lang.Object object)
Implement compareTo method to compare sequence numbers Only the sequence numbers are compared (independent of any process name). Object may be a SequenceAttribute or a SequenceAttribute- Specified by:
compareTo
in interfacejava.lang.Comparable
- Parameters:
object
- The SequenceAttribute object.- Returns:
- 0 if the sequence numbers are the same.
-
equals
public boolean equals(java.lang.Object sequenceAttribute)
Return true if this SequenceAttribute has the same sequence number as the given SequenceAttribute.- Overrides:
equals
in classjava.lang.Object
- Parameters:
sequenceAttribute
- The SequenceAttribute object that this SequenceAttribute object is compared to.- Returns:
- True if the two SequenceAttribute objects have the same sequence number, name and workspace
-
getSequenceNumber
public int getSequenceNumber() throws IllegalActionException
Construct an attribute with the given name contained by the specified /** Returns the sequence number as an int, or 0 if there is none.- Returns:
- int sequence number
- Throws:
IllegalActionException
- If there is a problem getting the token value.
-
validate
public java.util.Collection validate() throws IllegalActionException
Implement validate method to validate the SequenceAttribute and ProcessAttributes.- Specified by:
validate
in interfaceSettable
- Overrides:
validate
in classVariable
- Returns:
- The current list of value listeners, which are evaluated as a consequence of this call to validate().
- Throws:
IllegalActionException
- If thrown by the parent class.
-
hashCode
public int hashCode()
Return the hash code for this SequenceAttribute object. If two SequenceAttribute objects contain the same processName, methodName and have the same sequence number, then they will have the same hashCode.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code for this TimedEvent object.
-
-