Package com.ibm.icu.impl.personname
Class PersonNamePattern
java.lang.Object
com.ibm.icu.impl.personname.PersonNamePattern
A single name formatting pattern, corresponding to a single namePattern element in CLDR.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceA single element in a NamePattern.private static classInternal class used when formatting a mononym (a PersonName object that only has a given-name field).private static classLiteral text from a name pattern.private static classAn actual name field in a NamePattern (i.e., the stuff represented in the pattern by text in braces). -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePersonNamePattern(String patternText, PersonNameFormatterImpl formatterImpl) -
Method Summary
Modifier and TypeMethodDescriptionprivate Stringcoalesce(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.private booleanendsWith(StringBuilder s1, StringBuilder s2) Returns true if s1 ends with s2.format(PersonName name) private PersonNamehackNameForEmptyFields(PersonName originalName) static PersonNamePattern[]makePatterns(String[] patternText, PersonNameFormatterImpl formatterImpl) intnumEmptyFields(PersonName name) intnumPopulatedFields(PersonName name) toString()
-
Field Details
-
patternText
-
patternElements
-
-
Constructor Details
-
PersonNamePattern
-
-
Method Details
-
makePatterns
public static PersonNamePattern[] makePatterns(String[] patternText, PersonNameFormatterImpl formatterImpl) -
toString
-
format
-
numPopulatedFields
-
numEmptyFields
-
coalesce
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
Returns true if s1 ends with s2. -
hackNameForEmptyFields
-