net.sf.jasperreports.engine.fill
Class JRCalculator

java.lang.Object
  extended by net.sf.jasperreports.engine.fill.JRCalculator
All Implemented Interfaces:
JRFillExpressionEvaluator

public class JRCalculator
extends java.lang.Object
implements JRFillExpressionEvaluator

Version:
$Id: JRCalculator.java 5180 2012-03-29 13:23:12Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Field Summary
protected  JRFillDataset dataset
           
protected  JRFillElementDataset[] datasets
           
protected  java.util.Map<java.lang.String,JRFillField> fldsm
           
protected  JRFillGroup[] groups
           
protected  java.util.Map<java.lang.String,JRFillParameter> parsm
           
protected  JRFillVariable[] variables
           
protected  java.util.Map<java.lang.String,JRFillVariable> varsm
           
 
Constructor Summary
protected JRCalculator(DatasetExpressionEvaluator evaluator)
          Creates a calculator using an expression evaluator.
protected JRCalculator(JREvaluator evaluator)
          Creates a calculator using an expression evaluator.
 
Method Summary
 void calculateVariables()
           
 void estimateGroupRuptures()
          Determines group breaks based on estimated report values.
 void estimateVariables()
           
 java.lang.Object evaluate(JRExpression expression)
           
 java.lang.Object evaluate(JRExpression expression, byte evaluationType)
          Evaluates an expression.
 java.lang.Object evaluateEstimated(JRExpression expression)
           
 java.lang.Object evaluateOld(JRExpression expression)
           
 JRFillVariable getColumnNumber()
           
 JRFillDataset getFillDataset()
          Returns the dataset used by the expression evaluator.
 JRFillVariable getPageNumber()
           
protected  void init(JRFillDataset dataset)
          Initializes the calculator.
 void initializeVariables(ResetTypeEnum resetType, IncrementTypeEnum incrementType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataset

protected JRFillDataset dataset

parsm

protected java.util.Map<java.lang.String,JRFillParameter> parsm

fldsm

protected java.util.Map<java.lang.String,JRFillField> fldsm

varsm

protected java.util.Map<java.lang.String,JRFillVariable> varsm

variables

protected JRFillVariable[] variables

groups

protected JRFillGroup[] groups

datasets

protected JRFillElementDataset[] datasets
Constructor Detail

JRCalculator

protected JRCalculator(DatasetExpressionEvaluator evaluator)
Creates a calculator using an expression evaluator.

Parameters:
evaluator - the expression evaluator

JRCalculator

protected JRCalculator(JREvaluator evaluator)
Creates a calculator using an expression evaluator.

Parameters:
evaluator - the expression evaluator
Method Detail

init

protected void init(JRFillDataset dataset)
             throws JRException
Initializes the calculator.

Parameters:
dataset - the dataset this calculator is used for
Throws:
JRException

getPageNumber

public JRFillVariable getPageNumber()

getColumnNumber

public JRFillVariable getColumnNumber()

calculateVariables

public void calculateVariables()
                        throws JRException
Throws:
JRException

estimateVariables

public void estimateVariables()
                       throws JRException
Throws:
JRException

estimateGroupRuptures

public void estimateGroupRuptures()
                           throws JRException
Determines group breaks based on estimated report values.

estimateVariables() needs to be called prior to this method.

Throws:
JRException

initializeVariables

public void initializeVariables(ResetTypeEnum resetType,
                                IncrementTypeEnum incrementType)
                         throws JRException
Throws:
JRException

evaluate

public java.lang.Object evaluate(JRExpression expression,
                                 byte evaluationType)
                          throws JRException
Description copied from interface: JRFillExpressionEvaluator
Evaluates an expression.

Specified by:
evaluate in interface JRFillExpressionEvaluator
Parameters:
expression - the expression to evaluate
evaluationType - one of JRExpression.EVALUATION_DEFAULT, JRExpression.EVALUATION_OLD, JRExpression.EVALUATION_ESTIMATED
Returns:
the result
Throws:
JRException

evaluateOld

public java.lang.Object evaluateOld(JRExpression expression)
                             throws JRExpressionEvalException
Throws:
JRExpressionEvalException

evaluateEstimated

public java.lang.Object evaluateEstimated(JRExpression expression)
                                   throws JRExpressionEvalException
Throws:
JRExpressionEvalException

evaluate

public java.lang.Object evaluate(JRExpression expression)
                          throws JRExpressionEvalException
Throws:
JRExpressionEvalException

getFillDataset

public JRFillDataset getFillDataset()
Description copied from interface: JRFillExpressionEvaluator
Returns the dataset used by the expression evaluator.

Specified by:
getFillDataset in interface JRFillExpressionEvaluator


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com