Package org.threeten.bp.format
Class SimpleDateTimeTextProvider.LocaleStore
- java.lang.Object
-
- org.threeten.bp.format.SimpleDateTimeTextProvider.LocaleStore
-
- Enclosing class:
- SimpleDateTimeTextProvider
static final class SimpleDateTimeTextProvider.LocaleStore extends java.lang.ObjectStores the text for a single locale.Some fields have a textual representation, such as day-of-week or month-of-year. These textual representations can be captured in this class for printing and parsing.
This class is immutable and thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<TextStyle,java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Long>>>parsableParsable data.private java.util.Map<TextStyle,java.util.Map<java.lang.Long,java.lang.String>>valueTextMapMap of value to text.
-
Constructor Summary
Constructors Constructor Description LocaleStore(java.util.Map<TextStyle,java.util.Map<java.lang.Long,java.lang.String>> valueTextMap)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.StringgetText(long value, TextStyle style)Gets the text for the specified field value, locale and style for the purpose of printing.(package private) java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Long>>getTextIterator(TextStyle style)Gets an iterator of text to field for the specified style for the purpose of parsing.
-
-
-
Constructor Detail
-
LocaleStore
LocaleStore(java.util.Map<TextStyle,java.util.Map<java.lang.Long,java.lang.String>> valueTextMap)
Constructor.- Parameters:
valueTextMap- the map of values to text to store, assigned and not altered, not null
-
-
Method Detail
-
getText
java.lang.String getText(long value, TextStyle style)Gets the text for the specified field value, locale and style for the purpose of printing.- Parameters:
value- the value to get text for, not nullstyle- the style to get text for, not null- Returns:
- the text for the field value, null if no text found
-
getTextIterator
java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Long>> getTextIterator(TextStyle style)
Gets an iterator of text to field for the specified style for the purpose of parsing.The iterator must be returned in order from the longest text to the shortest.
- Parameters:
style- the style to get text for, null for all parsable text- Returns:
- the iterator of text to field pairs, in order from longest text to shortest text, null if the style is not parsable
-
-