Class SimpleDateTimeTextProvider.LocaleStore

java.lang.Object
org.threeten.bp.format.SimpleDateTimeTextProvider.LocaleStore
Enclosing class:
SimpleDateTimeTextProvider

static final class SimpleDateTimeTextProvider.LocaleStore extends Object
Stores 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 Details

  • Constructor Details

    • LocaleStore

      LocaleStore(Map<TextStyle,Map<Long,String>> valueTextMap)
      Constructor.
      Parameters:
      valueTextMap - the map of values to text to store, assigned and not altered, not null
  • Method Details

    • getText

      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 null
      style - the style to get text for, not null
      Returns:
      the text for the field value, null if no text found
    • getTextIterator

      Iterator<Map.Entry<String,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