http://www.eteks.com

com.eteks.jeks
Class JeksExpression

java.lang.Object
  |
  +--com.eteks.parser.CompiledExpression
        |
        +--com.eteks.jeks.JeksExpression
All Implemented Interfaces:
java.io.Serializable

public class JeksExpression
extends CompiledExpression

Cell values for computed expressions in a table.

Since:
Jeks 1.0
Version:
1.0
Author:
Emmanuel Puybaret
See Also:
Serialized Form

Constructor Summary
JeksExpression(CompiledExpression expression)
           
 
Method Summary
 void checkCircularity(javax.swing.table.TableModel model, JeksCell startCell)
          Parses recursely all the parameters of this expression to check if computing the formula of the referenced cells won't produce a circularity.
 java.lang.Object getValue(Interpreter interpreter)
          Returns the value of this expression computed with the computeExpression () method.
 void invalidateValue()
          Invalidates the value stored by this expression to force the computation of the expression next time getValue () will be called.
 void invalidateValue(CircularityException ex)
          Invalidates the value stored by this expression with with the circularity exception ex.
 
Methods inherited from class com.eteks.parser.CompiledExpression
computeExpression, computeExpression, getDefinition, getExpressionParameter, getExpressionTree, getParameterCount, getParameters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JeksExpression

public JeksExpression(CompiledExpression expression)
Method Detail

getValue

public java.lang.Object getValue(Interpreter interpreter)
Returns the value of this expression computed with the computeExpression () method. This value is computed only at the first call of this method and each time after a call to invalidateValue ().
Throws:
CircularityException - if this expression can't be computed because it belongs to a reference circularity.
IllegalCellException - if this expression uses an invalid expression reference (#REF!).
java.lang.IllegalArgumentException - if some parameters used by this expression were forbidden.
ArithmeticException - if a integer division by 0 occured.
StackOverflowError - if the computation of this expression produced a stack overflow.

invalidateValue

public void invalidateValue()
Invalidates the value stored by this expression to force the computation of the expression next time getValue () will be called.

invalidateValue

public void invalidateValue(CircularityException ex)
Invalidates the value stored by this expression with with the circularity exception ex. This exception will be thrown when the getValue () method will be called next time.
Parameters:
ex - a cicrularity exception. Generally it's the exception thrown by the checkCircularity () method.

checkCircularity

public void checkCircularity(javax.swing.table.TableModel model,
                             JeksCell startCell)
                      throws CircularityException
Parses recursely all the parameters of this expression to check if computing the formula of the referenced cells won't produce a circularity.
Parameters:
startCell - the coordinates of the cell storing this expression.
Throws:
CircularityException - if a circurlarity was detected.

&cp; 1998-2003 eTeks - All rights reserved