ptolemy.actor.ptalon
Class PtalonParameter
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.kernel.util.AbstractSettableAttribute
ptolemy.data.expr.Variable
ptolemy.data.expr.Parameter
ptolemy.actor.ptalon.PtalonParameter
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, HasTypeConstraints, Typeable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable, Settable, ValueListener
- Direct Known Subclasses:
- PtalonExpressionParameter
public class PtalonParameter
- extends Parameter
A Parameter created in a Ptalon file.
- Version:
- $Id: PtalonParameter.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Adam Cataldo, Elaine Cheong
- See Also:
PtalonActor
,
Serialized Form
- Accepted Rating:
- Proposed Rating:
Field Summary |
private boolean |
_hasValue
True if this parameter has a value. |
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 |
PtalonParameter(NamedObj container,
java.lang.String name)
Construct a parameter with the given name contained by the
specified entity. |
Method Summary |
void |
clearValue()
Mark this parameter so that subsequent calls to hasValue() will
return false until a value is explicitly set with setExpression(String) , setToken(String) or setToken(Token) . |
boolean |
hasValue()
Return true if this parameter's value has been set. |
void |
setExpression(java.lang.String expr)
Set the expression and flag that the value has been set for
this parameter. |
void |
setToken(java.lang.String expression)
Set the token and flag that the value has been set for this
parameter. |
void |
setToken(Token token)
Set the token and flag that the value has been set for this
parameter. |
Methods inherited from class ptolemy.data.expr.Variable |
_description, _evaluate, _notifyValueListeners, _parseIfNecessary, _propagate, _propagateToValueListeners, _propagateValue, _setToken, _setTokenAndNotify, addValueListener, clone, getDeclaredType, getExpression, getFreeIdentifiers, getParserScope, getScope, getScope, getToken, getType, getTypeTerm, getValueAsString, getVariable, getVisibility, invalidate, isKnown, isLazy, isStringMode, isTypeAcceptable, removeValueListener, reset, setContainer, setLazy, setName, setParseTreeEvaluator, setStringMode, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, setUnknown, setVisibility, stringRepresentation, toString, typeConstraintList, typeConstraints, validate, valueChanged |
Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, 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, uniqueName, validateSettables, workspace |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_hasValue
private boolean _hasValue
- True if this parameter has a value.
PtalonParameter
public PtalonParameter(NamedObj container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
- Construct a parameter with the given name contained by the
specified entity. The container argument must not be null, or
a NullPointerException will be thrown. This parameter 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. The object is not added to the
list of objects in the workspace unless the container is null.
Increment the version of the workspace.
- Parameters:
container
- The container.name
- The name of the parameter.
- Throws:
IllegalActionException
- If the parameter is not of an
acceptable class for the container.
NameDuplicationException
- If the name coincides with
a parameter already in the container.
clearValue
public void clearValue()
- Mark this parameter so that subsequent calls to
hasValue()
will
return false until a value is explicitly set with setExpression(String)
, setToken(String)
or setToken(Token)
.
hasValue
public boolean hasValue()
- Return true if this parameter's value has been set.
- Returns:
- true If this parameter's value has been set.
setExpression
public void setExpression(java.lang.String expr)
- Set the expression and flag that the value has been set for
this parameter.
- Specified by:
setExpression
in interface Settable
- Overrides:
setExpression
in class Variable
- Parameters:
expr
- The expression to set.- See Also:
Variable.getExpression()
setToken
public void setToken(java.lang.String expression)
throws IllegalActionException
- Set the token and flag that the value has been set for this
parameter.
- Overrides:
setToken
in class Variable
- Parameters:
expression
- The expression for this token
- Throws:
IllegalActionException
- If the superclass throws one.- See Also:
Variable.getToken()
,
Variable.setExpression(String)
,
Variable.validate()
setToken
public void setToken(Token token)
throws IllegalActionException
- Set the token and flag that the value has been set for this
parameter.
- Overrides:
setToken
in class Variable
- Parameters:
token
- The token to set.
- Throws:
IllegalActionException
- If the superclass throws one.- See Also:
Variable.getToken()