|
Oracle® Globalization Development Kit Java API Reference 10g Release 2 (10.2) Part No. B14224-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
The OraDecimalFormat
class is a 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 object using the default number format pattern and the default decimal format symbols for the default locale. |
|
OraDecimalFormat(String pattern) Constructs an OraDecimalFormat object 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 object 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 clone method. |
boolean |
equals(Object object) Overrides the equals method. |
StringBuffer |
format(BigDecimal number, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats a BigDecimal object into a string. |
StringBuffer |
format(BigInteger number, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats a BigInteger object into a string. |
StringBuffer |
format(double number, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats a double number into a string. |
StringBuffer |
format(long number, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats a long number into a string. |
oracle.i18n.text.OraDecimalFormatSymbols |
getOraDecimalFormatSymbols() Returns the Oracle decimal format symbols used in this formatter. |
int |
hashCode() Overrides the hashCode method. |
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 object, 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 that 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()
OraDecimalFormat
object using the default number format pattern and the default decimal format symbols for the default locale.public OraDecimalFormat(String pattern) throws ParseException
OraDecimalFormat
object using the given format pattern and the default decimal format symbols for the default locale.pattern
- the given format patternParseException
- if the given pattern is invalidpublic OraDecimalFormat(String pattern, oracle.i18n.text.OraDecimalFormatSymbols symbols) throws ParseException
OraDecimalFormat
object using the given format pattern and the given decimal format symbols.pattern
- the give format patternsymbols
- the given decimal format symbolsParseException
- if the given pattern is invalidMethod Detail |
public void applyPattern(String pattern) throws ParseException
"<positive pattern>[;<negative pattern>]"This means that a positive format pattern must be present but a negative format pattern is optional. If there is no negative pattern given, the positive pattern with a leading minus sign is used for formatting or parsing negative numbers.
pattern
- given format patternParseException
- if the given pattern is invalidpublic StringBuffer format(BigDecimal number, StringBuffer toAppendTo, FieldPosition fieldPosition)
BigDecimal
object into a string. Sets field position if it is needed.format
in class OraNumberFormat
number
- the BigDecimal
object to be formatted.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 are 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)
BigInteger
object into a string. Sets field position if it is needed.format
in class OraNumberFormat
number
- the BigInteger
object to be formatted.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 are 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 number to be formatted.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 are 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 number to be formatted.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 are to be returned. On output, the offsets of the alignment field in the returned string buffer.public Number parse(String text, ParsePosition parsePosition)
Number
object, starting from the given parse position.parse
in class OraNumberFormat
text
- the stringparsePosition
- indicates where to start the parsing on input. On output, returns where the parse ends if parsing succeeds, or the start index if it fails.Number
objectpublic boolean isDecimalSeparatorAlwaysShown()
true
if decimal separator is always shown in the result string.public void setDecimalSeparatorAlwaysShown(boolean val)
val
- the given boolean valuepublic oracle.i18n.text.OraDecimalFormatSymbols getOraDecimalFormatSymbols()
OraDecimalFormatSymbols
objectOraDecimalFormatSymbols
public void setOraDecimalFormatSymbols(oracle.i18n.text.OraDecimalFormatSymbols sym)
sym
- the given Oracle decimal format symbolspublic String toPattern()
public Object clone()
clone
method.clone
in class OraNumberFormat
public boolean equals(Object object)
equals
method.equals
in class OraNumberFormat
object
- an object to be comparedtrue
if two objects are identical, otherwise false
public int hashCode()
hashCode
method.hashCode
in class Object
|
Oracle® Globalization Development Kit Java API Reference 10g Release 2 (10.2) Part No. B14224-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |