Home
last modified time | relevance | path

Searched refs:formatter (Results 1 – 25 of 47) sorted by relevance

12

/libcore/luni/src/test/java/libcore/java/time/format/
DDateTimeFormatterBuilderTest.java44 DateTimeFormatter formatter = new DateTimeFormatterBuilder() in test_append_DateTimeFormatter() local
47 assertEquals("<2000-12-31>", formatter.format(LocalDate.of(2000, Month.DECEMBER, 31))); in test_append_DateTimeFormatter()
52 DateTimeFormatter formatter = in test_appendZoneRegionId_format() local
56 formatter.format(ZonedDateTime.now(ZoneId.of("Europe/London")))); in test_appendZoneRegionId_format()
58 formatter.format(ZonedDateTime.now(ZoneId.of("UTC")))); in test_appendZoneRegionId_format()
63 DateTimeFormatter formatter = in test_appendZoneRegionId_format_offset() local
67 formatter.format(OffsetDateTime.now(ZoneOffset.UTC)); in test_appendZoneRegionId_format_offset()
75 DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendZoneRegionId() in test_appendZoneRegionId_parse() local
79 formatter.parse("Europe/London").query(TemporalQueries.zoneId())); in test_appendZoneRegionId_parse()
81 formatter.parse("UTC").query(TemporalQueries.zoneId())); in test_appendZoneRegionId_parse()
[all …]
DDateTimeFormatterTest.java51 for (DateTimeFormatter formatter : formatters) { in test_getDecimalStyle()
53 assertEquals(formatter.toString(), DecimalStyle.STANDARD, formatter.getDecimalStyle()); in test_getDecimalStyle()
55 DateTimeFormatter arStyleFormatter = formatter.withDecimalStyle(arDecimalStyle); in test_getDecimalStyle()
60 assertEquals(formatter.toString(), DecimalStyle.STANDARD, formatter.getDecimalStyle()); in test_getDecimalStyle()
/libcore/luni/src/test/java/libcore/java/util/logging/
DOldXMLFormatterTest.java29 XMLFormatter formatter = null; field in OldXMLFormatterTest
35 formatter = new XMLFormatter(); in setUp()
43 String result = formatter.getHead(handler); in testXMLFormatter()
55 assertTrue("Tail string position should be more zero", formatter in testXMLFormatter()
61 "</log>", formatter.getTail(null).trim()); in testGetTail()
63 formatter.getTail(handler).trim()); in testGetTail()
66 "</log>", formatter.getTail(handler).trim()); in testGetTail()
DOldFileHandlerTest.java341 Formatter formatter) throws Exception { in assertFileContent() argument
342 assertFileContent(homepath, filename, new LogRecord[] { r }, formatter); in assertFileContent()
346 LogRecord[] lr, Formatter formatter) throws Exception { in assertFileContent() argument
351 if (null != formatter) { in assertFileContent()
353 sb.append(formatter.getHead(handler)); in assertFileContent()
361 sb.append(formatter.getTail(handler)); in assertFileContent()
362 sb.append(formatter.getHead(handler)); in assertFileContent()
364 sb.append(formatter.format(lr[i])); in assertFileContent()
367 sb.append(formatter.getTail(handler)); in assertFileContent()
/libcore/luni/src/main/java/libcore/icu/
DDateTimeFormat.java48 DateFormat formatter = CACHED_FORMATTERS.get(key); in format() local
49 if (formatter == null) { in format()
51 formatter = new SimpleDateFormat(generator.getBestPattern(skeleton), icuLocale); in format()
52 CACHED_FORMATTERS.put(key, formatter); in format()
54 formatter.setContext(displayContext); in format()
55 return formatter.format(time); in format()
DDateIntervalFormat.java92 android.icu.text.DateIntervalFormat formatter = in formatDateRange() local
94 return formatter.format(startCalendar, endCalendar, new StringBuffer(), in formatDateRange()
102 android.icu.text.DateIntervalFormat formatter = CACHED_FORMATTERS.get(key); in getFormatter() local
103 if (formatter != null) { in getFormatter()
104 return formatter; in getFormatter()
106 formatter = android.icu.text.DateIntervalFormat.getInstance(skeleton, locale); in getFormatter()
107 formatter.setTimeZone(icuTimeZone); in getFormatter()
108 CACHED_FORMATTERS.put(key, formatter); in getFormatter()
109 return formatter; in getFormatter()
DRelativeDateTimeFormatter.java225 android.icu.text.RelativeDateTimeFormatter formatter = in getRelativeTimeSpanString() local
228 return formatter.format(count, direction, unit); in getRelativeTimeSpanString()
230 return formatter.format(direction, aunit); in getRelativeTimeSpanString()
346 android.icu.text.RelativeDateTimeFormatter formatter = CACHED_FORMATTERS.get(key); in getFormatter() local
347 if (formatter == null) { in getFormatter()
348 formatter = android.icu.text.RelativeDateTimeFormatter.getInstance( in getFormatter()
350 CACHED_FORMATTERS.put(key, formatter); in getFormatter()
352 return formatter; in getFormatter()
/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestDateTimeParsing.java137 …public void test_parse_instantZones_ZDT(DateTimeFormatter formatter, String text, ZonedDateTime ex… in test_parse_instantZones_ZDT() argument
138 TemporalAccessor actual = formatter.parse(text); in test_parse_instantZones_ZDT()
143 …public void test_parse_instantZones_LDT(DateTimeFormatter formatter, String text, ZonedDateTime ex… in test_parse_instantZones_LDT() argument
144 TemporalAccessor actual = formatter.parse(text); in test_parse_instantZones_LDT()
149 …public void test_parse_instantZones_Instant(DateTimeFormatter formatter, String text, ZonedDateTim… in test_parse_instantZones_Instant() argument
150 TemporalAccessor actual = formatter.parse(text); in test_parse_instantZones_Instant()
155 …public void test_parse_instantZones_supported(DateTimeFormatter formatter, String text, ZonedDateT… in test_parse_instantZones_supported() argument
156 TemporalAccessor actual = formatter.parse(text); in test_parse_instantZones_supported()
176 …public void test_parse_instantNoZone_ZDT(DateTimeFormatter formatter, String text, Instant expecte… in test_parse_instantNoZone_ZDT() argument
177 TemporalAccessor actual = formatter.parse(text); in test_parse_instantNoZone_ZDT()
[all …]
/libcore/ojluni/src/main/java/java/time/format/
DDateTimePrintContext.java105 private DateTimeFormatter formatter; field in DateTimePrintContext
117 DateTimePrintContext(TemporalAccessor temporal, DateTimeFormatter formatter) { in DateTimePrintContext() argument
119 this.temporal = adjust(temporal, formatter); in DateTimePrintContext()
120 this.formatter = formatter; in DateTimePrintContext()
123 …vate static TemporalAccessor adjust(final TemporalAccessor temporal, DateTimeFormatter formatter) { in adjust() argument
125 Chronology overrideChrono = formatter.getChronology(); in adjust()
126 ZoneId overrideZone = formatter.getZone(); in adjust()
243 return formatter.getLocale();
254 return formatter.getDecimalStyle();
DDateTimeParseContext.java97 private DateTimeFormatter formatter; field in DateTimeParseContext
120 DateTimeParseContext(DateTimeFormatter formatter) { in DateTimeParseContext() argument
122 this.formatter = formatter; in DateTimeParseContext()
131 DateTimeParseContext newContext = new DateTimeParseContext(formatter); in copy()
147 return formatter.getLocale(); in getLocale()
158 return formatter.getDecimalStyle(); in getDecimalStyle()
169 chrono = formatter.getChronology(); in getEffectiveChronology()
330 parsed.zone = (parsed.zone != null ? parsed.zone : formatter.getZone()); in toResolved()
DDateTimeFormatter.java2094 private final DateTimeFormatter formatter; field in DateTimeFormatter.ClassicFormat
2098 public ClassicFormat(DateTimeFormatter formatter, TemporalQuery<?> parseType) { in ClassicFormat() argument
2099 this.formatter = formatter; in ClassicFormat()
2114 formatter.formatTo((TemporalAccessor) obj, toAppendTo); in format()
2125 return formatter.parseResolved0(text, null); in parseObject()
2127 return formatter.parse(text, parseType); in parseObject()
2139 context = formatter.parseUnresolved0(text, pos); in parseObject()
2153 … TemporalAccessor resolved = context.toResolved(formatter.resolverStyle, formatter.resolverFields); in parseObject()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKResolverStyle.java123 DateTimeFormatter formatter = builder.appendOptional(optionalFormatter).toFormatter(); in test_resolverStyle() local
124 formatter = formatter.withResolverStyle(style); in test_resolverStyle()
126 TemporalAccessor accessor = formatter.parse(str); in test_resolverStyle()
132 formatter.parse(str); in test_resolverStyle()
DTCKSignStyle.java121 DateTimeFormatter formatter = builder.appendValue(ChronoField.YEAR, 2, 4, style) in test_signStyle() local
123 formatter = formatter.withZone(ZoneOffset.UTC); in test_signStyle()
125 String output = formatter.format(localDate); in test_signStyle()
129 formatter.format(localDate); in test_signStyle()
DTCKFormatStyle.java112 …DateTimeFormatter formatter = builder.appendLocalized(style, style).appendLiteral(" ").appendZoneO… in test_formatStyle() local
114 formatter = formatter.withLocale(Locale.UK); in test_formatStyle()
115 assertEquals(formatter.format(temporal), formattedStr); in test_formatStyle()
/libcore/ojluni/src/main/java/java/io/
DPrintWriter.java68 private Formatter formatter; field in PrintWriter
902 if ((formatter == null) in format()
903 || (formatter.locale() != Locale.getDefault())) in format()
904 formatter = new Formatter(this); in format()
905 formatter.format(Locale.getDefault(), format, args); in format()
962 if ((formatter == null) || (formatter.locale() != l)) in format()
963 formatter = new Formatter(this, l); in format()
964 formatter.format(l, format, args); in format()
DPrintStream.java64 private Formatter formatter; field in PrintStream
996 if ((formatter == null) in format()
997 || (formatter.locale() != Locale.getDefault())) in format()
998 formatter = new Formatter((Appendable) this); in format()
999 formatter.format(Locale.getDefault(), format, args); in format()
1053 if ((formatter == null) in format()
1054 || (formatter.locale() != l)) in format()
1055 formatter = new Formatter(this, l); in format()
1056 formatter.format(l, format, args); in format()
/libcore/ojluni/src/main/java/java/util/logging/
DHandler.java60 private volatile Formatter formatter; field in Handler
125 formatter = newFormatter; in setFormatter()
133 return formatter; in getFormatter()
DStreamHandler.java118 public StreamHandler(OutputStream out, Formatter formatter) { in StreamHandler() argument
121 setFormatter(formatter); in StreamHandler()
/libcore/ojluni/src/main/java/java/time/
DMonthDay.java301 public static MonthDay parse(CharSequence text, DateTimeFormatter formatter) { in parse() argument
302 Objects.requireNonNull(formatter, "formatter"); in parse()
303 return formatter.parse(text, MonthDay::from); in parse()
638 public String format(DateTimeFormatter formatter) { in format() argument
639 Objects.requireNonNull(formatter, "formatter"); in format()
640 return formatter.format(this); in format()
DYear.java284 public static Year parse(CharSequence text, DateTimeFormatter formatter) { in parse() argument
285 Objects.requireNonNull(formatter, "formatter"); in parse()
286 return formatter.parse(text, Year::from); in parse()
932 public String format(DateTimeFormatter formatter) { in format() argument
933 Objects.requireNonNull(formatter, "formatter"); in format()
934 return formatter.format(this); in format()
DYearMonth.java287 public static YearMonth parse(CharSequence text, DateTimeFormatter formatter) { in parse() argument
288 Objects.requireNonNull(formatter, "formatter"); in parse()
289 return formatter.parse(text, YearMonth::from); in parse()
1065 public String format(DateTimeFormatter formatter) { in format() argument
1066 Objects.requireNonNull(formatter, "formatter"); in format()
1067 return formatter.format(this); in format()
/libcore/luni/src/test/java/libcore/java/util/
DOldFormatterTest.java32 …public void formatTo(Formatter formatter, int flags, int width, int precision) throws IllegalForma… in test_Formattable()
34 formatter.out().append("111"); in test_Formattable()
41 …public void formatTo(Formatter formatter, int flags, int width, int precision) throws IllegalForma… in test_Formattable()
43 formatter.out().append("222"); in test_Formattable()
/libcore/ojluni/src/main/java/java/util/
DFormattable.java163 void formatTo(Formatter formatter, int flags, int width, int precision); in formatTo() argument
/libcore/ojluni/src/main/java/java/time/chrono/
DChronoLocalDate.java637 default String format(DateTimeFormatter formatter) { in format() argument
638 Objects.requireNonNull(formatter, "formatter"); in format()
639 return formatter.format(this); in format()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DFormatterTest.java80 public void formatTo(Formatter formatter, int flags, int width, in formatTo() argument
83 formatter.format("CUSTOMIZED FORMAT FUNCTION" + " WIDTH: " in formatTo()
86 formatter.format("customized format function" + " width: " in formatTo()
737 Formatter formatter = new Formatter(Locale.US); in test_formatLjava_lang_String$Ljava_lang_Object_ArgIndex() local
738 formatter.format("%1$s%2$s%3$s%4$s%5$s%6$s%7$s%8$s%9$s%11$s%10$s", "1", in test_formatLjava_lang_String$Ljava_lang_Object_ArgIndex()
740 assertEquals("1234567891110", formatter.toString()); in test_formatLjava_lang_String$Ljava_lang_Object_ArgIndex()
742 formatter = new Formatter(Locale.JAPAN); in test_formatLjava_lang_String$Ljava_lang_Object_ArgIndex()
743 formatter.format("%0$s", "hello"); in test_formatLjava_lang_String$Ljava_lang_Object_ArgIndex()
744 assertEquals("hello", formatter.toString()); in test_formatLjava_lang_String$Ljava_lang_Object_ArgIndex()
747 formatter = new Formatter(Locale.US); in test_formatLjava_lang_String$Ljava_lang_Object_ArgIndex()
[all …]

12