org.jmodelica.modelica.compiler.CValue Class Reference

CValue represents a constant value and serves as the super class for constant value classes of the primitive types. More...

Inheritance diagram for org.jmodelica.modelica.compiler.CValue:

org.jmodelica.modelica.compiler.CValueArray org.jmodelica.modelica.compiler.CValueBoolean org.jmodelica.modelica.compiler.CValueEnum org.jmodelica.modelica.compiler.CValueInteger org.jmodelica.modelica.compiler.CValueReal org.jmodelica.modelica.compiler.CValueRecord org.jmodelica.modelica.compiler.CValueString org.jmodelica.modelica.compiler.CValueUnknown

List of all members.

Public Member Functions

String errorDesc ()
 Get a string describing this CValue for use in ConstantEvaluationExceptions.
int intValue ()
 Convert to int, default implementation.
double realValue ()
 Convert to double, default implementation.
boolean booleanValue ()
 Convert to boolean, default implementation.
String stringValue ()
 Convert to string, default implementation.
FExp buildLiteral ()
 Create a literal AST node from constant, default implementation.
CValue convertInteger ()
 Convert to CValueInteger, default implementation.
CValue convertReal ()
 Convert to CValueReal, default implementation.
CValue convertBoolean ()
 Convert to CValueBoolean, default implementation.
CValue convertString ()
 Convert to CValueString, default implementation.
boolean isNumeric ()
 Returns true if the constant value is of numeric type.
boolean isUnknown ()
 Check if there was an error in the evaluation.
boolean isUnsupported ()
 Check if there was a compliance error in the evaluation.
String toString ()
 Overloading of the toString() method.
boolean isArray ()
 Check if this is an array.
CValueArray array ()
 Convenience method for accessing an array CValue as CValueArray.
boolean isRecord ()
 Check if this is a record.
CValueRecord record ()
 Convenience method for accessing a record CValue as CValueRecord.
boolean reduceBoolean ()
 Reduce an array of constant boolean values to a single boolean.
Size size ()
 Returns the array size of this constant value.
Iterator< CValueiterator ()
 Iterates over all array cells in CValue.
CValue valueXML ()

Static Public Attributes

static final CValue UNKNOWN = new CValueUnknown()
 An unknown value.
static final CValue UNSUPPORTED = new CValueUnsupported()
 An unknown value for an expression that constant evaluation isn't supported for.

Protected Member Functions

 CValue ()
 Default constructor.


Detailed Description

CValue represents a constant value and serves as the super class for constant value classes of the primitive types.

class :0


Constructor & Destructor Documentation

org.jmodelica.modelica.compiler.CValue.CValue (  )  [protected]

Default constructor.


Member Function Documentation

CValueArray org.jmodelica.modelica.compiler.CValue.array (  ) 

Convenience method for accessing an array CValue as CValueArray.

Only valid for arrays.

Reimplemented in org.jmodelica.modelica.compiler.CValueArray.

boolean org.jmodelica.modelica.compiler.CValue.booleanValue (  ) 

Convert to boolean, default implementation.

Returns:
Value converted to boolean.

Reimplemented in org.jmodelica.modelica.compiler.CValueBoolean.

FExp org.jmodelica.modelica.compiler.CValue.buildLiteral (  ) 

CValue org.jmodelica.modelica.compiler.CValue.convertBoolean (  ) 

CValue org.jmodelica.modelica.compiler.CValue.convertInteger (  ) 

CValue org.jmodelica.modelica.compiler.CValue.convertReal (  ) 

CValue org.jmodelica.modelica.compiler.CValue.convertString (  ) 

String org.jmodelica.modelica.compiler.CValue.errorDesc (  ) 

Get a string describing this CValue for use in ConstantEvaluationExceptions.

Reimplemented in org.jmodelica.modelica.compiler.CValueString, and org.jmodelica.modelica.compiler.CValueUnknown.

int org.jmodelica.modelica.compiler.CValue.intValue (  ) 

boolean org.jmodelica.modelica.compiler.CValue.isArray (  ) 

Check if this is an array.

Reimplemented in org.jmodelica.modelica.compiler.CValueArray.

boolean org.jmodelica.modelica.compiler.CValue.isNumeric (  ) 

Returns true if the constant value is of numeric type.

Returns:
True if the constant is a numerical value.

Reimplemented in org.jmodelica.modelica.compiler.CValueInteger, and org.jmodelica.modelica.compiler.CValueReal.

boolean org.jmodelica.modelica.compiler.CValue.isRecord (  ) 

Check if this is a record.

Reimplemented in org.jmodelica.modelica.compiler.CValueRecord.

boolean org.jmodelica.modelica.compiler.CValue.isUnknown (  ) 

Check if there was an error in the evaluation.

Returns:
true if there was an error, otherwise false.

Reimplemented in org.jmodelica.modelica.compiler.CValueUnknown.

boolean org.jmodelica.modelica.compiler.CValue.isUnsupported (  ) 

Check if there was a compliance error in the evaluation.

Returns:
true if there was a compliance error, otherwise false.

Reimplemented in org.jmodelica.modelica.compiler.CValueUnsupported.

Iterator<CValue> org.jmodelica.modelica.compiler.CValue.iterator (  ) 

Iterates over all array cells in CValue.

A scalar CValue is considered to have a single array cell.

Reimplemented in org.jmodelica.modelica.compiler.CValueArray.

double org.jmodelica.modelica.compiler.CValue.realValue (  ) 

Convert to double, default implementation.

Returns:
Value converted to double.

Reimplemented in org.jmodelica.modelica.compiler.CValueInteger, and org.jmodelica.modelica.compiler.CValueReal.

CValueRecord org.jmodelica.modelica.compiler.CValue.record (  ) 

Convenience method for accessing a record CValue as CValueRecord.

Only valid for records.

Reimplemented in org.jmodelica.modelica.compiler.CValueRecord.

boolean org.jmodelica.modelica.compiler.CValue.reduceBoolean (  ) 

Reduce an array of constant boolean values to a single boolean.

Used for the test expression of while statements. For scalar constant values, just returns the boolean value.

Reimplemented in org.jmodelica.modelica.compiler.CValueArray.

Size org.jmodelica.modelica.compiler.CValue.size (  ) 

Returns the array size of this constant value.

Reimplemented in org.jmodelica.modelica.compiler.CValueArray.

String org.jmodelica.modelica.compiler.CValue.stringValue (  ) 

String org.jmodelica.modelica.compiler.CValue.toString (  ) 

CValue org.jmodelica.modelica.compiler.CValue.valueXML (  ) 


Member Data Documentation

An unknown value.

An unknown value for an expression that constant evaluation isn't supported for.


The documentation for this class was generated from the following file:

Generated on Fri Oct 7 14:49:34 2011 for JModelica.org by  doxygen 1.5.8