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 java.lang.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 Modifier and Type Field Description private PersonName
underlyingPersonName
-
Constructor Summary
Constructors Constructor Description GivenToSurnamePersonName(PersonName underlyingPersonName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getFieldValue(PersonName.NameField identifier, java.util.Set<PersonName.FieldModifier> modifiers)
Returns one field of the name, possibly in a modified form.java.util.Locale
getNameLocale()
Returns the locale of the name-- that is, the language or country of origin for the person being named.PersonName.PreferredOrder
getPreferredOrder()
Returns the preferred field order for the name.java.lang.String
toString()
-
-
-
Field Detail
-
underlyingPersonName
private PersonName underlyingPersonName
-
-
Constructor Detail
-
GivenToSurnamePersonName
public GivenToSurnamePersonName(PersonName underlyingPersonName)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getNameLocale
public java.util.Locale 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
public PersonName.PreferredOrder 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 java.lang.String getFieldValue(PersonName.NameField identifier, java.util.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.
-
-