Class PersonNamePattern

java.lang.Object
com.ibm.icu.impl.personname.PersonNamePattern

class PersonNamePattern extends Object
A single name formatting pattern, corresponding to a single namePattern element in CLDR.
  • Field Details

  • Constructor Details

  • Method Details

    • makePatterns

      public static PersonNamePattern[] makePatterns(String[] patternText, PersonNameFormatterImpl formatterImpl)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • format

      public String format(PersonName name)
    • numPopulatedFields

      public int numPopulatedFields(PersonName name)
    • numEmptyFields

      public int numEmptyFields(PersonName name)
    • coalesce

      private String coalesce(StringBuilder s1, StringBuilder s2)
      Stitches together the literal text on either side of an omitted field by deleting any non-whitespace characters immediately neighboring the omitted field and coalescing any adjacent spaces at the join point down to one.
      Parameters:
      s1 - The literal text before the omitted field.
      s2 - The literal text after the omitted field.
    • endsWith

      private boolean endsWith(StringBuilder s1, StringBuilder s2)
      Returns true if s1 ends with s2.
    • hackNameForEmptyFields

      private PersonName hackNameForEmptyFields(PersonName originalName)