Class MeasureDefinition.MeasureValue
java.lang.Object
net.sf.jasperreports.crosstabs.fill.calculation.MeasureDefinition.MeasureValue
- All Implemented Interfaces:
JRCalculable
- Enclosing class:
MeasureDefinition
An accumulated value of a crosstab measure.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Field Summary
Fields inherited from interface net.sf.jasperreports.engine.fill.JRCalculable
HELPER_COUNT, HELPER_SIZE, HELPER_SUM, HELPER_VARIANCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccumulates a value.voidaddValue(MeasureDefinition.MeasureValue measureValue) Accumulates another measure value.getHelperVariable(byte helperType) Returns a helper variable.Returns the incremented value of the calculable object.getValue()Returns the value of the calculable object.protected voidinit()booleanReturnstrueif and only if the calculable object was only initialized and not incremented.setHelper(MeasureDefinition.MeasureValue helperVariable, byte type) Sets a helper variable.voidsetInitialized(boolean isInitialized) Sets the initialized flag for this calculable object.toString()
-
Constructor Details
-
MeasureValue
public MeasureValue()Initializes the value.
-
-
Method Details
-
init
protected void init() -
addValue
Accumulates a value.- Parameters:
addValue- the value- Throws:
JRException
-
addValue
Accumulates another measure value.This is used for total calculations, when two accumulated values are combined into a total.
- Parameters:
measureValue- the measure value- Throws:
JRException
-
getValue
Description copied from interface:JRCalculableReturns the value of the calculable object.- Specified by:
getValuein interfaceJRCalculable- Returns:
- the value
-
toString
-
setHelper
public MeasureDefinition.MeasureValue setHelper(MeasureDefinition.MeasureValue helperVariable, byte type) Sets a helper variable.- Parameters:
helperVariable- the helper variabletype- the helper type- Returns:
- the previous helper variable for the type
-
isInitialized
public boolean isInitialized()Description copied from interface:JRCalculableReturnstrueif and only if the calculable object was only initialized and not incremented.- Specified by:
isInitializedin interfaceJRCalculable- Returns:
trueif and only if the calculable object was only initialized and not incremented
-
getIncrementedValue
Description copied from interface:JRCalculableReturns the incremented value of the calculable object.- Specified by:
getIncrementedValuein interfaceJRCalculable- Returns:
- the incremented value
-
getHelperVariable
Description copied from interface:JRCalculableReturns a helper variable.- Specified by:
getHelperVariablein interfaceJRCalculable- Parameters:
helperType- the desired helper variable type- Returns:
- the helper variable
-
setInitialized
public void setInitialized(boolean isInitialized) Description copied from interface:JRCalculableSets the initialized flag for this calculable object.- Specified by:
setInitializedin interfaceJRCalculable- Parameters:
isInitialized- the initialized flag- See Also:
-