public abstract class DateTimeTextProvider
extends java.lang.Object
This class has been made pubilc primarily for the benefit of Android.
| Constructor | Description |
|---|---|
DateTimeTextProvider() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract java.lang.String |
getText(TemporalField field,
long value,
TextStyle style,
java.util.Locale locale) |
Gets the text for the specified field, locale and style
for the purpose of printing.
|
abstract java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Long>> |
getTextIterator(TemporalField field,
TextStyle style,
java.util.Locale locale) |
Gets an iterator of text to field for the specified field, locale and style
for the purpose of parsing.
|
static void |
setInitializer(DateTimeTextProvider provider) |
Sets the provider to use.
|
public static void setInitializer(DateTimeTextProvider provider)
This can only be invoked before DateTimeTextProvider class is used for formatting/parsing.
Invoking this method at a later point will throw an exception.
provider - the provider to usejava.lang.IllegalStateException - if initialization has already occurred or another provider has been setpublic abstract java.lang.String getText(TemporalField field, long value, TextStyle style, java.util.Locale locale)
The text associated with the value is returned. The null return value should be used if there is no applicable text, or if the text would be a numeric representation of the value.
field - the field to get text for, not nullvalue - the field value to get text for, not nullstyle - the style to get text for, not nulllocale - the locale to get text for, not nullpublic abstract java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Long>> getTextIterator(TemporalField field, TextStyle style, java.util.Locale locale)
The iterator must be returned in order from the longest text to the shortest.
The null return value should be used if there is no applicable parsable text, or if the text would be a numeric representation of the value. Text can only be parsed if all the values for that field-style-locale combination are unique.
field - the field to get text for, not nullstyle - the style to get text for, null for all parsable textlocale - the locale to get text for, not nullCopyright © 2007–2018 ThreeTen.org. All rights reserved.