private TextAccessor accessor( Locale language, TextWidth textWidth, OutputContext outputContext ) { return CalendarText.getIsoInstance(language).getMeridiems(textWidth, outputContext); }
private static <T extends ChronoEntity<T>, P extends ChronoPattern<P>> TemporalFormatter<T> createFormatter( Class<T> chronoType, FormatEngine<P> formatEngine, String formatPattern, Locale locale ) { return formatEngine.create(chronoType, formatPattern, formatEngine.getDefaultPatternType(), locale); }
@Override void print( TimeSpan<? super U> duration, Appendable buffer ) throws IOException { this.numItem.print(duration, buffer); this.sepItem.print(duration, buffer); PluralCategory category = this.rules.getCategory(this.numItem.getAmount(duration)); buffer.append(this.pluralForms.get(category)); }
@Override public String getDatePattern( DisplayMode mode, Locale locale ) { if (this.delegate == null) { int style = getFormatStyle(mode); DateFormat df = DateFormat.getDateInstance(style, locale); return getFormatPattern(df); } return this.delegate.getDatePattern(mode, locale); }
@Override public String getFormatPattern( DisplayStyle style, Locale locale ) { DisplayMode mode = DisplayMode.ofStyle(style.getStyleValue()); return CalendarText.patternForTime(mode, locale); }
@Override public String getFormatPattern( DisplayStyle style, Locale locale ) { DisplayMode mode = DisplayMode.ofStyle(style.getStyleValue()); return CalendarText.patternForTimestamp(mode, mode, locale); }
@Override public String getFormatPattern( DisplayStyle style, Locale locale ) { DisplayMode mode = DisplayMode.ofStyle(style.getStyleValue()); return CalendarText.patternForMoment(mode, mode, locale); }
@Override public String getFormatPattern( DisplayStyle style, Locale locale ) { DisplayMode mode = DisplayMode.ofStyle(style.getStyleValue()); return CalendarText.patternForDate(mode, locale); }
@Override FormatItem<U> update(int reserved) { return new PluralItem<>( reserved, this.numItem, this.sepItem, this.rules, this.pluralForms, this.minWidth); }
@Override boolean isZero(TimeSpan<? super U> duration) { for (FormatItem<U> item : this.items) { if (!item.isZero(duration)) { return false; } } return true; }
private static String lookup( Locale language, TextWidth width, int size ) { try { return PROVIDER.getListPattern(language, width, size); } catch (MissingResourceException mre) { // should not happen return FALLBACK.getListPattern(language, width, size); } }
@Override boolean isZero(TimeSpan<? super U> duration) { return (this.getAmount(duration) == 0); }
@Override FormatItem<U> update(int reserved) { return new FractionItem<>(reserved, this.width, this.nanosecond); }
@Override FormatItem<U> update(int reserved) { return new LiteralItem<>(reserved, this.literal); }
@Override boolean isZero(TimeSpan<? super U> duration) { return this.numItem.isZero(duration); }
@Override FormatItem<U> update(int reserved) { return new NumberItem<>(reserved, this.minWidth, this.maxWidth, this.unit); }
@Override FormatItem<U> update(int reserved) { return new SeparatorItem<>(reserved, this.separator, this.alt); }
@Override FormatItem<U> update(int reserved) { return new SignItem<>(reserved, this.always); }
/** * <p>Creates a new unmodifiable collection of format attributes. </p> * * @return new instance of {@code Attributes} */ /*[deutsch] * <p>Erzeugt eine neue unveränderliche Instanz der * Formatattribute. </p> * * @return new instance of {@code Attributes} */ public Attributes build() { return new Attributes(this.attributes); }