Package ptolemy.actor.gt.util
Class PtolemyExpressionString
- java.lang.Object
-
- ptolemy.actor.gt.util.PtolemyExpressionString
-
public class PtolemyExpressionString extends java.lang.Object
A wrapper for a string containing a Ptolemy expression.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Thomas Huining Feng
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Constructor Summary
Constructors Constructor Description PtolemyExpressionString()
Construct a Ptolemy expression string.PtolemyExpressionString(NamedObj container)
Construct a Ptolemy expression string with the given container as its scope.PtolemyExpressionString(NamedObj container, java.lang.String value)
Construct a Ptolemy expression string with the given container as its scope and the given value as its initial value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
get()
Get the current value.Token
getToken()
Evaluate the Ptolemy expression and return the result in a token.void
set(java.lang.String value)
Set the value.java.lang.String
toString()
Return the Ptolemy expression in a string.
-
-
-
Constructor Detail
-
PtolemyExpressionString
public PtolemyExpressionString()
Construct a Ptolemy expression string.
-
PtolemyExpressionString
public PtolemyExpressionString(NamedObj container)
Construct a Ptolemy expression string with the given container as its scope.- Parameters:
container
- The container.
-
PtolemyExpressionString
public PtolemyExpressionString(NamedObj container, java.lang.String value)
Construct a Ptolemy expression string with the given container as its scope and the given value as its initial value.- Parameters:
container
- The container.value
- The initial value.
-
-
Method Detail
-
get
public java.lang.String get()
Get the current value.- Returns:
- The value.
- See Also:
set(String)
-
getToken
public Token getToken() throws IllegalActionException
Evaluate the Ptolemy expression and return the result in a token.- Returns:
- The result.
- Throws:
IllegalActionException
- If error occurs in the evaluation.
-
set
public void set(java.lang.String value)
Set the value.- Parameters:
value
- The value.- See Also:
get()
-
toString
public java.lang.String toString()
Return the Ptolemy expression in a string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The Ptolemy expression.
-
-