ptolemy.actor.ptalon.gt
Class PtalonMatcher

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.InstantiableNamedObj
          extended by ptolemy.kernel.Entity
              extended by ptolemy.kernel.ComponentEntity
                  extended by ptolemy.kernel.CompositeEntity
                      extended by ptolemy.actor.CompositeActor
                          extended by ptolemy.actor.TypedCompositeActor
                              extended by ptolemy.actor.ptalon.gt.PtalonMatcher
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, GTCompositeActor, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class PtalonMatcher
extends TypedCompositeActor
implements GTCompositeActor

A graph transformation matcher for Ptalon.

Since:
Ptolemy II 8.0
Version:
$Id: PtalonMatcher.java 59167 2010-09-21 17:08:02Z cxh $
Author:
Thomas Huining Feng
See Also:
Serialized Form
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Nested Class Summary
private static class PtalonMatcher.HashKey
           
static class PtalonMatcher.NestedPtalonActor
          A nested ptalon actor.
 
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity
CompositeEntity.ContainedObjectsIterator
 
Field Summary
private  java.util.Map<PtalonMatcher.HashKey,PtalonMatcher.NestedPtalonActor> _actors
           
private  PtalonMatcher.NestedPtalonActor _currentActor
           
private  PtalonMatcher.HashKey _currentKey
           
private  boolean _handleAttributeChange
           
private static java.lang.String _IGNORING_ATTRIBUTE_NAME
           
private static java.lang.String _MIRRORED_PARAMETER_PREFIX
           
 FileParameter ptalonCodeLocation
          The location of the Ptalon code.
 
Fields inherited from class ptolemy.actor.CompositeActor
_actorFiringListeners, _causalityInterface, _initializables, _notifyingActorFiring, _publishedPorts, _publisherRelations, _stopRequested
 
Fields inherited from class ptolemy.kernel.CompositeEntity
_levelCrossingLinks
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
PtalonMatcher(CompositeEntity container, java.lang.String name)
          Construct a PtalonMatcher with a name and a container.
 
Method Summary
private  void _createParameters()
           
private  void _createPtalonActor(PtalonMatcher.HashKey key)
           
private  PtalonMatcher.HashKey _getKey()
           
private  PtalonMatcher.HashKey _getKey(PtalonActor actor)
           
private  void _mirrorPtalonActor()
           
private  void _rearrangePtalonActors()
           
 void attributeChanged(Attribute attribute)
          Setup parameters for this actor.
 void clearActors()
          Clear the list of actors.
 void setContainer(CompositeEntity container)
          Set the container.
 
Methods inherited from class ptolemy.actor.TypedCompositeActor
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _typeConstraintsFromTo, newPort, newRelation, resolveTypes, typeConstraintList, typeConstraints
 
Methods inherited from class ptolemy.actor.CompositeActor
_actorFiring, _actorFiring, _finishedAddEntity, _getPublishedPort, _setDirector, addActorFiringListener, addInitializable, addPiggyback, clone, connectionsChanged, createReceivers, createSchedule, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inferringWidths, inferWidths, initialize, inputPortList, isFireFunctional, isOpaque, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, preinitialize, recordFiring, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, wrapup
 
Methods inherited from class ptolemy.kernel.CompositeEntity
_adjustDeferrals, _deepOpaqueEntityList, _description, _exportMoMLContents, _recordDecoratedAttributes, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allCompositeEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepEntityList, deepGetEntities, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_removePort, connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.TypedActor
typeConstraints
 
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
 
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, initialize, preinitialize, removeInitializable, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 

Field Detail

ptalonCodeLocation

public FileParameter ptalonCodeLocation
The location of the Ptalon code.


_IGNORING_ATTRIBUTE_NAME

private static final java.lang.String _IGNORING_ATTRIBUTE_NAME
See Also:
Constant Field Values

_MIRRORED_PARAMETER_PREFIX

private static final java.lang.String _MIRRORED_PARAMETER_PREFIX
See Also:
Constant Field Values

_actors

private java.util.Map<PtalonMatcher.HashKey,PtalonMatcher.NestedPtalonActor> _actors

_currentActor

private PtalonMatcher.NestedPtalonActor _currentActor

_currentKey

private PtalonMatcher.HashKey _currentKey

_handleAttributeChange

private boolean _handleAttributeChange
Constructor Detail

PtalonMatcher

public PtalonMatcher(CompositeEntity container,
                     java.lang.String name)
              throws IllegalActionException,
                     NameDuplicationException
Construct a PtalonMatcher with a name and a container. The container argument must not be null, or a NullPointerException will be thrown. This actor will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace. This actor will have no local director initially, and its executive director will be simply the director of the container.

Parameters:
container - The container.
name - The name of this actor.
Throws:
IllegalActionException - If the container is incompatible with this actor.
NameDuplicationException - If the name coincides with an actor already in the container.
Method Detail

attributeChanged

public void attributeChanged(Attribute attribute)
                      throws IllegalActionException
Setup parameters for this actor.

Overrides:
attributeChanged in class NamedObj
Parameters:
attribute - The attribute that changed.
Throws:
IllegalActionException - If there are problems setting up parameters for this actor, or if the superclass throws it.

clearActors

public void clearActors()
Clear the list of actors.


setContainer

public void setContainer(CompositeEntity container)
                  throws IllegalActionException,
                         NameDuplicationException
Set the container.

Overrides:
setContainer in class CompositeActor
Parameters:
container - The proposed container.
Throws:
IllegalActionException - If the action would result in a recursive containment structure, or if this entity and container are not in the same workspace.
NameDuplicationException - If the container already has an entity with the name of this entity.
See Also:
ComponentEntity.getContainer()

_createParameters

private void _createParameters()
                        throws IllegalActionException,
                               NameDuplicationException,
                               java.lang.CloneNotSupportedException
Throws:
IllegalActionException
NameDuplicationException
java.lang.CloneNotSupportedException

_createPtalonActor

private void _createPtalonActor(PtalonMatcher.HashKey key)
                         throws IllegalActionException,
                                NameDuplicationException
Throws:
IllegalActionException
NameDuplicationException

_getKey

private PtalonMatcher.HashKey _getKey()
                               throws IllegalActionException
Throws:
IllegalActionException

_getKey

private PtalonMatcher.HashKey _getKey(PtalonActor actor)
                               throws IllegalActionException
Throws:
IllegalActionException

_mirrorPtalonActor

private void _mirrorPtalonActor()
                         throws IllegalActionException,
                                NameDuplicationException,
                                java.lang.CloneNotSupportedException
Throws:
IllegalActionException
NameDuplicationException
java.lang.CloneNotSupportedException

_rearrangePtalonActors

private void _rearrangePtalonActors()
                             throws IllegalActionException,
                                    NameDuplicationException
Throws:
IllegalActionException
NameDuplicationException