Package ptolemy.domains.modal.modal
Class TransitionRefinementPort
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.Port
-
- ptolemy.kernel.ComponentPort
-
- ptolemy.actor.IOPort
-
- ptolemy.actor.TypedIOPort
-
- ptolemy.domains.modal.modal.ModalBasePort
-
- ptolemy.domains.modal.modal.RefinementPort
-
- ptolemy.domains.modal.modal.TransitionRefinementPort
-
- All Implemented Interfaces:
java.lang.Cloneable
,HasTypeConstraints
,Typeable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class TransitionRefinementPort extends RefinementPort
A port for transition refinements in modal models. This port mirrors certain changes to it in the ports of the container of the container. That container in turn mirrors those changes in other refinements and/or controllers.For output ports, this class creates a sibling "input" port. The sibling port is normally treated like any other port but mirrors changes via it's output sibling. This is so that TransitionRefinement instances can get the outputs from the State refinements without having the port be an input/output. This sibling port is labeled as "port_in" where port is the name of the corresponding output port.
- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- David Hermann, Research In Motion Limited
- See Also:
ModalPort
,TransitionRefinement
- Pt.AcceptedRating:
- Red (liuxj)
- Pt.ProposedRating:
- Red (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.actor.TypedIOPort
TypedIOPort.RunTimeTypeCheckException
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_hasSibling
Flag indicating if this port has a sibling.-
Fields inherited from class ptolemy.domains.modal.modal.RefinementPort
_automaticallyInput, _mirrorDisable
-
Fields inherited from class ptolemy.actor.TypedIOPort
_resolvedType, TYPE
-
Fields inherited from class ptolemy.actor.IOPort
_constantLimit, _constantToken, _constantTokensSent, _hasPortEventListeners, _portEventListeners, CONFIGURATION, defaultValue, RECEIVERS, REMOTERECEIVERS
-
Fields inherited from class ptolemy.kernel.Port
_insideLinks, _relationsList
-
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
-
-
Constructor Summary
Constructors Constructor Description TransitionRefinementPort(ComponentEntity container, java.lang.String name)
Construct a port with a containing actor and a name that is neither an input nor an output.TransitionRefinementPort(Workspace workspace)
Construct a port in the given workspace.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
link(Relation relation)
Override the base class to avoid linking a sibling input port to the same relation as the sibling output port multiple times.void
setContainer(Entity container)
Override the base class so that if the port is being removed from the current container, then it is also removed from the controller and from each of the refinements.void
setInput(boolean isInput)
If the argument is true, make the port an input port.void
setMultiport(boolean isMultiport)
If the argument is true, make the port a multiport.void
setName(java.lang.String name)
Set the name of the port, and mirror the change in all the mirror ports.void
setOutput(boolean isOutput)
If the argument is true, make the port an output port.-
Methods inherited from class ptolemy.domains.modal.modal.RefinementPort
_checkContainer, attributeChanged, isTypeAcceptable, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setMirrorDisable, typeConstraints
-
Methods inherited from class ptolemy.domains.modal.modal.ModalBasePort
_moveDown, _moveToFirst, _moveToIndex, _moveToLast, _moveUp, _removePort, _setInput, _setMultiport, _setName, _setOutput
-
Methods inherited from class ptolemy.actor.TypedIOPort
_checkLiberalLink, _checkLink, _checkType, _checkTypedIOPortContainer, _description, addTypeListener, broadcast, broadcast, clone, convert, getAutomaticTypeConversion, getType, getTypeTerm, removeTypeListener, send, send, sendInside, setAutomaticTypeConversion, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, typeConstraintList
-
Methods inherited from class ptolemy.actor.IOPort
_checkLiberalLink, _exportMoMLContents, _getInsideWidth, _getOutsideWidth, _getReceiversLinkedToGroup, _newInsideReceiver, _newInsideReceiver, _newReceiver, _newReceiver, _notifyPortEventListeners, _removeReceivers, _setConstant, _wrapReceiver, addIOPortEventListener, broadcastClear, checkWidthConstraints, createReceivers, deepConnectedInPortList, deepConnectedInPorts, deepConnectedOutPortList, deepConnectedOutPorts, deepGetReceivers, get, get, getChannelForReceiver, getCommunicationAspects, getCurrentTime, getDefaultWidth, getInside, getInsideReceivers, getIOPortEventListeners, getModelTime, getModelTime, getReceivers, getReceivers, getReceivers, getRelationIndex, getRemoteReceivers, getRemoteReceivers, getWidth, getWidthFromConstraints, getWidthInside, hasNewToken, hasNewTokenInside, hasRoom, hasRoomInside, hasToken, hasToken, hasTokenInside, hasWidthConstraints, insertLink, insideSinkPortList, insideSourcePortList, invalidateCommunicationAspects, isInput, isInsideConnected, isKnown, isKnown, isKnownInside, isMultiport, isOutput, isOutsideConnected, liberalLink, numberOfSinks, numberOfSources, removeIOPortEventListener, reset, sendClear, sendClearInside, setDefaultWidth, setWidthEquals, setWidthEquals, sinkPortList, sourcePortList, transferInputs, transferOutputs, unlink, unlink, unlinkAll, unlinkAllInside, unlinkInside, unlinkInside
-
Methods inherited from class ptolemy.kernel.ComponentPort
_deepConnectedPortList, _deepConnectedPorts, _deepInsidePortList, _deepInsidePorts, _isInsideLinkable, deepConnectedPortList, deepConnectedPorts, deepInsidePortList, deepInsidePorts, insertInsideLink, insidePortList, insidePorts, insideRelationList, insideRelations, isDeeplyConnected, isInsideGroupLinked, isInsideLinked, isOpaque, numInsideLinks
-
Methods inherited from class ptolemy.kernel.Port
_getContainedObject, _propagateExistence, connectedPortList, connectedPorts, getContainer, isGroupLinked, isLinked, linkedRelationList, linkedRelations, numLinks
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, 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, toString, uniqueName, validateSettables, workspace
-
-
-
-
Constructor Detail
-
TransitionRefinementPort
public TransitionRefinementPort(Workspace workspace) throws IllegalActionException, NameDuplicationException
Construct a port in the given workspace.- Parameters:
workspace
- The workspace.- Throws:
IllegalActionException
- If the port is not of an acceptable class for the container, or if the container does not implement the TypedActor interface.NameDuplicationException
- If the name coincides with a port already in the container.
-
TransitionRefinementPort
public TransitionRefinementPort(ComponentEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a port with a containing actor and a name that is neither an input nor an output. The specified container must implement the TypedActor interface, or an exception will be thrown.- Parameters:
container
- The container actor.name
- The name of the port.- Throws:
IllegalActionException
- If the port is not of an acceptable class for the container, or if the container does not implement the TypedActor interface.NameDuplicationException
- If the name coincides with a port already in the container.
-
-
Method Detail
-
link
public void link(Relation relation) throws IllegalActionException
Override the base class to avoid linking a sibling input port to the same relation as the sibling output port multiple times.- Overrides:
link
in classRefinementPort
- Parameters:
relation
- The relation to link to.- Throws:
IllegalActionException
- If the link crosses levels of the hierarchy, or the port has no container, or the relation is not an instance of IORelation.
-
setContainer
public void setContainer(Entity container) throws IllegalActionException, NameDuplicationException
Override the base class so that if the port is being removed from the current container, then it is also removed from the controller and from each of the refinements.- Overrides:
setContainer
in classRefinementPort
- Parameters:
container
- The proposed container.- Throws:
IllegalActionException
- If the proposed container is not a ComponentEntity, doesn't implement Actor, or has no name, or the port and container are not in the same workspace. Or it's not nullNameDuplicationException
- If the container already has a port with the name of this port.- See Also:
Port.getContainer()
,Port._checkContainer(Entity)
-
setInput
public void setInput(boolean isInput) throws IllegalActionException
If the argument is true, make the port an input port. If the argument is false, make the port not an input port. This method overrides the base class to make the same change on the mirror ports in the controller and state refinments. This method invalidates the schedule and resolved types of the director of the container, if there is one. It is write-synchronized on the workspace, and increments the version of the workspace.- Overrides:
setInput
in classRefinementPort
- Parameters:
isInput
- True to make the port an input.- Throws:
IllegalActionException
- If changing the port status is not permitted.
-
setMultiport
public void setMultiport(boolean isMultiport) throws IllegalActionException
If the argument is true, make the port a multiport. If the argument is false, make the port not a multiport. This method overrides the base class to make the same change on the mirror ports in the controller and state refinments. This method invalidates the schedule and resolved types of the director of the container, if there is one. It is write-synchronized on the workspace, and increments the version of the workspace.- Overrides:
setMultiport
in classRefinementPort
- Parameters:
isMultiport
- True to make the port a multiport.- Throws:
IllegalActionException
- If changing the port status is not permitted.
-
setName
public void setName(java.lang.String name) throws IllegalActionException, NameDuplicationException
Set the name of the port, and mirror the change in all the mirror ports. This method is write-synchronized on the workspace, and increments the version of the workspace.- Specified by:
setName
in interfaceNameable
- Overrides:
setName
in classRefinementPort
- Parameters:
name
- The new name.- Throws:
IllegalActionException
- If the name has a period.NameDuplicationException
- If there is already a port with the same name in the container.- See Also:
NamedObj.getName()
,NamedObj.getName(NamedObj)
-
setOutput
public void setOutput(boolean isOutput) throws IllegalActionException
If the argument is true, make the port an output port. If the argument is false, make the port not an output port. In addition, if the container is an instance of Refinement, and the argument is true, find the corresponding port of the controller and make it an input and not an output. This makes it possible for the controller to see the outputs of the refinements. This method overrides the base class to make the same change on the mirror ports in the controller and state refinments. This method invalidates the schedule and resolved types of the director of the container, if there is one. It is write-synchronized on the workspace, and increments the version of the workspace.- Overrides:
setOutput
in classRefinementPort
- Parameters:
isOutput
- True to make the port an output.- Throws:
IllegalActionException
- If changing the port status is not permitted.
-
-