Package net.sf.jasperreports.engine.fill
Class JRFillVariable
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.JRFillVariable
-
- All Implemented Interfaces:
Cloneable
,JRCalculable
,JRCloneable
,JRVariable
public class JRFillVariable extends Object implements JRVariable, JRCalculable
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description protected JRVariable
parent
-
Fields inherited from interface net.sf.jasperreports.engine.fill.JRCalculable
HELPER_COUNT, HELPER_SIZE, HELPER_SUM, HELPER_VARIANCE
-
Fields inherited from interface net.sf.jasperreports.engine.JRVariable
COLUMN_COUNT, COLUMN_NUMBER, MASTER_CURRENT_PAGE, MASTER_TOTAL_PAGES, PAGE_COUNT, PAGE_NUMBER, REPORT_COUNT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRFillVariable(JRVariable variable, JRFillObjectFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
CalculationEnum
getCalculation()
Gets the variable calculation type.String
getDescription()
Gets the variable optional description.Object
getEstimatedValue()
JRExpression
getExpression()
Returns the main expression for this variable.JRCalculable
getHelperVariable(byte type)
Returns a helper variable.Object
getIncrementedValue()
Returns the incremented value of the calculable object.JRIncrementer
getIncrementer()
Class<?>
getIncrementerFactoryClass()
Returns the class of the incrementer factory used for choosing the right incrementer for the variable value.String
getIncrementerFactoryClassName()
Returns the string name of the variable value class.String
getIncrementGroup()
Returns the group whose break triggers the variable increment.IncrementTypeEnum
getIncrementType()
Gets the variable increment type.JRExpression
getInitialValueExpression()
Returns the initial value expression for this variable.String
getName()
Returns the name of the variable.Object
getOldValue()
protected JRVariable
getParent()
Object
getPreviousIncrementedValue()
Object
getPreviousOldValue()
String
getResetGroup()
Returns the group whose break triggers the variable reset.ResetTypeEnum
getResetType()
Gets the variable reset type.Object
getValue()
Returns the value of the calculable object.Object
getValue(byte evaluation)
Class<?>
getValueClass()
Returns the class of the variable value.String
getValueClassName()
Returns the string name of the variable value class.boolean
isInitialized()
Returnstrue
if and only if the calculable object was only initialized and not incremented.boolean
isSystemDefined()
Returnstrue
if the variable calculation type is system defined.void
overwriteValue(Object newValue, byte evaluation)
protected void
reset()
void
restoreValue(byte evaluation)
void
setDescription(String description)
Sets the variable description.void
setEstimatedValue(Object estimatedValue)
JRFillVariable
setHelperVariable(JRFillVariable helperVariable, byte type)
Sets a helper variable.void
setIncrementedValue(Object incrementedValue)
void
setInitialized(boolean isInitialized)
Sets the initialized flag for this calculable object.void
setOldValue(Object oldValue)
void
setPreviousIncrementedValue(Object previousIncrementedValue)
void
setPreviousOldValue(Object previousOldValue)
void
setValue(Object value)
-
-
-
Field Detail
-
parent
protected JRVariable parent
-
-
Constructor Detail
-
JRFillVariable
protected JRFillVariable(JRVariable variable, JRFillObjectFactory factory)
-
-
Method Detail
-
getParent
protected JRVariable getParent()
-
reset
protected void reset()
-
getName
public String getName()
Description copied from interface:JRVariable
Returns the name of the variable. Since all variables are stored in a map, the variable names are the keys in the map.- Specified by:
getName
in interfaceJRVariable
- Returns:
- a string containing the variable name
-
getDescription
public String getDescription()
Description copied from interface:JRVariable
Gets the variable optional description.- Specified by:
getDescription
in interfaceJRVariable
-
setDescription
public void setDescription(String description)
Description copied from interface:JRVariable
Sets the variable description.- Specified by:
setDescription
in interfaceJRVariable
-
getValueClass
public Class<?> getValueClass()
Description copied from interface:JRVariable
Returns the class of the variable value. Any class is allowed as long as it is in the classpath at compile and run time.- Specified by:
getValueClass
in interfaceJRVariable
- Returns:
- a Class instance representing the variable value class
-
getValueClassName
public String getValueClassName()
Description copied from interface:JRVariable
Returns the string name of the variable value class.- Specified by:
getValueClassName
in interfaceJRVariable
-
getIncrementerFactoryClass
public Class<?> getIncrementerFactoryClass()
Description copied from interface:JRVariable
Returns the class of the incrementer factory used for choosing the right incrementer for the variable value.- Specified by:
getIncrementerFactoryClass
in interfaceJRVariable
- Returns:
- the Class instance of the incrementer factory
- See Also:
JRIncrementer
,JRIncrementerFactory
-
getIncrementerFactoryClassName
public String getIncrementerFactoryClassName()
Description copied from interface:JRVariable
Returns the string name of the variable value class.- Specified by:
getIncrementerFactoryClassName
in interfaceJRVariable
-
getExpression
public JRExpression getExpression()
Description copied from interface:JRVariable
Returns the main expression for this variable. The expression must be numeric for certain calculation types.- Specified by:
getExpression
in interfaceJRVariable
- Returns:
- a
JRExpression
instance containing the expression.
-
getInitialValueExpression
public JRExpression getInitialValueExpression()
Description copied from interface:JRVariable
Returns the initial value expression for this variable. The expression must be numeric for certain calculation types.- Specified by:
getInitialValueExpression
in interfaceJRVariable
- Returns:
- a
JRExpression
instance containing the initial expression.
-
getResetType
public ResetTypeEnum getResetType()
Description copied from interface:JRVariable
Gets the variable reset type.- Specified by:
getResetType
in interfaceJRVariable
- Returns:
- a value representing one of the reset type constants in
ResetTypeEnum
-
getIncrementType
public IncrementTypeEnum getIncrementType()
Description copied from interface:JRVariable
Gets the variable increment type.- Specified by:
getIncrementType
in interfaceJRVariable
- Returns:
- a value representing one of the reset type constants in
IncrementTypeEnum
-
getCalculation
public CalculationEnum getCalculation()
Description copied from interface:JRVariable
Gets the variable calculation type.- Specified by:
getCalculation
in interfaceJRVariable
- Returns:
- a value representing one of the calculation type constants in
CalculationEnum
-
isSystemDefined
public boolean isSystemDefined()
Description copied from interface:JRVariable
Returnstrue
if the variable calculation type is system defined.- Specified by:
isSystemDefined
in interfaceJRVariable
- See Also:
CalculationEnum.SYSTEM
-
getResetGroup
public String getResetGroup()
Description copied from interface:JRVariable
Returns the group whose break triggers the variable reset. Only used whenJRVariable.getResetType()
returnsResetTypeEnum.GROUP
.- Specified by:
getResetGroup
in interfaceJRVariable
-
getIncrementGroup
public String getIncrementGroup()
Description copied from interface:JRVariable
Returns the group whose break triggers the variable increment. Only used whenJRVariable.getIncrementType()
returnsIncrementTypeEnum.GROUP
.- Specified by:
getIncrementGroup
in interfaceJRVariable
-
getOldValue
public Object getOldValue()
-
setOldValue
public void setOldValue(Object oldValue)
-
getEstimatedValue
public Object getEstimatedValue()
-
setEstimatedValue
public void setEstimatedValue(Object estimatedValue)
-
getIncrementedValue
public Object getIncrementedValue()
Description copied from interface:JRCalculable
Returns the incremented value of the calculable object.- Specified by:
getIncrementedValue
in interfaceJRCalculable
- Returns:
- the incremented value
-
setIncrementedValue
public void setIncrementedValue(Object incrementedValue)
-
getPreviousIncrementedValue
public Object getPreviousIncrementedValue()
-
setPreviousIncrementedValue
public void setPreviousIncrementedValue(Object previousIncrementedValue)
-
getValue
public Object getValue()
Description copied from interface:JRCalculable
Returns the value of the calculable object.- Specified by:
getValue
in interfaceJRCalculable
- Returns:
- the value
-
setValue
public void setValue(Object value)
-
isInitialized
public boolean isInitialized()
Description copied from interface:JRCalculable
Returnstrue
if and only if the calculable object was only initialized and not incremented.- Specified by:
isInitialized
in interfaceJRCalculable
- Returns:
true
if and only if the calculable object was only initialized and not incremented
-
setInitialized
public void setInitialized(boolean isInitialized)
Description copied from interface:JRCalculable
Sets the initialized flag for this calculable object.- Specified by:
setInitialized
in interfaceJRCalculable
- Parameters:
isInitialized
- the initialized flag- See Also:
JRCalculable.isInitialized()
-
getIncrementer
public JRIncrementer getIncrementer()
-
setHelperVariable
public JRFillVariable setHelperVariable(JRFillVariable helperVariable, byte type)
Sets a helper variable.- Parameters:
helperVariable
- the helper variabletype
- the helper type- Returns:
- the previous helper variable for the type
-
getHelperVariable
public JRCalculable getHelperVariable(byte type)
Returns a helper variable.- Specified by:
getHelperVariable
in interfaceJRCalculable
- Parameters:
type
- the helper type- Returns:
- the helper variable for the specified type
-
getValue
public Object getValue(byte evaluation)
-
overwriteValue
public void overwriteValue(Object newValue, byte evaluation)
-
restoreValue
public void restoreValue(byte evaluation)
-
getPreviousOldValue
public Object getPreviousOldValue()
-
setPreviousOldValue
public void setPreviousOldValue(Object previousOldValue)
-
clone
public Object clone()
- Specified by:
clone
in interfaceJRCloneable
- Overrides:
clone
in classObject
-
-