org.pentaho.reporting.libraries.formula.lvalues
Class DefaultDataTable

java.lang.Object
  extended by org.pentaho.reporting.libraries.base.util.ObjectTable
      extended by org.pentaho.reporting.libraries.formula.lvalues.DefaultDataTable
All Implemented Interfaces:
Serializable, Cloneable, DataTable, LValue

public class DefaultDataTable
extends org.pentaho.reporting.libraries.base.util.ObjectTable
implements DataTable

Creation-Date: 05.11.2006, 13:34:01

Author:
Thomas Morgner, Cedric Pronzato
See Also:
Serialized Form

Constructor Summary
DefaultDataTable()
          Creates a new table.
DefaultDataTable(LValue[][] array)
           
 
Method Summary
 Object clone()
           
 TypeValuePair evaluate()
           
 ArrayCallback getAsArray()
           
 LValue[] getChildValues()
          Returns any dependent lvalues (parameters and operands, mostly).
 String getColumnName(int column)
           
 ParsePosition getParsePosition()
           
 LValue getValueAt(int row, int column)
           
 Type getValueType()
          Querying the value type is only valid *after* the value has been evaluated.
 void initialize(FormulaContext context)
           
 boolean isConstant()
          Checks whether the LValue is constant.
 void setObject(int row, int column, LValue object)
          Sets the object for a cell in the table.
 void setParsePosition(ParsePosition parsePosition)
           
 String toString()
           
 
Methods inherited from class org.pentaho.reporting.libraries.base.util.ObjectTable
clear, clearRow, ensureCapacity, equals, getColumnCount, getColumnIncrement, getRowCount, getRowIncrement, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pentaho.reporting.libraries.formula.lvalues.DataTable
getColumnCount, getRowCount
 

Constructor Detail

DefaultDataTable

public DefaultDataTable()
Creates a new table.


DefaultDataTable

public DefaultDataTable(LValue[][] array)
Method Detail

getParsePosition

public ParsePosition getParsePosition()
Specified by:
getParsePosition in interface LValue

setParsePosition

public void setParsePosition(ParsePosition parsePosition)

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface DataTable

setObject

public void setObject(int row,
                      int column,
                      LValue object)
Sets the object for a cell in the table. The table is expanded if necessary.

Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
object - the object.

getValueAt

public LValue getValueAt(int row,
                         int column)
Specified by:
getValueAt in interface DataTable

initialize

public void initialize(FormulaContext context)
                throws EvaluationException
Specified by:
initialize in interface LValue
Throws:
EvaluationException

evaluate

public TypeValuePair evaluate()
                       throws EvaluationException
Specified by:
evaluate in interface LValue
Throws:
EvaluationException

getAsArray

public ArrayCallback getAsArray()

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface LValue
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getValueType

public Type getValueType()
Querying the value type is only valid *after* the value has been evaluated.

Specified by:
getValueType in interface LValue
Returns:

getChildValues

public LValue[] getChildValues()
Returns any dependent lvalues (parameters and operands, mostly).

Specified by:
getChildValues in interface LValue
Returns:

isConstant

public boolean isConstant()
Checks whether the LValue is constant. Constant lvalues always return the same value.

Specified by:
isConstant in interface LValue
Returns:

toString

public String toString()
Overrides:
toString in class Object