Class JRBaseCrosstabMeasure
- java.lang.Object
-
- net.sf.jasperreports.crosstabs.base.JRBaseCrosstabMeasure
-
- All Implemented Interfaces:
Serializable
,Cloneable
,CrosstabBaseCloneable
,JRCrosstabMeasure
,JRCloneable
- Direct Known Subclasses:
JRDesignCrosstabMeasure
public class JRBaseCrosstabMeasure extends Object implements JRCrosstabMeasure, Serializable, CrosstabBaseCloneable
Base read-only crosstab measure implementation.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CalculationEnum
calculation
static String
EXCEPTION_MESSAGE_KEY_MEASURE_INCREMENTER_CLASS_LOAD_ERROR
static String
EXCEPTION_MESSAGE_KEY_MEASURE_PERCENTAGE_CALCULATOR_CLASS_LOAD_ERROR
static String
EXCEPTION_MESSAGE_KEY_MEASURE_VALUE_CLASS_LOAD_ERROR
protected JRExpression
expression
protected Class<?>
incrementerFactoryClass
protected String
incrementerFactoryClassName
protected String
incrementerFactoryClassRealName
protected String
name
protected Class<?>
percentageCalculatorClass
protected String
percentageCalculatorClassName
protected String
percentageCalculatorClassRealName
protected CrosstabPercentageEnum
percentageType
protected Class<?>
valueClass
protected String
valueClassName
protected String
valueClassRealName
protected JRVariable
variable
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRBaseCrosstabMeasure()
JRBaseCrosstabMeasure(JRCrosstabMeasure measure, JRBaseObjectFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Object
clone(CrosstabBaseCloneFactory cloneFactory)
CalculationEnum
getCalculation()
Returns the calculation type which will be performed on the measure values.Class<?>
getIncrementerFactoryClass()
Returns the incrementer factory class.String
getIncrementerFactoryClassName()
Returns the incrementer factory class name.String
getName()
Returns the name of the measure.Class<?>
getPercentageCalculatorClass()
Returns the percentage calculator class.String
getPercentageCalculatorClassName()
Returns the percentage calculator class name.CrosstabPercentageEnum
getPercentageType()
Returns the percentage calculation type performed on this measure.Class<?>
getValueClass()
Returns the value class of this measure.String
getValueClassName()
Returns the name of the value class for this measure.JRExpression
getValueExpression()
Returns the measure expression.JRVariable
getVariable()
Returns the variable associated with this measure.
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_MEASURE_INCREMENTER_CLASS_LOAD_ERROR
public static final String EXCEPTION_MESSAGE_KEY_MEASURE_INCREMENTER_CLASS_LOAD_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_MEASURE_PERCENTAGE_CALCULATOR_CLASS_LOAD_ERROR
public static final String EXCEPTION_MESSAGE_KEY_MEASURE_PERCENTAGE_CALCULATOR_CLASS_LOAD_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_MEASURE_VALUE_CLASS_LOAD_ERROR
public static final String EXCEPTION_MESSAGE_KEY_MEASURE_VALUE_CLASS_LOAD_ERROR
- See Also:
- Constant Field Values
-
name
protected String name
-
valueClassName
protected String valueClassName
-
valueClassRealName
protected String valueClassRealName
-
valueClass
protected transient Class<?> valueClass
-
expression
protected JRExpression expression
-
calculation
protected CalculationEnum calculation
-
incrementerFactoryClassName
protected String incrementerFactoryClassName
-
incrementerFactoryClassRealName
protected String incrementerFactoryClassRealName
-
incrementerFactoryClass
protected Class<?> incrementerFactoryClass
-
percentageType
protected CrosstabPercentageEnum percentageType
-
percentageCalculatorClassName
protected String percentageCalculatorClassName
-
percentageCalculatorClassRealName
protected String percentageCalculatorClassRealName
-
percentageCalculatorClass
protected Class<?> percentageCalculatorClass
-
variable
protected JRVariable variable
-
-
Constructor Detail
-
JRBaseCrosstabMeasure
protected JRBaseCrosstabMeasure()
-
JRBaseCrosstabMeasure
public JRBaseCrosstabMeasure(JRCrosstabMeasure measure, JRBaseObjectFactory factory)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:JRCrosstabMeasure
Returns the name of the measure.- Specified by:
getName
in interfaceJRCrosstabMeasure
- Returns:
- the name of the measure
- See Also:
JRCrosstabMeasure.getVariable()
-
getValueClassName
public String getValueClassName()
Description copied from interface:JRCrosstabMeasure
Returns the name of the value class for this measure.- Specified by:
getValueClassName
in interfaceJRCrosstabMeasure
- Returns:
- the name of the value class for this measure
-
getValueExpression
public JRExpression getValueExpression()
Description copied from interface:JRCrosstabMeasure
Returns the measure expression.- Specified by:
getValueExpression
in interfaceJRCrosstabMeasure
- Returns:
- the measure expression
-
getCalculation
public CalculationEnum getCalculation()
Description copied from interface:JRCrosstabMeasure
Returns the calculation type which will be performed on the measure values.The incrementer factory associated with this measure will create an incrementer which will sum the measure values.
The possible calculation type are the same as the ones used for variables (see
JRVariable.getCalculation()
with the exception ofCalculationEnum.SYSTEM
.- Specified by:
getCalculation
in interfaceJRCrosstabMeasure
- Returns:
- the calculation type which will be performed on the measure values
- See Also:
JRCrosstabMeasure.getIncrementerFactoryClassName()
,JRExtendedIncrementerFactory
,JRExtendedIncrementer
-
getIncrementerFactoryClassName
public String getIncrementerFactoryClassName()
Description copied from interface:JRCrosstabMeasure
Returns the incrementer factory class name.Crosstab measures require extended incrementers, therefore the incrementer class should implement
JRExtendedIncrementerFactory
.- Specified by:
getIncrementerFactoryClassName
in interfaceJRCrosstabMeasure
- Returns:
- the incrementer factory class name
-
getPercentageType
public CrosstabPercentageEnum getPercentageType()
Description copied from interface:JRCrosstabMeasure
Returns the percentage calculation type performed on this measure.Currently, only percentage out of grand total is supported.
The possible values are:
If percentage calculation is required, the value class should be one of the built-in supported percentage types or the percentage calculator class should be specified.
- Specified by:
getPercentageType
in interfaceJRCrosstabMeasure
- Returns:
- the percentage calculation type
- See Also:
JRPercentageCalculatorFactory.hasBuiltInCalculator(Class)
,JRCrosstabMeasure.getPercentageCalculatorClassName()
-
getIncrementerFactoryClass
public Class<?> getIncrementerFactoryClass()
Description copied from interface:JRCrosstabMeasure
Returns the incrementer factory class.- Specified by:
getIncrementerFactoryClass
in interfaceJRCrosstabMeasure
- Returns:
- the incrementer factory class
- See Also:
JRCrosstabMeasure.getIncrementerFactoryClassName()
-
getValueClass
public Class<?> getValueClass()
Description copied from interface:JRCrosstabMeasure
Returns the value class of this measure.- Specified by:
getValueClass
in interfaceJRCrosstabMeasure
- Returns:
- the value class of this measure
-
getVariable
public JRVariable getVariable()
Description copied from interface:JRCrosstabMeasure
Returns the variable associated with this measure.The variable can be used inside the crosstab data cells as the measure value. The variable has the same name and value class as the measure.
- Specified by:
getVariable
in interfaceJRCrosstabMeasure
- Returns:
- the variable associated with this measure
-
getPercentageCalculatorClassName
public String getPercentageCalculatorClassName()
Description copied from interface:JRCrosstabMeasure
Returns the percentage calculator class name.- Specified by:
getPercentageCalculatorClassName
in interfaceJRCrosstabMeasure
- Returns:
- the percentage calculator class name
-
getPercentageCalculatorClass
public Class<?> getPercentageCalculatorClass()
Description copied from interface:JRCrosstabMeasure
Returns the percentage calculator class.- Specified by:
getPercentageCalculatorClass
in interfaceJRCrosstabMeasure
- Returns:
- the percentage calculator class
-
clone
public Object clone()
- Specified by:
clone
in interfaceJRCloneable
- Overrides:
clone
in classObject
-
clone
public Object clone(CrosstabBaseCloneFactory cloneFactory)
- Specified by:
clone
in interfaceCrosstabBaseCloneable
-
-