|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ptolemy.kernel.util.NamedObj ptolemy.kernel.InstantiableNamedObj ptolemy.kernel.Entity ptolemy.kernel.ComponentEntity ptolemy.kernel.CompositeEntity ptolemy.actor.CompositeActor ptolemy.actor.TypedCompositeActor ptolemy.actor.ptalon.PtalonActor
public class PtalonActor
An aggregation of typed actors, specified by a Ptalon program.
A TypedCompositeActor is an aggregation of typed actors. A PtalonActor is a TypedCompositeActor whose aggregation is specified by a Ptalon program in an external file. This file is loaded during initialization, and is specified in a FileParameter called ptalonCodeLocation.
Yellow (celaine) |
Yellow (celaine) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity |
---|
CompositeEntity.ContainedObjectsIterator |
Field Summary | |
---|---|
private java.util.List<PtalonParameter> |
_assignedPtalonParameters
A list of all ptalon parameters that have been assigned a value. |
private java.util.Hashtable<java.lang.String,PtalonParameter> |
_assignedPtalonParametersCopy
A table of copies of all the elements in _assignedPtalonParameters. |
private java.util.Hashtable<java.lang.String,Token> |
_assignedPtalonParametersCopyValues
A table of copies of token values of all of the elements in _assignedPtalonParameters. |
private PtalonAST |
_ast
The abstract syntax tree for the PtalonActor. |
private boolean |
_astCreated
A boolean whose value is true if the AST has been created. |
private PtalonEvaluator |
_codeManager
Information generated about the Ptalon code that is used by the compiler. |
private java.lang.String |
_configureSource
The text representation of the URL for this object. |
private int |
_nestedDepth
The depth for this actor with respect to nested actor declarations. |
private java.util.List<PtalonParameter> |
_ptalonParameters
The list of all ptalon parameters for this actor. |
private java.util.List<PtalonParameter> |
_unsettablePtalonParameters
The list of all ptalon parameters who are not settable by the user. |
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 | |
---|---|
PtalonActor(CompositeEntity container,
java.lang.String name)
Construct a PtalonActor with a name and a container. |
Method Summary | |
---|---|
protected void |
_addAttribute(Attribute attribute)
Add the attribute, and if the attribute is a PtalonParameter, add it to a list of Ptalon parameters. |
protected PtalonEvaluator |
_createPtalonEvaluator(PtalonActor actor)
|
protected PtalonPopulator |
_createPtalonPopulator()
|
protected PtalonRecognizer |
_createPtalonRecognizer(PtalonLexer lexer)
Create Ptalon parser. |
protected void |
_exportMoMLContents(java.io.Writer output,
int depth)
Write a MoML description of the contents of this object, which in this class is the configuration information. |
protected void |
_initializePtalonActor()
Initialize this PtalonActor. |
protected void |
_initializePtalonCodeLocation()
This helper method is used to begin the Ptalon compiler if the ptalonCodeLocation attribute has been updated. |
private boolean |
_isValueChanged(PtalonParameter p)
Return true if the value of the given PtalonParameter has changed. |
protected void |
_removeContents()
|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute. |
void |
configure(java.net.URL base,
java.lang.String source,
java.lang.String text)
Read the saved XML for this PtalonActor. |
java.lang.String |
getConfigureSource()
Return the input source that was specified the last time the configure() method was called. |
java.lang.String |
getConfigureText()
Override the default behavior to always return null. |
java.lang.String |
getMappedName(java.lang.String ptalonName)
Get the stored unique name for a symbol in the PtalonActor. |
int |
getNestedDepth()
Return the depth of this PtalonActor declaration with respect to its creator. |
PtalonParameter |
getPtalonParameter(java.lang.String name)
Find the parameter in the Ptalon code with the specified name, and return the Ptolemy parameter (java) that was created. |
void |
setNestedDepth(int depth)
Set the depth of this PtalonActor declaration with respect to its creator. |
java.lang.String |
uniqueName(java.lang.String prefix)
Return a name that is guaranteed to not be the name of any contained attribute, port, class, entity, or relation. |
Methods inherited from class ptolemy.actor.TypedCompositeActor |
---|
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _typeConstraintsFromTo, newPort, newRelation, resolveTypes, typeConstraintList, typeConstraints |
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 java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 |
---|
public FileParameter ptalonCodeLocation
private java.util.List<PtalonParameter> _assignedPtalonParameters
private java.util.Hashtable<java.lang.String,PtalonParameter> _assignedPtalonParametersCopy
private java.util.Hashtable<java.lang.String,Token> _assignedPtalonParametersCopyValues
private PtalonAST _ast
private boolean _astCreated
private PtalonEvaluator _codeManager
private java.lang.String _configureSource
private int _nestedDepth
private java.util.List<PtalonParameter> _ptalonParameters
private java.util.List<PtalonParameter> _unsettablePtalonParameters
Constructor Detail |
---|
public PtalonActor(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor.
IllegalActionException
- If the container is incompatible
with this actor.
NameDuplicationException
- If the name coincides with
an actor already in the container.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
We choose to implement this in attributeChanged() instead if preinitialize() because we want changes to be reflected immediately, since preinitialize() is only processed after the model starts to run.
attributeChanged
in class NamedObj
attribute
- The attribute that changed.
IllegalActionException
- If the change is not
acceptable to this container (not thrown in this base class).public void configure(java.net.URL base, java.lang.String source, java.lang.String text) throws java.lang.Exception
configure
in interface Configurable
base
- The base relative to which references within the input
are found, or null if this is not known, or there is none.source
- The input source, which specifies a URL, or null
if none.text
- Configuration information given as text, or null if
none.
java.lang.Exception
- If something goes wrong.public java.lang.String getConfigureSource()
getConfigureSource
in interface Configurable
public java.lang.String getConfigureText()
getConfigureText
in interface Configurable
public java.lang.String getMappedName(java.lang.String ptalonName) throws PtalonRuntimeException
ptalonName
- The symbol.
PtalonRuntimeException
- If no such symbol exists.public int getNestedDepth()
setNestedDepth(int)
public PtalonParameter getPtalonParameter(java.lang.String name) throws PtalonRuntimeException
name
- The name of the parameter in the Ptalon code,
which may be a prefix of the actual parameter's name.
PtalonRuntimeException
- If no such PtalonParameter
exists.public void setNestedDepth(int depth)
depth
- The of this actor declaration with respect to its
creator.getNestedDepth()
public java.lang.String uniqueName(java.lang.String prefix)
uniqueName
in class CompositeEntity
prefix
- A prefix for the name.
protected void _addAttribute(Attribute attribute) throws NameDuplicationException, IllegalActionException
_addAttribute
in class NamedObj
attribute
- The attribute to be added.
NameDuplicationException
- If the superclass throws it.
IllegalActionException
- If the superclass throws it.protected PtalonEvaluator _createPtalonEvaluator(PtalonActor actor)
protected PtalonPopulator _createPtalonPopulator()
protected PtalonRecognizer _createPtalonRecognizer(PtalonLexer lexer)
PtalonRecognizer
instance with the given lexer. Subclasses may override
this function to return a customized parser.
lexer
- The lexer.
protected void _exportMoMLContents(java.io.Writer output, int depth) throws java.io.IOException
_exportMoMLContents
in class CompositeEntity
output
- The output stream for writing.depth
- The depth in the hierarchy, to determine indenting.
java.io.IOException
- If an I/O error occurs.NamedObj.exportMoML(Writer, int)
protected void _initializePtalonActor()
protected void _initializePtalonCodeLocation() throws IllegalActionException
IllegalActionException
- If any exception is thrown.protected void _removeContents()
private boolean _isValueChanged(PtalonParameter p) throws IllegalActionException
p
- The PtalonParameter to check.
IllegalActionException
- If unable to compare the token
value of p with its previously stored value.attributeChanged(Attribute)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |