ptolemy.actor.gt
Class PortMatcher

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.gt.PortMatcher
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Checkable, HasTypeConstraints, Typeable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class PortMatcher
extends TypedIOPort
implements Checkable

A matcher to match a port.

Since:
Ptolemy II 6.1
Version:
$Id: PortMatcher.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Thomas Huining Feng
See Also:
Serialized Form
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private  PortCriterion _criterion
          The criterion, or null.
 
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
PortMatcher(PortCriterion criterion, ComponentEntity container, java.lang.String name, boolean isInput, boolean isOutput)
          Construct a port matcher with a container and a name that is either an input, an output, or both, depending on the third and fourth arguments.
 
Method Summary
protected  void _setPortCriterion(PortCriterion criterion)
          Set the PortCriterion.
 Criterion getCriterion()
          Return the criterion.
 void setContainer(Entity container)
          Set container of this port matcher.
 
Methods inherited from class ptolemy.actor.TypedIOPort
_checkContainer, _checkLiberalLink, _checkLink, _checkType, _description, addTypeListener, attributeChanged, broadcast, broadcast, clone, convert, getType, getTypeTerm, isTypeAcceptable, removeTypeListener, send, send, sendInside, 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, 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, setName
 
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
 

Field Detail

_criterion

private PortCriterion _criterion
The criterion, or null.

Constructor Detail

PortMatcher

public PortMatcher(PortCriterion criterion,
                   ComponentEntity container,
                   java.lang.String name,
                   boolean isInput,
                   boolean isOutput)
            throws IllegalActionException,
                   NameDuplicationException
Construct a port matcher with a container and a name that is either an input, an output, or both, depending on the third and fourth arguments. The specified container must implement the TypedActor interface or an exception will be thrown.

Parameters:
criterion - The criterion for this port matcher, or null if this port matcher is not created for a PortCriterion.
container - The container actor.
name - The name of the port.
isInput - True if this is to be an input port.
isOutput - True if this is to be an output 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

getCriterion

public Criterion getCriterion()
Return the criterion.

Specified by:
getCriterion in interface Checkable
Returns:
The criterion, or null if this port is not created for a PortCriterion.

setContainer

public void setContainer(Entity container)
                  throws IllegalActionException,
                         NameDuplicationException
Set container of this port matcher. If this port matcher is to be removed and it was created for a PortCriterion, remove the criterion from the container of this port.

Overrides:
setContainer in class IOPort
Parameters:
container - The new container, or null if this port matcher is to be removed.
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 null
NameDuplicationException - If the container already has a port with the name of this port.
See Also:
Port.getContainer(), Port._checkContainer(Entity)

_setPortCriterion

protected void _setPortCriterion(PortCriterion criterion)
Set the PortCriterion.

Parameters:
criterion - The criterion.