org.jmodelica.modelica.compiler.CValueArray Class Reference

Constant value for array. More...

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

org.jmodelica.modelica.compiler.CValue

List of all members.

Public Member Functions

 CValueArray (Size s)
 Create a CValueArray of size s.
boolean isArray ()
 Check if this is an array.
CValueArray array ()
 Convenience method for accessing an array CValue as CValueArray.
void setCell (Index i, CValue val)
 Set the value of a specific cell of an array constant value.
void addCell (CValue val)
 Set the value of the next free cell of an array constant value.
CValue getCell (Index i)
 Get the value of a specific cell of an array constant value.
boolean reduceBoolean ()
 Reduce an array of constant boolean values to a single boolean.
Indices indices ()
 Returns the Indices associated with this constant array.
Size size ()
 Returns the array size of this constant value.
CValue convertInteger ()
 Convert each cell to CValueInteger.
CValue convertReal ()
 Convert each cell to CValueReal.
CValue convertBoolean ()
 Convert each cell to CValueBoolean.
CValue convertString ()
 Convert each cell to CValueString.
String toString ()
 Overloading of the toString() method.
FExp buildLiteral ()
 Create a literal AST node from constant.
Iterator< CValueiterator ()
 An iterator that iterates over all cells in the array.

Protected Attributes

Indices indices
CValue[] values


Detailed Description

Constant value for array.

Note that this class is mutable, care must be taken not to modify arrays that have already been returned. The only place where that should be done is during function evaluation, where CValues are used to represent mutable variable values. class :0


Constructor & Destructor Documentation

org.jmodelica.modelica.compiler.CValueArray.CValueArray ( Size  s  ) 

Create a CValueArray of size s.

The array is initially filled with unknown values. Individual values must be set with setCell().


Member Function Documentation

void org.jmodelica.modelica.compiler.CValueArray.addCell ( CValue  val  ) 

Set the value of the next free cell of an array constant value.

"Free" here means the cell after the last one set by addCell(), or the first cell if this is the first call.

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

Convenience method for accessing an array CValue as CValueArray.

Only valid for arrays.

Reimplemented from org.jmodelica.modelica.compiler.CValue.

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

Create a literal AST node from constant.

Returns:
FArray AST node containing literal expression nodes.

Reimplemented from org.jmodelica.modelica.compiler.CValue.

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

Convert each cell to CValueBoolean.

Reimplemented from org.jmodelica.modelica.compiler.CValue.

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

Convert each cell to CValueInteger.

Reimplemented from org.jmodelica.modelica.compiler.CValue.

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

Convert each cell to CValueReal.

Reimplemented from org.jmodelica.modelica.compiler.CValue.

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

Convert each cell to CValueString.

Reimplemented from org.jmodelica.modelica.compiler.CValue.

CValue org.jmodelica.modelica.compiler.CValueArray.getCell ( Index  i  ) 

Get the value of a specific cell of an array constant value.

Returns the Indices associated with this constant array.

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

Check if this is an array.

Reimplemented from org.jmodelica.modelica.compiler.CValue.

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

An iterator that iterates over all cells in the array.

Traverses the array in the same order as indices().iterator().

Reimplemented from org.jmodelica.modelica.compiler.CValue.

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

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

Used for the test expression of while statements.

Reimplemented from org.jmodelica.modelica.compiler.CValue.

void org.jmodelica.modelica.compiler.CValueArray.setCell ( Index  i,
CValue  val 
)

Set the value of a specific cell of an array constant value.

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

Returns the array size of this constant value.

Reimplemented from org.jmodelica.modelica.compiler.CValue.

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

Overloading of the toString() method.

Returns:
The string.

Reimplemented from org.jmodelica.modelica.compiler.CValue.


Member Data Documentation


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