Class 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
    • 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 class java.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 class java.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 class java.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 class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • writeReplace

        private java.lang.Object writeReplace()
                                       throws java.io.ObjectStreamException
        Throws:
        java.io.ObjectStreamException