ptolemy.actor.lib.conversions
Class ExpressionToToken
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Transformer
ptolemy.actor.lib.conversions.Converter
ptolemy.actor.lib.conversions.ExpressionToToken
- All Implemented Interfaces:
- Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, TypedActor
- public class ExpressionToToken
- extends Converter
This actor reads a string expression from the input port and outputs
the token resulting from the evaluation. The type of the output port
defaults to general, meaning that the only output will be a pure
event. In order to usefully use this class, the type of the output
port must be set to the type of the expression that is expected.
- Since:
- Ptolemy II 2.1
- Version:
- $Id: ExpressionToToken.java,v 1.17 2004/04/13 05:13:13 cxh Exp $
- Author:
- Steve Neuendorffer
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
|
Method Summary |
void |
fire()
Output a token that results from evaluating the expression given
by the input string token. |
boolean |
prefire()
Return true if and only if an input is present. |
void |
wrapup()
Wrapup execution of this actor. |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, iterate, newReceiver, outputPortList, postfire, preinitialize, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate |
| Methods inherited from class ptolemy.kernel.Entity |
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables |
| Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ExpressionToToken
public ExpressionToToken(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
- Construct an actor with the given container and name.
- Parameters:
container - The container.name - The name of this actor.
- Throws:
IllegalActionException - If the actor cannot be contained
by the proposed container.
NameDuplicationException - If the container already has an
actor with this name.
fire
public void fire()
throws IllegalActionException
- Output a token that results from evaluating the expression given
by the input string token.
- Specified by:
fire in interface Executable- Overrides:
fire in class AtomicActor
- Throws:
IllegalActionException - If there is no director, or
if the expression read from the input cannot be parsed.
prefire
public boolean prefire()
throws IllegalActionException
- Return true if and only if an input is present.
- Specified by:
prefire in interface Executable- Overrides:
prefire in class AtomicActor
- Returns:
- True if this actor is ready for firing, false otherwise.
- Throws:
IllegalActionException - If there is no director, or
if no connection has been made to the input.
wrapup
public void wrapup()
- Wrapup execution of this actor. This method overrides the
base class to discard the internal parser to save memory.
- Specified by:
wrapup in interface Executable- Overrides:
wrapup in class AtomicActor