Package com.ibm.icu.impl.number
Class LocalizedNumberFormatterAsFormat
- java.lang.Object
-
- java.text.Format
-
- com.ibm.icu.impl.number.LocalizedNumberFormatterAsFormat
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class LocalizedNumberFormatterAsFormat extends java.text.Format
A wrapper around LocalizedNumberFormatter implementing the Format interface, enabling improved compatibility with other APIs. This class is serializable.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
LocalizedNumberFormatterAsFormat.Proxy
-
Field Summary
Fields Modifier and Type Field Description private LocalizedNumberFormatter
formatter
private ULocale
locale
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description LocalizedNumberFormatterAsFormat(LocalizedNumberFormatter formatter, ULocale locale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
java.lang.StringBuffer
format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
Formats a Number using the wrapped LocalizedNumberFormatter.java.text.AttributedCharacterIterator
formatToCharacterIterator(java.lang.Object obj)
Formats a Number using the wrapped LocalizedNumberFormatter.LocalizedNumberFormatter
getNumberFormatter()
Gets the LocalizedNumberFormatter that this wrapper class uses to format numbers.int
hashCode()
java.lang.Object
parseObject(java.lang.String source, java.text.ParsePosition pos)
Not supported.private java.lang.Object
writeReplace()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
formatter
private final transient LocalizedNumberFormatter formatter
-
locale
private final transient ULocale locale
-
-
Constructor Detail
-
LocalizedNumberFormatterAsFormat
public LocalizedNumberFormatterAsFormat(LocalizedNumberFormatter formatter, ULocale locale)
-
-
Method Detail
-
format
public java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
Formats a Number using the wrapped LocalizedNumberFormatter. The provided object must be a Number.- Specified by:
format
in classjava.text.Format
-
formatToCharacterIterator
public java.text.AttributedCharacterIterator formatToCharacterIterator(java.lang.Object obj)
Formats a Number using the wrapped LocalizedNumberFormatter. The provided object must be a Number.- Overrides:
formatToCharacterIterator
in classjava.text.Format
-
parseObject
public java.lang.Object parseObject(java.lang.String source, java.text.ParsePosition pos)
Not supported. This method will throw UnsupportedOperationException.- Specified by:
parseObject
in classjava.text.Format
-
getNumberFormatter
public LocalizedNumberFormatter getNumberFormatter()
Gets the LocalizedNumberFormatter that this wrapper class uses to format numbers.- Returns:
- The unwrapped LocalizedNumberFormatter.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
writeReplace
private java.lang.Object writeReplace() throws java.io.ObjectStreamException
- Throws:
java.io.ObjectStreamException
-
-