public class FormattedNumber
extends java.lang.Object
NumberFormatter| Modifier and Type | Method and Description |
|---|---|
<A extends java.lang.Appendable> |
appendTo(A appendable)
Append the formatted number to an Appendable, such as a StringBuilder.
|
boolean |
equals(java.lang.Object other) |
java.text.AttributedCharacterIterator |
getFieldIterator()
Export the formatted number as an AttributedCharacterIterator.
|
PluralRules.IFixedDecimal |
getFixedDecimal()
Deprecated.
This API is ICU internal only.
|
java.lang.String |
getPrefix()
Deprecated.
This API is ICU internal only. Use
populateFieldPosition(java.text.FieldPosition) or
getFieldIterator() for similar functionality. |
java.lang.String |
getSuffix()
Deprecated.
This API is ICU internal only. Use
populateFieldPosition(java.text.FieldPosition) or
getFieldIterator() for similar functionality. |
int |
hashCode() |
void |
populateFieldPosition(java.text.FieldPosition fieldPosition)
Determine the start and end indices of the first occurrence of the given field in the
output string.
|
void |
populateFieldPosition(java.text.FieldPosition fieldPosition,
int offset)
Deprecated.
This API is ICU internal only.
|
java.math.BigDecimal |
toBigDecimal()
Export the formatted number as a BigDecimal.
|
java.lang.String |
toString()
Creates a String representation of the the formatted number.
|
public java.lang.String toString()
toString in class java.lang.ObjectNumberFormatterpublic <A extends java.lang.Appendable> A appendTo(A appendable)
If an IOException occurs when appending to the Appendable, an unchecked
ICUUncheckedIOException is thrown instead.
appendable - The Appendable to which to append the formatted number string.Appendable,
NumberFormatterpublic void populateFieldPosition(java.text.FieldPosition fieldPosition)
If multiple different field attributes are needed, this method can be called repeatedly, or if all field attributes are needed, consider using getFieldIterator().
If a field occurs multiple times in an output string, such as a grouping separator, this method will only ever return the first occurrence. Use getFieldIterator() to access all occurrences of an attribute.
fieldPosition - The FieldPosition to populate with the start and end indices of the desired field.NumberFormat.Field,
NumberFormatter@Deprecated
public void populateFieldPosition(java.text.FieldPosition fieldPosition,
int offset)
public java.text.AttributedCharacterIterator getFieldIterator()
If information on only one field is needed, consider using populateFieldPosition() instead.
NumberFormat.Field,
AttributedCharacterIterator,
NumberFormatterpublic java.math.BigDecimal toBigDecimal()
NumberFormatter@Deprecated public java.lang.String getPrefix()
populateFieldPosition(java.text.FieldPosition) or
getFieldIterator() for similar functionality.@Deprecated public java.lang.String getSuffix()
populateFieldPosition(java.text.FieldPosition) or
getFieldIterator() for similar functionality.@Deprecated public PluralRules.IFixedDecimal getFixedDecimal()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.ObjectCopyright © 2016 Unicode, Inc. and others.