|
Oracle® Globalization Development Kit Java API Reference 10g Release 1(10.1) B10971-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.text.Format | +--oracle.i18n.text.OraNumberFormat | +--oracle.i18n.text.OraDecimalFormat
OraDecimalFormat is an concrete class to do locale sensitive formatting and parsing between number and string. It supports Oracle number formatting behavior.
OraNumberFormat
, Serialized FormNested Class Summary |
Nested classes inherited from class java.text.Format |
Format.Field |
Field Summary |
Fields inherited from class oracle.i18n.text.OraNumberFormat |
ALL_FIELD, FRACTION_FIELD, INTEGER_FIELD |
Constructor Summary | |
OraDecimalFormat() Constructs an OraDecimalformat using the default number format pattern and the default decimal format symbols for the default locale. | |
OraDecimalFormat(String pattern) Constructs an OraDecimalFormat using the given format pattern and the default decimal format symbols for the default locale. | |
OraDecimalFormat(String pattern, oracle.i18n.text.OraDecimalFormatSymbols symbols) Constructs an OraDecimalFormat using the given format pattern and the given decimal format symbols. |
Method Summary | |
void |
applyPattern(String pattern) Modifies this formatter by using the given format pattern. |
Object |
clone() Overrides the cloneable. |
boolean |
equals(Object object) Overrides the equals. |
StringBuffer |
format(BigDecimal number, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats a BigDecimal into a string. |
StringBuffer |
format(BigInteger number, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats a BigInteger into a string. |
StringBuffer |
format(double number, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats a double into a string. |
StringBuffer |
format(long number, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats a long into a string. |
oracle.i18n.text.OraDecimalFormatSymbols |
getOraDecimalFormatSymbols() Returns the Oracle decimal format symbols used in this formatter. |
int |
hashCode() Overrides the hashCode. |
boolean |
isDecimalSeparatorAlwaysShown() Returns true if decimal separator is always shown in the result string. |
Number |
parse(String text, ParsePosition parsePosition) Parses a string into a Number, starting from the given parse position. |
void |
setDecimalSeparatorAlwaysShown(boolean val) Sets the switch for decimal separator to the given boolean value. |
void |
setOraDecimalFormatSymbols(oracle.i18n.text.OraDecimalFormatSymbols sym) Sets this formatter to use the given Oracle decimal format symbols. |
String |
toPattern() Returns a format pattern string represents the formatting behavior of this formatter. |
Methods inherited from class java.text.Format |
format, formatToCharacterIterator, parseObject |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OraDecimalFormat()
public OraDecimalFormat(String pattern) throws ParseException
pattern
- the given format pattern.ParseException
- if the given pattern is invalid.public OraDecimalFormat(String pattern, oracle.i18n.text.OraDecimalFormatSymbols symbols) throws ParseException
pattern
- the given format pattern.ParseException
- if the given pattern is invalid.Method Detail |
public void applyPattern(String pattern) throws ParseException
"<positive pattern>[;<negative pattern>]"which means that a positive format pattern should always be present but a negative format pattern is optional. If there is no negative pattern given, the positive pattern with a leading minus sign will be used for formatting/parsing negtive numbers.
ParseException
- if the given pattern is invalid.public StringBuffer format(BigDecimal number, StringBuffer toAppendTo, FieldPosition fieldPosition)
format
in class OraNumberFormat
number
- the BigDecimal object to be formatted into a string.toAppendTo
- the string buffer to be appended with the formatted string.fieldPosition
- to be used to get offsets of a given field in the returned string buffer. On input: the alignment field of which the offsets to be returned. On output: the offsets of the alignment field in the returned string buffer.public StringBuffer format(BigInteger number, StringBuffer toAppendTo, FieldPosition fieldPosition)
format
in class OraNumberFormat
number
- the BigInteger object to be formatted into a string.toAppendTo
- the string buffer to be appended with the formatted string.fieldPosition
- to be used to get offsets of a given field in the returned string buffer. On input: the alignment field of which the offsets to be returned. On output: the offsets of the alignment field in the returned string buffer.public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition fieldPosition)
format
in class OraNumberFormat
number
- the double to be formatted into a string.toAppendTo
- the string buffer to be appended with the formatted string.fieldPosition
- to be used to get offsets of a given field in the returned string buffer. On input: the alignment field of which the offsets to be returned. On output: the offsets of the alignment field in the returned string buffer.public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition fieldPosition)
format
in class OraNumberFormat
number
- the long to be formatted into a string.toAppendTo
- the string buffer to be appended with the formatted string.fieldPosition
- to be used to get offsets of a given field in the returned string buffer. On input: the alignment field of which the offsets to be returned. On output: the offsets of the alignment field in the returned string buffer.public Number parse(String text, ParsePosition parsePosition)
parse
in class OraNumberFormat
text
- the stringIllegalArgumentException
- if the format pattern associated with this fromatter is not valid for parsing or the given numerical string can not be parsed into a Date.public boolean isDecimalSeparatorAlwaysShown()
public void setDecimalSeparatorAlwaysShown(boolean val)
val
- the given boolean value.public oracle.i18n.text.OraDecimalFormatSymbols getOraDecimalFormatSymbols()
OraDecimalFormatSymbols
public void setOraDecimalFormatSymbols(oracle.i18n.text.OraDecimalFormatSymbols sym)
sym
- the given Oracle decimal format symbols.public String toPattern()
public Object clone()
clone
in class OraNumberFormat
public boolean equals(Object object)
equals
in class OraNumberFormat
public int hashCode()
hashCode
in class Object
|
Oracle® Globalization Development Kit Java API Reference 10g Release 1(10.1) B10971-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |