org.ujac.util.text
Class BigDecimalFormat

java.lang.Object
  extended by java.text.Format
      extended by java.text.NumberFormat
          extended by java.text.DecimalFormat
              extended by org.ujac.util.text.BigDecimalFormat
All Implemented Interfaces:
Serializable, Cloneable

public class BigDecimalFormat
extends DecimalFormat

Name: BigDecimalFormat
Description: A number format class, using the BigDecimal class to perform the rounding.

Author:
lauerc
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field
 
Field Summary
 
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
 
Constructor Summary
BigDecimalFormat()
          Constructs a BigDecimalFormat instance with no specific attributes.
BigDecimalFormat(String pattern)
          Constructs a BigDecimalFormat instance with specific attributes.
BigDecimalFormat(String pattern, DecimalFormatSymbols symbols)
          Constructs a BigDecimalFormat instance with specific attributes.
BigDecimalFormat(String pattern, DecimalFormatSymbols symbols, int roundingMode)
          Constructs a BigDecimalFormat instance with specific attributes.
BigDecimalFormat(String pattern, int roundingMode)
          Constructs a BigDecimalFormat instance with specific attributes.
 
Method Summary
 StringBuffer format(double number, StringBuffer result, FieldPosition fieldPosition)
           
 int getRoundingModeId()
          Gets the rounding mode.
 void setRoundingModeId(int roundingMode)
          Sets the rounding mode.
 
Methods inherited from class java.text.DecimalFormat
applyLocalizedPattern, applyPattern, clone, equals, format, format, formatToCharacterIterator, getCurrency, getDecimalFormatSymbols, getGroupingSize, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getMultiplier, getNegativePrefix, getNegativeSuffix, getPositivePrefix, getPositiveSuffix, getRoundingMode, hashCode, isDecimalSeparatorAlwaysShown, isParseBigDecimal, parse, setCurrency, setDecimalFormatSymbols, setDecimalSeparatorAlwaysShown, setGroupingSize, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setMultiplier, setNegativePrefix, setNegativeSuffix, setParseBigDecimal, setPositivePrefix, setPositiveSuffix, setRoundingMode, toLocalizedPattern, toPattern
 
Methods inherited from class java.text.NumberFormat
format, format, getAvailableLocales, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setGroupingUsed, setParseIntegerOnly
 
Methods inherited from class java.text.Format
format, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigDecimalFormat

public BigDecimalFormat()
Constructs a BigDecimalFormat instance with no specific attributes.


BigDecimalFormat

public BigDecimalFormat(String pattern)
Constructs a BigDecimalFormat instance with specific attributes.

Parameters:
pattern - The format pattern.

BigDecimalFormat

public BigDecimalFormat(String pattern,
                        int roundingMode)
Constructs a BigDecimalFormat instance with specific attributes.

Parameters:
pattern - The format pattern.
roundingMode - The initial rounding mode.

BigDecimalFormat

public BigDecimalFormat(String pattern,
                        DecimalFormatSymbols symbols)
Constructs a BigDecimalFormat instance with specific attributes.

Parameters:
pattern - The format pattern.
symbols - The format symbols.

BigDecimalFormat

public BigDecimalFormat(String pattern,
                        DecimalFormatSymbols symbols,
                        int roundingMode)
Constructs a BigDecimalFormat instance with specific attributes.

Parameters:
pattern - The format pattern.
symbols - The format symbols.
roundingMode - The initial rounding mode.
Method Detail

format

public StringBuffer format(double number,
                           StringBuffer result,
                           FieldPosition fieldPosition)
Overrides:
format in class DecimalFormat
See Also:
NumberFormat.format(double, java.lang.StringBuffer, java.text.FieldPosition)

getRoundingModeId

public int getRoundingModeId()
Gets the rounding mode.

Returns:
The current rounding mode.

setRoundingModeId

public void setRoundingModeId(int roundingMode)
Sets the rounding mode.

Parameters:
roundingMode - The rounding mode to set.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.