ptolemy.actor.gt.util
Class PtolemyExpressionString

java.lang.Object
  extended by 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: PtolemyExpressionString.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Field Summary
private  Token _token
          The last evaluation result.
private  java.lang.String _value
          The Ptolemy expression.
private  ASTPtRootNode _valueParseTree
          The value parse tree.
private  VariableScope _variableScope
          The scope in which the Ptolemy expression is evaluated.
 
Constructor Summary
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
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_token

private Token _token
The last evaluation result.


_value

private java.lang.String _value
The Ptolemy expression.


_valueParseTree

private ASTPtRootNode _valueParseTree
The value parse tree.


_variableScope

private VariableScope _variableScope
The scope in which the Ptolemy expression is evaluated.

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 class java.lang.Object
Returns:
The Ptolemy expression.