| REFERRING | ADDRESSING | MONOGRAM | ||||
|---|---|---|---|---|---|---|
| FORMAL | INFORMAL | FORMAL | INFORMAL | FORMAL | INFORMAL | |
| LONG | James Earl Carter Jr. | Jimmy Carter | Mr. Carter | Jimmy | JEC | JC |
| MEDIUM | James E. Carter Jr. | Jimmy Carter | Mr. Carter | Jimmy | C | J |
| SHORT | J. E. Carter | Jimmy Carter | Mr. Carter | Jimmy | C | J |
| Modifier and Type | Class and Description |
|---|---|
| public static class | PersonNameFormatter.Builder
A utility class that can be used to construct a PersonNameFormatter. |
| public static enum | PersonNameFormatter.DisplayOrder
An enum indicating the desired display order for a formatted name. |
| public static enum | PersonNameFormatter.Formality
Specifies the intended formality of the formatted name. |
| public static enum | PersonNameFormatter.Length
Specifies the desired length of the formatted name. |
| public static enum | PersonNameFormatter.Usage
Specifies the intended usage of the formatted name. |
| Modifier and Type | Field and Description |
|---|---|
| private final PersonNameFormatterImpl |
| Access | Constructor and Description |
|---|---|
| private | PersonNameFormatter(Locale locale, PersonNameFormatter.
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static PersonNameFormatter. | Returns: A new Builder.Returns a Builder object that can be used to construct a new PersonNameFormatter. |
| public String | Returns: The name, formatted according to the locale and other parameters passed to the formatter's constructor.A PersonName object that supplies individual field values (optionally, with modifiers applied)
to the formatter for formatting. name)Formats a name. |
| public PersonNameFormatter. | Returns: A new Builder that can be used to create a new formatter based on this formatter.Returns a Builder object whose fields match those used to construct this formatter, allowing a new formatter to be created based on this one. |
| public String | toString()
Overrides java.
Deprecated
This API is for debugging only.
Returns a string representation of the object.
|
| impl | back to summary |
|---|---|
| private final PersonNameFormatterImpl impl | |
| PersonNameFormatter | back to summary |
|---|---|
| private PersonNameFormatter(Locale locale, PersonNameFormatter. | |
| PersonNameFormatter | back to summary |
|---|---|
| public PersonNameFormatter(Locale locale, String[] gnFirstPatterns, String[] snFirstPatterns, String[] gnFirstLocales, String[] snFirstLocales)
Deprecated This API is for unit testing only.
| |
| builder | back to summary |
|---|---|
| public static PersonNameFormatter. Returns a Builder object that can be used to construct a new PersonNameFormatter.
| |
| formatToString | back to summary |
|---|---|
| public String formatToString(PersonName name) Formats a name.
| |
| toBuilder | back to summary |
|---|---|
| public PersonNameFormatter. Returns a Builder object whose fields match those used to construct this formatter, allowing a new formatter to be created based on this one.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Deprecated This API is for debugging only. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| private PersonNameFormatter. | |
| private PersonNameFormatter. | |
| private PersonNameFormatter. | |
| private Locale | |
| private boolean | |
| private PersonNameFormatter. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public PersonNameFormatter | Returns: A new PersonNameFormatter.Returns a new PersonNameFormatter with the values that were passed to this builder. |
| public PersonNameFormatter. | Returns: This builder.The desired display order for formatted names. orderSpecifies the desired display order for the formatted names. |
| public PersonNameFormatter. | Returns: This builder.The new name length. formalitySets the name formality for the formatter to be constructed. |
| public PersonNameFormatter. | Returns: This builder.The new name length. lengthSets the name length for the formatter to be constructed. |
| public PersonNameFormatter. | |
| public PersonNameFormatter. | Returns: This builder.If true, the surname in the formatted result will be rendered in ALL CAPS. allCaps)Requests that the surname in the formatted result be rendered in ALL CAPS. |
| public PersonNameFormatter. | Returns: This builder.The new name length. usageSets the name usage for the formatter to be constructed. |
| displayOrder | back to summary |
|---|---|
| private PersonNameFormatter. | |
| formality | back to summary |
|---|---|
| private PersonNameFormatter. | |
| length | back to summary |
|---|---|
| private PersonNameFormatter. | |
| locale | back to summary |
|---|---|
| private Locale locale | |
| surnameAllCaps | back to summary |
|---|---|
| private boolean surnameAllCaps | |
| usage | back to summary |
|---|---|
| private PersonNameFormatter. | |
| Builder | back to summary |
|---|---|
| private Builder() | |
| build | back to summary |
|---|---|
| public PersonNameFormatter build() Returns a new PersonNameFormatter with the values that were passed to this builder. This method doesn't freeze or delete the builder; you can call build() more than once (presumably after calling the other methods to change the parameter) to create more than one PersonNameFormatter; you don't need a new Builder for each PersonNameFormatter.
| |
| setDisplayOrder | back to summary |
|---|---|
| public PersonNameFormatter. Specifies the desired display order for the formatted names. This can be either SORTING, which requests that names be formatted in a manner suitable for inclusion in a sorted list (e.g., in English, "Smith, John"), or DEFAULT, which gives the standard field order suitable for most contexts (e.g., in English, "John Smith").
| |
| setFormality | back to summary |
|---|---|
| public PersonNameFormatter. Sets the name formality for the formatter to be constructed.
| |
| setLength | back to summary |
|---|---|
| public PersonNameFormatter. Sets the name length for the formatter to be constructed.
| |
| setLocale | back to summary |
|---|---|
| public PersonNameFormatter. Sets the locale for the formatter to be constructed.
| |
| setSurnameAllCaps | back to summary |
|---|---|
| public PersonNameFormatter. Requests that the surname in the formatted result be rendered in ALL CAPS. This is often done with Japanese names to highlight which name is the surname.
| |
| setUsage | back to summary |
|---|---|
| public PersonNameFormatter. Sets the name usage for the formatter to be constructed.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final PersonNameFormatter. | DEFAULT
The default display order; used to indicate normal formatting. |
| public static final PersonNameFormatter. | FORCE_GIVEN_FIRST
Forces the formatter to format the name in given-first order. |
| public static final PersonNameFormatter. | FORCE_SURNAME_FIRST
Forces the formatter to format the name in surname-first order. |
| public static final PersonNameFormatter. | SORTING
Used to indicate a display order suitable for use in a sorted list: For English, this would put the surnames first, with a comma between them and the rest of the name: "Smith, John". |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static PersonNameFormatter. | |
| public static PersonNameFormatter. |
| DEFAULT | back to summary |
|---|---|
| public static final PersonNameFormatter. The default display order; used to indicate normal formatting.
| |
| FORCE_GIVEN_FIRST | back to summary |
|---|---|
| public static final PersonNameFormatter. Forces the formatter to format the name in given-first order. If the name itself specifies a display order, this overrides it.
| |
| FORCE_SURNAME_FIRST | back to summary |
|---|---|
| public static final PersonNameFormatter. Forces the formatter to format the name in surname-first order. If the name itself specifies a display order, this overrides it.
| |
| SORTING | back to summary |
|---|---|
| public static final PersonNameFormatter. Used to indicate a display order suitable for use in a sorted list: For English, this would put the surnames first, with a comma between them and the rest of the name: "Smith, John".
| |
| DisplayOrder | back to summary |
|---|---|
| private DisplayOrder() | |
| valueOf | back to summary |
|---|---|
| public static PersonNameFormatter. | |
| values | back to summary |
|---|---|
| public static PersonNameFormatter. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final PersonNameFormatter. | DEFAULT
The default formality for the locale. |
| public static final PersonNameFormatter. | FORMAL
The more formal version of the name. |
| public static final PersonNameFormatter. | INFORMAL
The more informal version of the name. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static PersonNameFormatter. | |
| public static PersonNameFormatter. |
| DEFAULT | back to summary |
|---|---|
| public static final PersonNameFormatter. The default formality for the locale. For most locales, this is the same as FORMAL, but for English, this is the same as INFORMAL.
| |
| FORMAL | back to summary |
|---|---|
| public static final PersonNameFormatter. The more formal version of the name.
| |
| INFORMAL | back to summary |
|---|---|
| public static final PersonNameFormatter. The more informal version of the name. In English, this might omit fields or use the "informal" variant of the given name.
| |
| Formality | back to summary |
|---|---|
| private Formality() | |
| valueOf | back to summary |
|---|---|
| public static PersonNameFormatter. | |
| values | back to summary |
|---|---|
| public static PersonNameFormatter. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final PersonNameFormatter. | DEFAULT
The default name length for the locale. |
| public static final PersonNameFormatter. | LONG
The longest name length. |
| public static final PersonNameFormatter. | MEDIUM
The most typical name length. |
| public static final PersonNameFormatter. | SHORT
A shortened name. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static PersonNameFormatter. | |
| public static PersonNameFormatter. |
| DEFAULT | back to summary |
|---|---|
| public static final PersonNameFormatter. The default name length for the locale. For most locales, this is the same as MEDIUM.
| |
| LONG | back to summary |
|---|---|
| public static final PersonNameFormatter. The longest name length. Generally uses most of the fields in the name object.
| |
| MEDIUM | back to summary |
|---|---|
| public static final PersonNameFormatter. The most typical name length. Generally includes the given name and surname, but generally not most of the other fields.
| |
| SHORT | back to summary |
|---|---|
| public static final PersonNameFormatter. A shortened name. Skips most fields and may abbreviate some name fields to just their initials. When Formality is INFORMAL, may only include one field.
| |
| Length | back to summary |
|---|---|
| private Length() | |
| valueOf | back to summary |
|---|---|
| public static PersonNameFormatter. | |
| values | back to summary |
|---|---|
| public static PersonNameFormatter. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final PersonNameFormatter. | ADDRESSING
Used for when the name is going to be used to address the user directly: "Turn left here, John." |
| public static final PersonNameFormatter. | MONOGRAM
Used to generate monograms, short 1 to 3-character versions of the name suitable for use in things like chat avatars. |
| public static final PersonNameFormatter. | REFERRING
Used in general cases, when the name is used to refer to somebody else. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static PersonNameFormatter. | |
| public static PersonNameFormatter. |
| ADDRESSING | back to summary |
|---|---|
| public static final PersonNameFormatter. Used for when the name is going to be used to address the user directly: "Turn left here, John."
| |
| MONOGRAM | back to summary |
|---|---|
| public static final PersonNameFormatter. Used to generate monograms, short 1 to 3-character versions of the name suitable for use in things like chat avatars. In English, this is usually the person's initials, but this isn't true in all languages. When the caller specifies Usage.MONOGRAM, the Length parameter can be used to get different lengths of monograms: Length.SHORT is generally a single letter; Length.LONG may be as many as three or four.
| |
| REFERRING | back to summary |
|---|---|
| public static final PersonNameFormatter. Used in general cases, when the name is used to refer to somebody else.
| |
| Usage | back to summary |
|---|---|
| private Usage() | |
| valueOf | back to summary |
|---|---|
| public static PersonNameFormatter. | |
| values | back to summary |
|---|---|
| public static PersonNameFormatter. | |