Class ConvertToNumberExpression
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
- org.pentaho.reporting.engine.classic.core.function.ConvertToNumberExpression
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Expression
public class ConvertToNumberExpression extends AbstractExpression
Parses a string into a number using the given decimal-format.- Author:
- Thomas Morgner
- See Also:
DecimalFormat
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConvertToNumberExpression()
Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getField()
Returns the name of the data-row column from where to read the string that should be parsed.String
getFormat()
Returns the DecimalFormat pattern that is used for the parsing.Locale
getLocale()
Returns the locale that is used for the parsing.Object
getValue()
Parses the value read from the column specified by the given field-name and tries to parse it into a Number using the given DecimalFormat-pattern.void
setField(String field)
Defines the name of the data-row column from where to read the string that should be parsed.void
setFormat(String format)
Defines the DecimalFormat pattern that is used for the parsing.void
setLocale(Locale locale)
Defines the locale that is used for the parsing.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
clone, getDataRow, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
-
-
-
-
Method Detail
-
getField
public String getField()
Returns the name of the data-row column from where to read the string that should be parsed.- Returns:
- the field name.
-
setField
public void setField(String field)
Defines the name of the data-row column from where to read the string that should be parsed.- Parameters:
field
- the name of the field.
-
getFormat
public String getFormat()
Returns the DecimalFormat pattern that is used for the parsing.- Returns:
- the pattern string.
- See Also:
DecimalFormat
-
setFormat
public void setFormat(String format)
Defines the DecimalFormat pattern that is used for the parsing.- Parameters:
format
- the pattern string.- See Also:
DecimalFormat
-
getLocale
public Locale getLocale()
Returns the locale that is used for the parsing.- Returns:
- the locale.
-
setLocale
public void setLocale(Locale locale)
Defines the locale that is used for the parsing.- Parameters:
locale
- the locale.
-
getValue
public Object getValue()
Parses the value read from the column specified by the given field-name and tries to parse it into a Number using the given DecimalFormat-pattern.- Returns:
- the value of the function.
-
-