java.lang.Object | |
↳ | com.android.providers.contacts.NameSplitter |
The purpose of this class is to split a full name into given names and last name. The logic only supports having a single last name. If the full name has multiple last names the output will be incorrect.
Core algorithm:
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NameSplitter.Name |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MAX_TOKENS |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
If the supplied name style is undefined, returns a default based on the language,
otherwise returns the supplied name style itself.
| |||||||||||
Updates the display name style according to the phonetic name style if we
were unsure about display name style based on the name components, but
phonetic name makes it more definitive.
| |||||||||||
Makes the best guess at the expected full name style based on the character set
used in the supplied name.
| |||||||||||
Concatenates components of a name according to the rules dictated by the name style.
| |||||||||||
Concatenates components of the phonetic name following the CJK tradition:
family name + middle name + given name(s).
| |||||||||||
Parses a full name and returns parsed components in the Name object.
| |||||||||||
Parses a full name and returns components as a list of tokens.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructor.
commonPrefixes | comma-separated list of common prefixes, e.g. "Mr, Ms, Mrs" |
---|---|
commonLastNamePrefixes | comma-separated list of common last name prefixes, e.g. "d', st, st., von" |
commonSuffixes | comma-separated list of common suffixes, e.g. "Jr, M.D., MD, D.D.S." |
commonConjunctions | comma-separated list of common conjuctions, e.g. "AND, Or" |
If the supplied name style is undefined, returns a default based on the language, otherwise returns the supplied name style itself.
nameStyle | See FullNameStyle. |
---|
Updates the display name style according to the phonetic name style if we were unsure about display name style based on the name components, but phonetic name makes it more definitive.
Makes the best guess at the expected full name style based on the character set used in the supplied name. If the phonetic name is also supplied, tries to differentiate between Chinese, Japanese and Korean based on the alphabet used for the phonetic name.
Concatenates components of a name according to the rules dictated by the name style.
givenNameFirst | is ignored for CJK display name styles |
---|
Concatenates components of the phonetic name following the CJK tradition: family name + middle name + given name(s).
Parses a full name and returns parsed components in the Name object.
Parses a full name and returns components as a list of tokens.