| java.lang.Object org.jfree.report.filter.FormatFilter org.jfree.report.filter.NumberFormatFilter org.jfree.report.filter.DecimalFormatFilter
DecimalFormatFilter | public class DecimalFormatFilter extends NumberFormatFilter (Code) | | A filter that formats the numeric value from a data source to a string representation
using the decimal number system as base.
This filter will format java.lang.Number objects using a java.text.DecimalFormat to
create the string representation for the date obtained from the datasource.
If the object read from the datasource is no date, the NullValue defined by
setNullValue(Object) is returned.
author: Thomas Morgner See Also: java.text.NumberFormat See Also: java.lang.Number |
Constructor Summary | |
public | DecimalFormatFilter() DefaultConstructor, this object is initialized using a DecimalFormat with the default
pattern for this locale. |
DecimalFormatFilter | public DecimalFormatFilter()(Code) | | DefaultConstructor, this object is initialized using a DecimalFormat with the default
pattern for this locale.
|
getDecimalFormat | public DecimalFormat getDecimalFormat()(Code) | | Returns the format for the filter. The DecimalFormatParser has only DecimalFormat
objects assigned.
the formatter. throws: NullPointerException - if the given format is null |
getFormatString | public String getFormatString()(Code) | | Synthesizes a pattern string that represents the current state of this Format
object.
the pattern string of the format object contained in this filter. |
getLocalizedFormatString | public String getLocalizedFormatString()(Code) | | Synthesizes a localized pattern string that represents the current state of this
Format object.
the localized pattern string of the format-object. |
getValue | public Object getValue(ExpressionRuntime runtime)(Code) | | Returns the formatted string. The value is read using the data source given and
formated using the formatter of this object. The formating is guaranteed to completly
form the object to an string or to return the defined NullValue.
If format, datasource or object are null, the NullValue is returned.
Parameters: runtime - the expression runtime that is used to evaluate formulas and expressions when computing the value ofthis filter. The formatted value. |
isKeepState | public boolean isKeepState()(Code) | | Defines, whether the filter should keep its state, if a locale
change is detected. This will effectivly disable the locale update.
true, if the locale should not update the DateSymbols, false otherwise. |
setDecimalFormat | public void setDecimalFormat(DecimalFormat format)(Code) | | Sets the format for the filter.
Parameters: format - the format. throws: NullPointerException - if the given format is null |
setFormatString | public void setFormatString(String format)(Code) | | Applies a format string to the internal DecimalFormat instance.
Parameters: format - the format string. |
setFormatter | public void setFormatter(Format format)(Code) | | Sets the format for the filter. If the given format is no Decimal format, a
ClassCastException is thrown
Parameters: format - the format. throws: NullPointerException - if the given format is null throws: ClassCastException - if the format is no decimal format |
setKeepState | public void setKeepState(boolean keepState)(Code) | | Defines, whether the filter should keep its state, if a locale
change is detected. This will effectivly disable the locale update.
Parameters: keepState - set to true, if the locale should not update the DateSymbols, false otherwise. |
setLocalizedFormatString | public void setLocalizedFormatString(String format)(Code) | | Applies a localised format string to the internal DecimalFormat
instance.
Parameters: format - the format string. |
|
|