Package com.ibm.icu.impl.personname
Class PersonNamePattern.GivenToSurnamePersonName
java.lang.Object
com.ibm.icu.impl.personname.PersonNamePattern.GivenToSurnamePersonName
- All Implemented Interfaces:
PersonName
- Enclosing class:
PersonNamePattern
private static class PersonNamePattern.GivenToSurnamePersonName
extends Object
implements PersonName
Internal class used when formatting a mononym (a PersonName object that only has
a given-name field). If the name doesn't have a surname field and the pattern
doesn't have a given-name field (or only has one that produces an initial), we
use this class to behave as though the value supplied in the given-name field
had instead been supplied in the surname field.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ibm.icu.text.PersonName
PersonName.FieldModifier, PersonName.NameField, PersonName.PreferredOrder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFieldValue
(PersonName.NameField identifier, Set<PersonName.FieldModifier> modifiers) Returns one field of the name, possibly in a modified form.Returns the locale of the name-- that is, the language or country of origin for the person being named.Returns the preferred field order for the name.toString()
-
Field Details
-
underlyingPersonName
-
-
Constructor Details
-
GivenToSurnamePersonName
-
-
Method Details
-
toString
-
getNameLocale
Description copied from interface:PersonName
Returns the locale of the name-- that is, the language or country of origin for the person being named. An implementing class is allowed to return null here to indicate the name's locale is unknown.- Specified by:
getNameLocale
in interfacePersonName
- Returns:
- The name's locale, or null if it's not known.
-
getPreferredOrder
Description copied from interface:PersonName
Returns the preferred field order for the name. PersonName objects should generally return DEFAULT, allowing the PersonNameFormatter to deduce the peoper field order based on the locales of the name and the formatter. But this can be used to force a particular field order, generally in cases where the deduction logic in PersonNameFormatter would guess wrong.- Specified by:
getPreferredOrder
in interfacePersonName
- Returns:
- The name's preferred field order.
-
getFieldValue
public String getFieldValue(PersonName.NameField identifier, Set<PersonName.FieldModifier> modifiers) Description copied from interface:PersonName
Returns one field of the name, possibly in a modified form.- Specified by:
getFieldValue
in interfacePersonName
- Parameters:
identifier
- The identifier of the requested field.modifiers
- An IN/OUT parameter that specifies modifiers to apply to the basic field value. An implementing class can choose to handle or ignore any modifiers; it should modify the passed-in Set so that on exit, it contains only the requested modifiers that it DIDN'T handle. This parameter may not be null, and must either be mutable or empty.- Returns:
- The value of the requested field, optionally modified by some or all of the requested modifiers, or null if the requested field isn't present in the name.
-