Interface Modifier

    • Method Detail

      • apply

        int apply​(FormattedStringBuilder output,
                  int leftIndex,
                  int rightIndex)
        Apply this Modifier to the string builder.
        Parameters:
        output - The string builder to which to apply this modifier.
        leftIndex - The left index of the string within the builder. Equal to 0 when only one number is being formatted.
        rightIndex - The right index of the string within the string builder. Equal to length when only one number is being formatted.
        Returns:
        The number of characters (UTF-16 code units) that were added to the string builder.
      • getPrefixLength

        int getPrefixLength()
        Gets the length of the prefix. This information can be used in combination with apply(com.ibm.icu.impl.FormattedStringBuilder, int, int) to extract the prefix and suffix strings.
        Returns:
        The number of characters (UTF-16 code units) in the prefix.
      • getCodePointCount

        int getCodePointCount()
        Returns the number of code points in the modifier, prefix plus suffix.
      • isStrong

        boolean isStrong()
        Whether this modifier is strong. If a modifier is strong, it should always be applied immediately and not allowed to bubble up. With regard to padding, strong modifiers are considered to be on the inside of the prefix and suffix.
        Returns:
        Whether the modifier is strong.
      • containsField

        boolean containsField​(java.text.Format.Field currency)
        Whether the modifier contains at least one occurrence of the given field.
      • getParameters

        Modifier.Parameters getParameters()
        Gets a set of "parameters" for this Modifier.
      • strictEquals

        boolean strictEquals​(Modifier other)
        Returns whether this Modifier equals another Modifier.
      • semanticallyEquivalent

        default boolean semanticallyEquivalent​(Modifier other)
        Returns whether this Modifier is *semantically equivalent* to the other Modifier; in many cases, this is the same as equal, but parameters should be ignored.