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 interface
A single element in a NamePattern.private static class
Internal class used when formatting a mononym (a PersonName object that only has a given-name field).private static class
Literal text from a name pattern.private static class
An actual name field in a NamePattern (i.e., the stuff represented in the pattern by text in braces). -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
PersonNamePattern
(String patternText, PersonNameFormatterImpl formatterImpl) -
Method Summary
Modifier and TypeMethodDescriptionprivate 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.private boolean
endsWith
(StringBuilder s1, StringBuilder s2) Returns true if s1 ends with s2.format
(PersonName name) private PersonName
hackNameForEmptyFields
(PersonName originalName) static PersonNamePattern[]
makePatterns
(String[] patternText, PersonNameFormatterImpl formatterImpl) int
numEmptyFields
(PersonName name) int
numPopulatedFields
(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
-