ptolemy.domains.fsm.modal
Class ModalPort

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.Port
          extended byptolemy.kernel.ComponentPort
              extended byptolemy.actor.IOPort
                  extended byptolemy.actor.TypedIOPort
                      extended byptolemy.domains.fsm.modal.ModalPort
All Implemented Interfaces:
ptolemy.kernel.util.Changeable, java.lang.Cloneable, ptolemy.kernel.util.Debuggable, ptolemy.kernel.util.DebugListener, ptolemy.kernel.util.Derivable, ptolemy.data.type.HasTypeConstraints, ptolemy.kernel.util.ModelErrorHandler, ptolemy.kernel.util.MoMLExportable, ptolemy.kernel.util.Nameable, java.io.Serializable, ptolemy.data.type.Typeable

public class ModalPort
extends ptolemy.actor.TypedIOPort

A port for modal models. This port mirrors certain changes to it in the ports of the controller and refinements of the modal model. It is designed to work closely with RefinementPort, since changes to the ports can be initiated in either class.

Since:
Ptolemy II 2.0
Version:
$Id: ModalPort.java,v 1.10 2004/05/02 00:22:47 eal Exp $
Author:
Edward A. Lee
See Also:
RefinementPort, Serialized Form
Accepted Rating:
Red (liuxj)
Proposed Rating:
Red (eal)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.util.NamedObj
ptolemy.kernel.util.NamedObj.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.actor.TypedIOPort
TYPE
 
Fields inherited from class ptolemy.actor.IOPort
CONFIGURATION, RECEIVERS, REMOTERECEIVERS
 
Fields inherited from class ptolemy.kernel.Port
_insideLinks, _relationsList
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
ModalPort(ptolemy.kernel.ComponentEntity container, java.lang.String name)
          Construct a port with a containing actor and a name that is neither an input nor an output.
ModalPort(ptolemy.kernel.util.Workspace workspace)
          Construct a port in the given workspace.
 
Method Summary
protected  void _checkContainer(ptolemy.kernel.Entity container)
          Override the base class to ensure that the proposed container is a ModalModel or null.
 void setContainer(ptolemy.kernel.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.actor.TypedIOPort
_checkLiberalLink, _checkLink, _checkType, _description, addTypeListener, attributeChanged, broadcast, broadcast, clone, convert, getType, getTypeTerm, isTypeAcceptable, removeTypeListener, send, send, sendInside, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, typeConstraintList
 
Methods inherited from class ptolemy.actor.IOPort
_checkLiberalLink, _exportMoMLContents, _getInsideWidth, _newInsideReceiver, _newReceiver, broadcastClear, createReceivers, deepConnectedInPortList, deepConnectedInPorts, deepConnectedOutPortList, deepConnectedOutPorts, deepGetReceivers, get, get, getCurrentTime, getInside, getInsideReceivers, getReceivers, getReceivers, getReceivers, getRemoteReceivers, getRemoteReceivers, getWidth, getWidthInside, hasRoom, hasRoomInside, hasToken, hasToken, hasTokenInside, insertLink, insideSinkPortList, insideSourcePortList, isInput, isKnown, isKnown, isKnownInside, isMultiport, isOutput, liberalLink, link, numberOfSinks, numberOfSources, sendClear, sendClearInside, 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, isInsideLinked, isOpaque, numInsideLinks
 
Methods inherited from class ptolemy.kernel.Port
_getContainedObject, _propagateExistence, connectedPortList, connectedPorts, getContainer, isLinked, linkedRelationList, linkedRelations, numLinks
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ModalPort

public ModalPort(ptolemy.kernel.util.Workspace workspace)
          throws ptolemy.kernel.util.IllegalActionException
Construct a port in the given workspace.

Parameters:
workspace - The workspace.
Throws:
ptolemy.kernel.util.IllegalActionException - If the port is not of an acceptable class for the container, or if the container does not implement the TypedActor interface.

ModalPort

public ModalPort(ptolemy.kernel.ComponentEntity container,
                 java.lang.String name)
          throws ptolemy.kernel.util.IllegalActionException,
                 ptolemy.kernel.util.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:
ptolemy.kernel.util.IllegalActionException - If the port is not of an acceptable class for the container, or if the container does not implement the TypedActor interface.
ptolemy.kernel.util.NameDuplicationException - If the name coincides with a port already in the container.
Method Detail

setContainer

public void setContainer(ptolemy.kernel.Entity container)
                  throws ptolemy.kernel.util.IllegalActionException,
                         ptolemy.kernel.util.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. This method is write-synchronized on the workspace.

Parameters:
container - The proposed container.
Throws:
ptolemy.kernel.util.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 null
ptolemy.kernel.util.NameDuplicationException - If the container already has a port with the name of this port.

setInput

public void setInput(boolean isInput)
              throws ptolemy.kernel.util.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.

Parameters:
isInput - True to make the port an input.
Throws:
ptolemy.kernel.util.IllegalActionException - If changing the port status is not permitted.

setMultiport

public void setMultiport(boolean isMultiport)
                  throws ptolemy.kernel.util.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.

Parameters:
isMultiport - True to make the port a multiport.
Throws:
ptolemy.kernel.util.IllegalActionException - If changing the port status is not permitted.

setName

public void setName(java.lang.String name)
             throws ptolemy.kernel.util.IllegalActionException,
                    ptolemy.kernel.util.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.

Throws:
ptolemy.kernel.util.IllegalActionException - If the name has a period.
ptolemy.kernel.util.NameDuplicationException - If there is already a port with the same name in the container.

setOutput

public void setOutput(boolean isOutput)
               throws ptolemy.kernel.util.IllegalActionException
If the argument is true, make the port an output port. If the argument is false, make the port not an output 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.

Parameters:
isOutput - True to make the port an output.
Throws:
ptolemy.kernel.util.IllegalActionException - If changing the port status is not permitted.

_checkContainer

protected void _checkContainer(ptolemy.kernel.Entity container)
                        throws ptolemy.kernel.util.IllegalActionException
Override the base class to ensure that the proposed container is a ModalModel or null.

Parameters:
container - The proposed container.
Throws:
ptolemy.kernel.util.IllegalActionException - If the proposed container is not a TypedActor, or if the base class throws it.