|
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
The OraNumberFormat
class is an abstract class to do locale-sensitive formatting and parsing between number and string. It supports Oracle number formatting behavior.
OraDecimalFormat
, Serialized FormNested Class Summary |
Nested classes inherited from class java.text.Format |
Format.Field |
Field Summary | |
static int |
ALL_FIELD Constant for ALL_FIELD alignment. |
static int |
FRACTION_FIELD Constant for FRACTION_FIELD alignment. |
static int |
INTEGER_FIELD Constant for INTEGER_FIELD alignment. |
Constructor Summary | |
OraNumberFormat() |
Method Summary | |
Object |
clone() Overrides the clone method. |
boolean |
equals(Object obj) Overrides the equals method. |
String |
format(BigDecimal number) Formats a BigDecimal object into a string. |
abstract StringBuffer |
format(BigDecimal number, StringBuffer toAppendTo, FieldPosition position) Formats a BigDecimal object into a string. |
String |
format(BigInteger number) Formats a BigInteger object into a string. |
abstract StringBuffer |
format(BigInteger number, StringBuffer toAppendTo, FieldPosition position) Formats a BigInteger object into a string. |
String |
format(double number) Formats a double number into a string. |
abstract StringBuffer |
format(double number, StringBuffer toAppendTo, FieldPosition position) Formats a double number into a string. |
String |
format(long number) Formats a long number into a string. |
abstract StringBuffer |
format(long number, StringBuffer toAppendTo, FieldPosition position) Formats a long number into a string. |
StringBuffer |
format(Object number, StringBuffer toAppendTo, FieldPosition position) Formats an object into a string. |
static oracle.i18n.text.OraNumberFormat |
getCurrencyInstance() Returns a number formatter that uses the default currency format pattern for the default locale. |
static oracle.i18n.text.OraNumberFormat |
getCurrencyInstance(Locale locale) Returns a number formatter that uses the default currency format pattern for the given locale. |
static oracle.i18n.text.OraNumberFormat |
getCurrencyInstance(oracle.i18n.util.OraLocaleInfo localeInfo) Returns a number formatter that uses the default currency format pattern for the given OraLocaleInfo object. |
static String |
getDefaultCurrencyFormatPattern(Locale locale) Returns the default currency format pattern for the given locale. |
static String |
getDefaultCurrencyFormatPattern(oracle.i18n.util.OraLocaleInfo localeInfo) Returns the default currency format pattern for the given OraLocaleInfo object. |
static String |
getDefaultNumberFormatPattern(Locale locale) Returns the default number format pattern for the given locale. |
static String |
getDefaultNumberFormatPattern(oracle.i18n.util.OraLocaleInfo localeInfo) Returns the default number format pattern for the given OraLocaleInfo object. |
static oracle.i18n.text.OraNumberFormat |
getInstance() Returns a number formatter that uses the default number format pattern for the default locale. |
static oracle.i18n.text.OraNumberFormat |
getInstance(Locale locale) Returns a number formatter that uses the default currency format pattern for the given locale. |
static oracle.i18n.text.OraNumberFormat |
getInstance(oracle.i18n.util.OraLocaleInfo localeInfo) Returns a number formatter that uses the default currency format pattern for the given OraLocaleInfo object. |
static oracle.i18n.text.OraNumberFormat |
getNumberInstance() Returns a number formatter that uses the default number format pattern for the default locale. |
static oracle.i18n.text.OraNumberFormat |
getNumberInstance(Locale locale) Returns a number formatter that uses the default currency format pattern for the given locale. |
static oracle.i18n.text.OraNumberFormat |
getNumberInstance(oracle.i18n.util.OraLocaleInfo localeInfo) Returns a number formatter that uses the default currency format pattern for the given OraLocaleInfo object. |
boolean |
isGroupingUsed() Checks if the grouping separator is used for this formatter. |
boolean |
isParseIntegerOnly() Checks if this formatter parses integer portion only. |
Number |
parse(String text) Parses a string into a number. |
abstract Number |
parse(String text, ParsePosition parsePosition) Parses a string into a number, starting from the given parse position. |
Object |
parseObject(String text, ParsePosition parsePosition) Parses a string into a ( Number ) object, starting from the given parse position. |
void |
setGroupingUsed(boolean val) Sets the switch for grouping separator to the given boolean value. |
void |
setParseIntegerOnly(boolean val) Sets the switch for parsing integer only to the given boolean value. |
Methods inherited from class java.text.Format |
format, formatToCharacterIterator, parseObject |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALL_FIELD
ALL_FIELD
alignment. Used to specify the field position for formatting. The ALL_FIELD
constant is used to indicate all fields specified in a format pattern.
public static final int INTEGER_FIELD
INTEGER_FIELD
alignment. Used to specify the field position for formatting.
public static final int FRACTION_FIELD
FRACTION_FIELD
alignment. Used to specify the field position for formatting.
Constructor Detail |
public OraNumberFormat()
Method Detail |
public static oracle.i18n.text.OraNumberFormat getCurrencyInstance()
public static oracle.i18n.text.OraNumberFormat getCurrencyInstance(Locale locale)
locale
- the given localepublic static oracle.i18n.text.OraNumberFormat getCurrencyInstance(oracle.i18n.util.OraLocaleInfo localeInfo)
OraLocaleInfo
object.localeInfo
- the given OraLocaleInfo
objectpublic static String getDefaultCurrencyFormatPattern(Locale locale)
locale
- the given locale"<positive pattern>;<negative pattern>"
or, if patterns for both positive and negative patterns are the same, the form is "<positive pattern>"
.public static String getDefaultCurrencyFormatPattern(oracle.i18n.util.OraLocaleInfo localeInfo)
OraLocaleInfo
object.localeInfo
- the given OraLocaleInfo
object"<positive pattern>;<negative pattern>"
or, if patterns for both positive and negative patterns are the same, the form is "<positive pattern>"
.public static String getDefaultNumberFormatPattern(Locale locale)
locale
- the given locale"<positive pattern>;<negative pattern>"
or, if patterns for both positive and negative patterns are the same, the form is "<positive pattern>"
.public static String getDefaultNumberFormatPattern(oracle.i18n.util.OraLocaleInfo localeInfo)
OraLocaleInfo
object.localeInfo
- the given OraLocaleInfo
object"<positive pattern>;<negative pattern>"
or, if patterns for both positive and negative patterns are the same, the form is "<positive pattern>"
.public static oracle.i18n.text.OraNumberFormat getInstance()
public static oracle.i18n.text.OraNumberFormat getInstance(Locale locale)
locale
- the given localepublic static oracle.i18n.text.OraNumberFormat getInstance(oracle.i18n.util.OraLocaleInfo localeInfo)
OraLocaleInfo
object.localeInfo
- the given OraLocaleInfo
objectpublic static oracle.i18n.text.OraNumberFormat getNumberInstance()
public static oracle.i18n.text.OraNumberFormat getNumberInstance(Locale locale)
locale
- the given localepublic static oracle.i18n.text.OraNumberFormat getNumberInstance(oracle.i18n.util.OraLocaleInfo localeInfo)
OraLocaleInfo
object.localeInfo
- the given OraLocaleInfo
objectpublic String format(BigDecimal number)
BigDecimal
object into a string.number
- the BigDecimal
object to be formattedpublic String format(BigInteger number)
BigInteger
object into a string.number
- the BigInteger
object to be formattedpublic String format(double number)
number
- the double number to be formattedpublic String format(long number)
number
- the long number to be formattedpublic abstract StringBuffer format(BigDecimal number, StringBuffer toAppendTo, FieldPosition position)
BigDecimal
object into a string. Sets field position if it is needed.number
- the BigDecimal
object to be formatted.toAppendTo
- the string buffer to be appended with the formatted string.position
- 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 abstract StringBuffer format(BigInteger number, StringBuffer toAppendTo, FieldPosition position)
BigInteger
object into a string. Sets field position if it is needed.number
- the BigInteger
object to be formatted.toAppendTo
- the string buffer to be appended with the formatted string.position
- 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 abstract StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition position)
number
- the double number to be formatted.toAppendTo
- the string buffer to be appended with the formatted string.position
- 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 abstract StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition position)
number
- the long number to be formatted.toAppendTo
- the string buffer to be appended with the formatted string.position
- 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(Object number, StringBuffer toAppendTo, FieldPosition position)
format
in class Format
number
- the object to be formatted. It must be an instance of Number
class.toAppendTo
- the string buffer to be appended with the formatted string.position
- 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.IllegalArgumentException
- if the given object is not an instance of Number
classpublic Number parse(String text) throws ParseException
text
- the string to be parsedNumber
object corresponding to the stringParseException
- if the format pattern associated with this formatter is not valid for parsing or the given string cannot be parsed into a instance of Number
classpublic abstract Number parse(String text, ParsePosition parsePosition)
text
- the string to be parsed.parsePosition
- 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 Object parseObject(String text, ParsePosition parsePosition)
Number
) object, starting from the given parse position. It is a convenient method which simply calls the parse(String, ParsePostion)
method.parseObject
in class Format
parse(String, ParsePosition)
public boolean isGroupingUsed()
true
if the grouping separator is used, false
otherwisepublic void setGroupingUsed(boolean val)
val
- the given boolean valuepublic boolean isParseIntegerOnly()
true
if this formatter parses integer portion only, false
otherwisepublic void setParseIntegerOnly(boolean val)
val
- the given boolean valuepublic Object clone()
clone
method.clone
in class Format
public boolean equals(Object obj)
equals
method.equals
in class Object
obj
- an object to be comparedtrue
if two objects are equal, otherwise returns false
|
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 |