public class ModalBasePort extends TypedIOPort
ModalPort and RefinementPort both extend this class. ModalRefinementPort in turn extends RefinementPort. RefinementPort has different functionality for methods like setInput(), setMultiport(), setName() and setOutput(). Therefore, this base class defines protected versions of the common implementations of these methods that are called by the public versions of these methods in ModalPort and ModelRefinementPort, thus avoiding code duplication.
ModalPort
,
ModalRefinementPort
Red (cxh) |
Red (cxh) |
TypedIOPort.RunTimeTypeCheckException
NamedObj.ContainedObjectsIterator
_resolvedType, TYPE
_constantLimit, _constantToken, _constantTokensSent, _hasPortEventListeners, _portEventListeners, CONFIGURATION, defaultValue, RECEIVERS, REMOTERECEIVERS
_insideLinks, _relationsList
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
ModalBasePort(ComponentEntity container,
java.lang.String name)
Construct a port with a containing actor and a name
that is neither an input nor an output.
|
ModalBasePort(Workspace workspace)
Construct a port in the given workspace.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_checkContainer(Entity container)
Override the base class to ensure that the proposed container
is a CompositeEntity or null.
|
protected int |
_moveDown()
Move this object down by one in the list of attributes of
its container.
|
protected int |
_moveToFirst()
Move this object to the first position in the list
of attributes of the container.
|
protected int |
_moveToIndex(int index)
Move this object to the specified position in the list
of attributes of the container.
|
protected int |
_moveToLast()
Move this object to the last position in the list
of attributes of the container.
|
protected int |
_moveUp()
Move this object up by one in the list of
attributes of the container.
|
protected void |
_removePort(CompositeEntity oldContainer)
Remove a port from the current container.
|
protected void |
_setInput(boolean isInput)
If the argument is true, make the port an input port.
|
protected void |
_setMultiport(boolean isMultiport)
If the argument is true, make the port a multiport.
|
protected void |
_setName(java.lang.String name)
Set the name of the port, and mirror the change in all the
mirror ports.
|
protected void |
_setOutput(boolean isOutput)
If the argument is true, make the port an output port.
|
_checkLiberalLink, _checkLink, _checkType, _checkTypedIOPortContainer, _description, addTypeListener, attributeChanged, broadcast, broadcast, clone, convert, getAutomaticTypeConversion, getType, getTypeTerm, isTypeAcceptable, removeTypeListener, send, send, sendInside, setAutomaticTypeConversion, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, typeConstraintList, typeConstraints
_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, 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, setContainer, setDefaultWidth, setInput, setMultiport, setOutput, setWidthEquals, setWidthEquals, sinkPortList, sourcePortList, transferInputs, transferOutputs, unlink, unlink, unlinkAll, unlinkAllInside, unlinkInside, unlinkInside
_deepConnectedPortList, _deepConnectedPorts, _deepInsidePortList, _deepInsidePorts, _isInsideLinkable, deepConnectedPortList, deepConnectedPorts, deepInsidePortList, deepInsidePorts, insertInsideLink, insidePortList, insidePorts, insideRelationList, insideRelations, isDeeplyConnected, isInsideGroupLinked, isInsideLinked, isOpaque, numInsideLinks
_getContainedObject, _propagateExistence, connectedPortList, connectedPorts, getContainer, isGroupLinked, isLinked, linkedRelationList, linkedRelations, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, numLinks, setName
_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
public ModalBasePort(Workspace workspace) throws IllegalActionException
workspace
- The workspace.IllegalActionException
- If the port is not of an acceptable
class for the container, or if the container does not implement the
TypedActor interface.public ModalBasePort(ComponentEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container actor.name
- The name of the port.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.protected int _moveDown() throws IllegalActionException
IllegalActionException
- If this object has
no container.protected int _moveToFirst() throws IllegalActionException
IllegalActionException
- If this object has
no container.protected int _moveToIndex(int index) throws IllegalActionException
index
- The position to move this object to.IllegalActionException
- If this object has
no container or if the index is out of bounds.protected int _moveToLast() throws IllegalActionException
IllegalActionException
- If this object has
no container.protected int _moveUp() throws IllegalActionException
IllegalActionException
- If this object has
no container.protected void _removePort(CompositeEntity oldContainer) throws IllegalActionException, NameDuplicationException
oldContainer
- The container of the portIllegalActionException
- If the container or the
container of the relation cannot be set to null.NameDuplicationException
- If the thrown will setting
the container or the container of the relation to null.protected void _setInput(boolean isInput) throws IllegalActionException
isInput
- True to make the port an input.IllegalActionException
- If changing the port status is
not permitted.protected void _setMultiport(boolean isMultiport) throws IllegalActionException
isMultiport
- True to make the port a multiport.IllegalActionException
- If changing the port status is
not permitted.protected void _setName(java.lang.String name) throws IllegalActionException, NameDuplicationException
name
- The name.IllegalActionException
- If the name has a period.NameDuplicationException
- If there is already a port
with the same name in the container.protected void _setOutput(boolean isOutput) throws IllegalActionException
isOutput
- True to make the port an output.IllegalActionException
- If changing the port status is
not permitted.protected void _checkContainer(Entity container) throws IllegalActionException
_checkContainer
in class TypedIOPort
container
- The proposed container.IllegalActionException
- If the proposed container is not a
TypedActor, or if the base class throws it.