Class IrregularGroupFormatter


  • public class IrregularGroupFormatter
    extends NumericGroupFormatter
    Handles grouping separators when formatting a number in cases where the grouping separators are not at regular intervals
    • Constructor Summary

      Constructors 
      Constructor Description
      IrregularGroupFormatter​(IntSet groupingPositions, java.util.List<java.lang.Integer> sep, UnicodeString adjustedPicture)
      Create a formatter for numbers where the grouping separators occur at irregular positions
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(java.lang.String value)
      Reformat a number to add grouping separators
      java.lang.String getSeparator()
      Get the grouping separator to be used.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IrregularGroupFormatter

        public IrregularGroupFormatter​(IntSet groupingPositions,
                                       java.util.List<java.lang.Integer> sep,
                                       UnicodeString adjustedPicture)
        Create a formatter for numbers where the grouping separators occur at irregular positions
        Parameters:
        groupingPositions - the positions where the separators are to be inserted
        sep - array holding the separators to be inserted, as Unicode codepoints, in order starting with the right-most
        adjustedPicture - the formatting picture, after expansion and removal of grouping separators
    • Method Detail

      • format

        public java.lang.String format​(java.lang.String value)
        Description copied from class: NumericGroupFormatter
        Reformat a number to add grouping separators
        Specified by:
        format in class NumericGroupFormatter
        Parameters:
        value - a buffer holding the number to be reformatted
        Returns:
        the reformatted number
      • getSeparator

        public java.lang.String getSeparator()
        Get the grouping separator to be used. If more than one is used, return the last. If no grouping separators are used, return null
        Specified by:
        getSeparator in class NumericGroupFormatter
        Returns:
        the grouping separator