public class FormattedNumber extends Object
NumberFormatter
Modifier and Type | Method | Description |
---|---|---|
<A extends Appendable> |
appendTo(A appendable) |
Append the formatted number to an Appendable, such as a StringBuilder.
|
boolean |
equals(Object other) |
|
AttributedCharacterIterator |
getFieldIterator() |
Export the formatted number as an AttributedCharacterIterator.
|
PluralRules.IFixedDecimal |
getFixedDecimal() |
Deprecated.
This API is ICU internal only.
|
String |
getPrefix() |
Deprecated.
This API is ICU internal only.
|
String |
getSuffix() |
Deprecated.
This API is ICU internal only.
|
int |
hashCode() |
|
void |
populateFieldPosition(FieldPosition fieldPosition) |
Determine the start and end indices of the first occurrence of the given field in the output string.
|
void |
populateFieldPosition(FieldPosition fieldPosition,
int offset) |
Deprecated.
This API is ICU internal only.
|
BigDecimal |
toBigDecimal() |
Export the formatted number as a BigDecimal.
|
String |
toString() |
Creates a String representation of the the formatted number.
|
public String toString()
toString
in class Object
NumberFormatter
public <A extends 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
,
NumberFormatter
public void populateFieldPosition(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(FieldPosition fieldPosition, int offset)
public AttributedCharacterIterator getFieldIterator()
If information on only one field is needed, consider using populateFieldPosition() instead.
NumberFormat.Field
,
AttributedCharacterIterator
,
NumberFormatter
public BigDecimal toBigDecimal()
NumberFormatter
@Deprecated public String getPrefix()
@Deprecated public String getSuffix()
@Deprecated public PluralRules.IFixedDecimal getFixedDecimal()
Copyright ? 2016 Unicode, Inc. and others.