ERXNumberFormatter Class Reference
Inherits com::webobjects::foundation::NSNumberFormatter.
List of all members.
Detailed Description
An extension to the number formatter. It will strip out the characters '%$,' when parsing a string and can scale values by setting a pattern like
(/1024=)0.00 KB which will divide the actual value by 1024 or
(*60;4=)0.00 which will multiply the actual value by 60. When used for parsing, the resulting value will be scaled to a scale of 4. So when the real value is 0.0165, the display value will be 0.99 and when this is re-entered, the resulting value will again be 0.0165.
Constructor & Destructor Documentation
Member Function Documentation
| [static initializer] |
( |
|
) |
[static, package] |
| static Format defaultNumberFormatterForObject |
( |
Object |
object |
) |
[static] |
| StringBuffer format |
( |
Object |
value, |
|
|
StringBuffer |
buffer, |
|
|
FieldPosition |
position | |
|
) |
| | |
Overridden to perform optional conversions on the value given.
- See also:
- java.text.Format.format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition)
| static NSNumberFormatter numberFormatterForPattern |
( |
String |
pattern |
) |
[static] |
Returns a shared instance for the specified pattern.
- Returns:
- shared instance of formatter
| Object parseObject |
( |
String |
aString |
) |
throws java.text.ParseException |
Strips out the ignored characters and optionally performs an operation on the value from the string to be parsed.
- Parameters:
-
- Returns:
- the parsed object
| BigDecimal performFormat |
( |
BigDecimal |
value |
) |
[protected] |
Override this in your subclass to provide for other operations when formatting a value.
- Parameters:
-
| BigDecimal performParse |
( |
BigDecimal |
value |
) |
[protected] |
Override this in your subclass to provide for other operations when parsing a value.
- Parameters:
-
| void setFactor |
( |
BigDecimal |
value |
) |
[protected] |
| void setIgnoredChars |
( |
String |
value |
) |
|
| static void setNumberFormatterForPattern |
( |
NSNumberFormatter |
formatter, |
|
|
String |
pattern | |
|
) |
| | [static] |
Sets a shared instance for the specified pattern.
| void setOperator |
( |
String |
value |
) |
[protected] |
| void setPattern |
( |
String |
pattern |
) |
|
Overridden to search the pattern for operators and factors. The pattern should be '(' . operatorChar . factor . [';' scale ] . '=)' normalFormatterString
- See also:
- com.webobjects.foundation.NSNumberFormatter.setPattern(java.lang.String)
| void setScale |
( |
Integer |
value |
) |
[protected] |
| static NSNumberFormatter sharedInstance |
( |
|
) |
[static] |
Returns the default shared instance
- Returns:
- shared instance
Member Data Documentation
String _ignoredChars = ERXProperties.stringForKeyWithDefault("er.extensions.ERXNumberFormatter.ignoredChars", "%$") [private] |
Hashtable _repository = new Hashtable() [static, private] |
holds a reference to the repository
The documentation for this class was generated from the following file: