public class TitleFormatter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
TitleFormatter.EnglishLocaleContext
A data structure which self-initializes with all the data related to
evaluations in an English-speaking context.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
format(android.content.Context ctx,
java.lang.String sInput)
Formats a string as a title.
|
static java.lang.String |
format(android.content.Context ctx,
java.lang.String sInput,
java.util.Locale loc)
Formats a string as a title, using the specified locale (eventually...).
|
protected static java.lang.String |
formatEnglishTitle(android.content.Context ctx,
java.lang.String sInput)
Formats a string as a title, assuming an English-speaking locale.
|
protected static java.lang.String |
resolveEnglishToken(TitleFormatter.EnglishLocaleContext lctx,
java.lang.String sToken,
boolean bForce)
Resolves capitalization of a single English token.
|
public static java.lang.String format(android.content.Context ctx, java.lang.String sInput)
ctx
- a context, so we can fetch localized string resourcessInput
- the input stringpublic static java.lang.String format(android.content.Context ctx, java.lang.String sInput, java.util.Locale loc)
ctx
- a context, so we can fetch localized string resourcessInput
- the input stringloc
- the locale to be considered; this is currently ignored, but
may be used in a future versionprotected static java.lang.String formatEnglishTitle(android.content.Context ctx, java.lang.String sInput)
The criteria used are as follows:
This most closely matches the AP Stylebook, as opposed to the Chicago Manual of Style or the MLA guidelines.
sInput
- the input stringprotected static java.lang.String resolveEnglishToken(TitleFormatter.EnglishLocaleContext lctx, java.lang.String sToken, boolean bForce)
lctx
- contextual information about English-speaking localessToken
- the input tokenbForce
- specifies that capitalization should be forced