ptolemy.actor.lib.hoc
Class IterateOverArray.IteratePort

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.Port
          extended by ptolemy.kernel.ComponentPort
              extended by ptolemy.actor.IOPort
                  extended by ptolemy.actor.TypedIOPort
                      extended by ptolemy.actor.lib.hoc.MirrorPort
                          extended by ptolemy.actor.lib.hoc.IterateOverArray.IteratePort
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HasTypeConstraints, Typeable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
Enclosing class:
IterateOverArray

public static class IterateOverArray.IteratePort
extends MirrorPort

This is a specialized port for IterateOverArray. If the container is an instance of IterateOverArray, then it handles type conversions between the array types of the ports of the enclosing IterateOverArray actor and the scalar types (or arrays with one less dimension) of the actor that are contained. It has a notion of an "associated port," and ensures that changes to the status of one port (whether it is input, output, or multiport) are reflected in the associated port.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.actor.TypedIOPort
TYPE
 
Fields inherited from class ptolemy.actor.IOPort
_hasPortEventListeners, _portEventListeners, 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, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
IterateOverArray.IteratePort(TypedCompositeActor container, java.lang.String name)
          Create a new instance of a port for IterateOverArray.
IterateOverArray.IteratePort(Workspace workspace)
          Construct a port in the specified workspace with an empty string as a name.
 
Method Summary
 Token convert(Token token)
          Override the base class to convert the token to the element type rather than to the type of the port.
 void sendInside(int channelIndex, Token token)
          Override the base class to convert the token to the element type rather than to the type of the port.
 
Methods inherited from class ptolemy.actor.lib.hoc.MirrorPort
clone, getAssociatedPort, setAssociatedPort, setContainer, setInput, setMultiport, setName, setOutput
 
Methods inherited from class ptolemy.actor.TypedIOPort
_checkContainer, _checkLiberalLink, _checkLink, _checkType, _description, addTypeListener, attributeChanged, broadcast, broadcast, getType, getTypeTerm, isTypeAcceptable, removeTypeListener, send, send, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, typeConstraintList, typeConstraints
 
Methods inherited from class ptolemy.actor.IOPort
_checkLiberalLink, _exportMoMLContents, _getInsideWidth, _getOutsideWidth, _getReceiversLinkedToGroup, _newInsideReceiver, _newReceiver, _notifyPortEventListeners, _removeReceivers, addIOPortEventListener, broadcastClear, checkWidthConstraints, createReceivers, deepConnectedInPortList, deepConnectedInPorts, deepConnectedOutPortList, deepConnectedOutPorts, deepGetReceivers, get, get, getChannelForReceiver, getCurrentTime, getDefaultWidth, getInside, getInsideReceivers, getModelTime, getReceivers, getReceivers, getReceivers, getRelationIndex, getRemoteReceivers, getRemoteReceivers, getWidth, getWidthFromConstraints, getWidthInside, hasRoom, hasRoomInside, hasToken, hasToken, hasTokenInside, hasWidthConstraints, insertLink, insideSinkPortList, insideSourcePortList, isInput, isInsideConnected, isKnown, isKnown, isKnownInside, isMultiport, isOutput, isOutsideConnected, liberalLink, link, numberOfSinks, numberOfSources, removeIOPortEventListener, 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, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, numLinks
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, 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, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IterateOverArray.IteratePort

public IterateOverArray.IteratePort(Workspace workspace)
Construct a port in the specified workspace with an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. The object is added to the workspace directory. Increment the version number of the workspace.

Parameters:
workspace - The workspace that will list the port.

IterateOverArray.IteratePort

public IterateOverArray.IteratePort(TypedCompositeActor container,
                                    java.lang.String name)
                             throws IllegalActionException,
                                    NameDuplicationException
Create a new instance of a port for IterateOverArray.

Parameters:
container - The container for the port.
name - The name of the port.
Throws:
IllegalActionException - Not thrown in this base class.
NameDuplicationException - Not thrown in this base class.
Method Detail

convert

public Token convert(Token token)
              throws IllegalActionException
Override the base class to convert the token to the element type rather than to the type of the port.

Overrides:
convert in class TypedIOPort
Parameters:
token - The token to convert.
Returns:
The converted token.
Throws:
IllegalActionException - If the conversion is invalid.

sendInside

public void sendInside(int channelIndex,
                       Token token)
                throws IllegalActionException,
                       NoRoomException
Override the base class to convert the token to the element type rather than to the type of the port.

Overrides:
sendInside in class TypedIOPort
Parameters:
channelIndex - The index of the channel, from 0 to width-1
token - The token to send
Throws:
NoRoomException - If there is no room in the receiver.
IllegalActionException - Not thrown in this base class.