Package ptolemy.actor.parameters
Class ParameterPort
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.Port
-
- ptolemy.kernel.ComponentPort
-
- ptolemy.actor.IOPort
-
- ptolemy.actor.TypedIOPort
-
- ptolemy.actor.parameters.ParameterPort
-
- All Implemented Interfaces:
java.lang.Cloneable
,HasTypeConstraints
,Typeable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
ParameterMirrorPort
public class ParameterPort extends TypedIOPort
A specialized port for use with PortParameter. This port is created by an instance of PortParameter and provides values to a parameter. Data should not be read directly from this port. Instead, the update method of the corresponding PortParameter should be invoked. This port is only useful if the container is opaque, however, this is not checked.- Since:
- Ptolemy II 3.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- See Also:
PortParameter
- Pt.AcceptedRating:
- Yellow (neuendor)
- Pt.ProposedRating:
- Green (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 PortParameter
_parameter
The associated parameter.-
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 Modifier Constructor Description ParameterPort(ComponentEntity container, java.lang.String name)
Construct a new input port in the specified container with the specified name.protected
ParameterPort(ComponentEntity container, java.lang.String name, PortParameter parameter)
Construct a new input port in the specified container with the specified name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_setTypeConstraints()
Set the type constraints between the protected member _parameter and this port.java.lang.Object
clone(Workspace workspace)
Clone the port.PortParameter
getParameter()
Get the associated parameter.void
setContainer(Entity entity)
Set the container of this port.void
setDisplayName(java.lang.String name)
Set the display name, and propagate the name change to the associated parameter.void
setName(java.lang.String name)
Set the name, and propagate the name change to the associated parameter.-
Methods inherited from class ptolemy.actor.TypedIOPort
_checkContainer, _checkLiberalLink, _checkLink, _checkType, _checkTypedIOPortContainer, _description, addTypeListener, attributeChanged, broadcast, broadcast, convert, getAutomaticTypeConversion, getType, getTypeTerm, isTypeAcceptable, removeTypeListener, send, send, sendInside, setAutomaticTypeConversion, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, typeConstraintList, typeConstraints
-
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, link, numberOfSinks, numberOfSources, removeIOPortEventListener, reset, sendClear, sendClearInside, setDefaultWidth, setInput, setMultiport, setOutput, 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, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, 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, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Field Detail
-
_parameter
protected PortParameter _parameter
The associated parameter.
-
-
Constructor Detail
-
ParameterPort
public ParameterPort(ComponentEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a new input port in the specified container with the specified name. The specified container must implement the Actor interface, or an exception will be thrown.- Parameters:
container
- The container.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 Actor interface.NameDuplicationException
- If the name coincides with a port already in the container.
-
ParameterPort
protected ParameterPort(ComponentEntity container, java.lang.String name, PortParameter parameter) throws IllegalActionException, NameDuplicationException
Construct a new input port in the specified container with the specified name. The specified container must implement the Actor interface, or an exception will be thrown.- Parameters:
container
- The container.name
- The name of the port.parameter
- The associate PortParameter, or null to create one.- Throws:
IllegalActionException
- If the port is not of an acceptable class for the container, or if the container does not implement the Actor interface.NameDuplicationException
- If the name coincides with a port already in the container.
-
-
Method Detail
-
clone
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
Clone the port. This overrides the base class to remove the current association with a parameter. It is assumed that the parameter will also be cloned, and when the containers are set of this port and that parameter, whichever one is set second will result in re-establishment of the association.- Overrides:
clone
in classTypedIOPort
- Parameters:
workspace
- The workspace in which to place the cloned port.- Returns:
- The cloned port.
- Throws:
java.lang.CloneNotSupportedException
- Not thrown in this base class.- See Also:
Object.clone()
-
getParameter
public PortParameter getParameter()
Get the associated parameter.- Returns:
- The associated parameter.
-
setContainer
public void setContainer(Entity entity) throws IllegalActionException, NameDuplicationException
Set the container of this port. If the container is different from what it was before and there is an associated parameter, then also change the container of the parameter.- Overrides:
setContainer
in classIOPort
- Parameters:
entity
- The new container.- Throws:
IllegalActionException
- If the superclass throws it.NameDuplicationException
- If the superclass throws it.- See Also:
PortParameter
-
setDisplayName
public void setDisplayName(java.lang.String name)
Set the display name, and propagate the name change to the associated parameter. Increment the version of the workspace. This method is write-synchronized on the workspace.- Overrides:
setDisplayName
in classNamedObj
- Parameters:
name
- The new display name..- See Also:
NamedObj.getDisplayName()
-
setName
public void setName(java.lang.String name) throws IllegalActionException, NameDuplicationException
Set the name, and propagate the name change to the associated parameter. If a null argument is given, then the name is set to an empty string. Increment the version of the workspace. This method is write-synchronized on the workspace.- Specified by:
setName
in interfaceNameable
- Overrides:
setName
in classPort
- Parameters:
name
- The new name.- Throws:
IllegalActionException
- If the name contains a period.NameDuplicationException
- If the container already contains an attribute with the proposed name.- See Also:
NamedObj.getName()
,NamedObj.getName(NamedObj)
-
_setTypeConstraints
protected void _setTypeConstraints()
Set the type constraints between the protected member _parameter and this port. This is a protected method so that subclasses can define different type constraints. It is assured that when this is called, _parameter is non-null. However, use caution, since this method may be called during construction of this port, and hence the port may not be fully constructed.
-
-