|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.text.Format java.text.NumberFormat java.text.DecimalFormat org.ujac.util.text.SmartDecimalFormat
public class SmartDecimalFormat
Name: SmartDecimalFormat
Description: A number format class, implementing a smarter way of rounding
which performs better than the BigDecimalFormat class.
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 | |
---|---|
SmartDecimalFormat()
Constructs a SmartDecimalFormat instance with no specific attributes. |
|
SmartDecimalFormat(String pattern)
Constructs a SmartDecimalFormat instance with specific attributes. |
|
SmartDecimalFormat(String pattern,
DecimalFormatSymbols symbols)
Constructs a SmartDecimalFormat instance with specific attributes. |
|
SmartDecimalFormat(String pattern,
DecimalFormatSymbols symbols,
int roundingMode)
Constructs a SmartDecimalFormat instance with specific attributes. |
|
SmartDecimalFormat(String pattern,
int roundingMode)
Constructs a SmartDecimalFormat 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.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 |
---|
public SmartDecimalFormat()
public SmartDecimalFormat(String pattern)
pattern
- The format pattern.public SmartDecimalFormat(String pattern, int roundingMode)
pattern
- The format pattern.roundingMode
- The initial rounding mode.public SmartDecimalFormat(String pattern, DecimalFormatSymbols symbols)
pattern
- The format pattern.symbols
- The format symbols.public SmartDecimalFormat(String pattern, DecimalFormatSymbols symbols, int roundingMode)
pattern
- The format pattern.symbols
- The format symbols.roundingMode
- The initial rounding mode.Method Detail |
---|
public StringBuffer format(double number, StringBuffer result, FieldPosition fieldPosition)
format
in class DecimalFormat
NumberFormat.format(double, java.lang.StringBuffer, java.text.FieldPosition)
public int getRoundingModeId()
public void setRoundingModeId(int roundingMode)
roundingMode
- The rounding mode to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |