org.hrodberaht.i18n.formatter
Class PercentageFormatter

java.lang.Object
  extended by org.hrodberaht.i18n.formatter.Formatter
      extended by org.hrodberaht.i18n.formatter.NumberFormatter
          extended by org.hrodberaht.i18n.formatter.PercentageFormatter

public class PercentageFormatter
extends NumberFormatter

Simple Java Utils

Since:
1.0
Version:
1.0
Author:
Robert Alexandersson

Field Summary
static int PERCENTAGE_SCALE
          The default scale for percentage values
 
Fields inherited from class org.hrodberaht.i18n.formatter.Formatter
locale
 
Constructor Summary
PercentageFormatter()
           
 
Method Summary
 java.lang.Object convertToObject(java.lang.String target)
          Unformats its argument and returns a BigDecimal instance initialized with the resulting string value
 java.lang.String convertToString(java.lang.Object value)
          Returns a string representation of its argument, formatted as a percentage value.
 
Methods inherited from class org.hrodberaht.i18n.formatter.NumberFormatter
fixCharacterJVMErrorsForDecimalFormat, parseNumber
 
Methods inherited from class org.hrodberaht.i18n.formatter.Formatter
getFormatter, getFormatter, isSupportedType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERCENTAGE_SCALE

public static final int PERCENTAGE_SCALE
The default scale for percentage values

See Also:
Constant Field Values
Constructor Detail

PercentageFormatter

public PercentageFormatter()
Method Detail

convertToObject

public java.lang.Object convertToObject(java.lang.String target)
Unformats its argument and returns a BigDecimal instance initialized with the resulting string value

Overrides:
convertToObject in class Formatter
Returns:
a BigDecimal initialized with the provided string

convertToString

public java.lang.String convertToString(java.lang.Object value)
Returns a string representation of its argument, formatted as a percentage value.

Overrides:
convertToString in class Formatter
Returns:
a formatted String


Copyright © 2010. All Rights Reserved.