Home
last modified time | relevance | path

Searched refs:df (Results 1 – 24 of 24) sorted by relevance

/libcore/luni/src/test/java/libcore/java/text/
DDecimalFormatTest.java37 DecimalFormat df = new DecimalFormat("0E0"); in test_exponentSeparator() local
38 assertEquals("1E4", df.format(12345.)); in test_exponentSeparator()
40 DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); in test_exponentSeparator()
42 df.setDecimalFormatSymbols(dfs); in test_exponentSeparator()
43 assertEquals("1-useless-api-4", df.format(12345.)); in test_exponentSeparator()
47 DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(Locale.US); in test_setMaximumFractionDigitsAffectsRoundingMode() local
48 df.setMaximumFractionDigits(0); in test_setMaximumFractionDigitsAffectsRoundingMode()
49 df.setRoundingMode(RoundingMode.HALF_UP); in test_setMaximumFractionDigitsAffectsRoundingMode()
50 assertEquals("-0", df.format(-0.2)); in test_setMaximumFractionDigitsAffectsRoundingMode()
51 df.setMaximumFractionDigits(1); in test_setMaximumFractionDigitsAffectsRoundingMode()
[all …]
DDateFormatTest.java73 DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT, locale); in testGetTimeInstance_withLocaleExtension() local
74 assertEquals("America/Denver", df.getCalendar().getTimeZone().getID()); in testGetTimeInstance_withLocaleExtension()
94 DateFormat df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, in assertParse_lenient_en() local
96 df.setTimeZone(TimeZone.getTimeZone("GMT")); in assertParse_lenient_en()
97 Date date = df.parse(input); in assertParse_lenient_en()
113 DateFormat df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, in assertFormat_forBug266731719() local
115 df.setTimeZone(TimeZone.getTimeZone("GMT")); in assertFormat_forBug266731719()
116 String formatted = df.format(new Date(1672610148000L)); in assertFormat_forBug266731719()
DOldDateFormatTest.java173 DateFormat df = DateFormat.getInstance(); in test_isLenient() local
174 Calendar c = df.getCalendar(); in test_isLenient()
175 if (df.isLenient()) { in test_isLenient()
386 DateFormat df = DateFormat.getInstance(); in test_parseObjectLjava_lang_StringLjava_text_ParsePosition() local
392 Date result = (Date) df.parseObject(df.format(current), pp); in test_parseObjectLjava_lang_StringLjava_text_ParsePosition()
406 char[] cur = df.format(current).toCharArray(); in test_parseObjectLjava_lang_StringLjava_text_ParsePosition()
409 result = (Date) df.parseObject(partialCorrect, pp); in test_parseObjectLjava_lang_StringLjava_text_ParsePosition()
416 char[] curDate = df.format(current).toCharArray(); in test_parseObjectLjava_lang_StringLjava_text_ParsePosition()
421 result = (Date) df.parseObject(new String(newArray), pp); in test_parseObjectLjava_lang_StringLjava_text_ParsePosition()
433 df.parseObject(df.format(current), null); in test_parseObjectLjava_lang_StringLjava_text_ParsePosition()
[all …]
DSimpleDateFormatTest.java463 DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, new Locale("sl")); in test_sl_dates() local
464 assertEquals(TimeZone.getDefault(), df.getTimeZone()); in test_sl_dates()
465 df.setTimeZone(UTC); in test_sl_dates()
466 assertEquals("1. 1. 70", df.format(0L)); in test_sl_dates()
499 SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy HH:mm:ss zzz"); in testTimeZoneNotChangedByParse() local
500 df.setTimeZone(UTC); in testTimeZoneNotChangedByParse()
501 df.parse("22 Jul 1977 12:23:45 HST"); in testTimeZoneNotChangedByParse()
502 assertEquals(UTC, df.getTimeZone()); in testTimeZoneNotChangedByParse()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DDecimalFormatTest.java49 DecimalFormat df = new DecimalFormat(); in test_setNan_emptyString() local
50 df.setDecimalFormatSymbols(dfs); in test_setNan_emptyString()
51 df.format(Double.NaN); in test_setNan_emptyString()
340 DecimalFormat df = new DecimalFormat(); in test_parse_returnType() local
342 Number nb = df.parse("" + Long.MIN_VALUE, pos); in test_parse_returnType()
348 df = new DecimalFormat(); in test_parse_returnType()
350 nb = df.parse("" + Long.MAX_VALUE, pos); in test_parse_returnType()
357 df = new DecimalFormat(); in test_parse_returnType()
359 nb = df.parse("invalid", pos); in test_parse_returnType()
659 DecimalFormat df = new DecimalFormat(); in test_getNegativePrefix() local
[all …]
DParseExceptionTest.java32 DateFormat df = DateFormat.getInstance(); in test_ConstructorLjava_lang_StringI() local
33 df.parse("HelloWorld"); in test_ConstructorLjava_lang_StringI()
45 DateFormat df = DateFormat.getInstance(); in test_getErrorOffset() local
46 df.parse("1999HelloWorld"); in test_getErrorOffset()
DSimpleDateFormatTest.java215 SimpleDateFormat df = new SimpleDateFormat(); in test_equals_afterFormat() local
216 df.format(new Date()); in test_equals_afterFormat()
217 assertEquals(df, new SimpleDateFormat()); in test_equals_afterFormat()
518 SimpleDateFormat df = (SimpleDateFormat) DateFormat.getInstance(); in test_getDateFormatSymbols() local
519 DateFormatSymbols dfs = df.getDateFormatSymbols(); in test_getDateFormatSymbols()
520 assertTrue("Symbols identical", dfs != df.getDateFormatSymbols()); in test_getDateFormatSymbols()
787 SimpleDateFormat df = new SimpleDateFormat(pattern, new Locale("en", "US")); in assertParse() local
788 df.setTimeZone(TimeZone.getTimeZone("EST")); in assertParse()
789 Date date = df.parse(input); in assertParse()
794 SimpleDateFormat df = new SimpleDateFormat(pattern, new Locale("en", "US")); in assertFormat() local
[all …]
/libcore/ojluni/src/test/java/text/Format/NumberFormat/
DBigDecimalParse.java110 DecimalFormat df; field in BigDecimalParse
116 df = new DecimalFormat(); in test_Parse_in_DecimalFormat_BigDecimal()
117 df.setParseBigDecimal(true); in test_Parse_in_DecimalFormat_BigDecimal()
158 df = new DecimalFormat(); in test_Parse_in_DecimalFormat_BigDecimal_usingMultiplier()
159 df.setParseBigDecimal(true); in test_Parse_in_DecimalFormat_BigDecimal_usingMultiplier()
163 df.setMultiplier(250000000); in test_Parse_in_DecimalFormat_BigDecimal_usingMultiplier()
174 df.setMultiplier(-250000000); in test_Parse_in_DecimalFormat_BigDecimal_usingMultiplier()
186 df.setMultiplier(3); in test_Parse_in_DecimalFormat_BigDecimal_usingMultiplier()
192 df.setMultiplier(33); in test_Parse_in_DecimalFormat_BigDecimal_usingMultiplier()
200 df = new DecimalFormat(); in test_Parse_in_DecimalFormat_BigDecimal_DivisionByZero()
[all …]
/libcore/ojluni/src/test/java/text/Format/DecimalFormat/
DSetGroupingSizeTest.java65 DecimalFormat df = new DecimalFormat(); in test_validGroupingSize() local
66 df.setGroupingSize(newVal); in test_validGroupingSize()
67 assertEquals(df.getGroupingSize(), newVal); in test_validGroupingSize()
73 DecimalFormat df = new DecimalFormat(); in test_invalidGroupingSize() local
74 df.setGroupingSize(newVal); in test_invalidGroupingSize()
/libcore/benchmarks/src/benchmarks/regression/
DExpensiveObjectsBenchmark.java34 DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT); in timeNewDateFormatTimeInstance() local
35 df.format(System.currentTimeMillis()); in timeNewDateFormatTimeInstance()
40 DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT); in timeClonedDateFormatTimeInstance() local
42 ((DateFormat) df.clone()).format(System.currentTimeMillis()); in timeClonedDateFormatTimeInstance()
47 DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT); in timeReusedDateFormatTimeInstance() local
49 synchronized (df) { in timeReusedDateFormatTimeInstance()
50 df.format(System.currentTimeMillis()); in timeReusedDateFormatTimeInstance()
DDecimalFormatBenchmark.java12 private static final DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(); field in DecimalFormatBenchmark
30 df.setGroupingSize(3); in formatWithGrouping()
31 df.setGroupingUsed(true); in formatWithGrouping()
33 df.format(obj); in formatWithGrouping()
46 df.format(obj); in format()
52 df.formatToCharacterIterator(obj); in formatToCharacterIterator()
/libcore/luni/src/test/java/libcore/highmemorytest/java/text/
DDecimalFormatTest.java59 DecimalFormat df = new DecimalFormat(pattern, dfs); in assertCurrencyFormat() local
60 df.setCurrency(currency); in assertCurrencyFormat()
61 df.setMaximumFractionDigits(0); in assertCurrencyFormat()
63 expected, df.format(0)); in assertCurrencyFormat()
/libcore/luni/src/main/java/libcore/icu/
DDecimalFormatData.java76 DecimalFormat df = (DecimalFormat) NumberFormat.getInstance( in DecimalFormatData() local
78 numberPattern = df.toPattern(); in DecimalFormatData()
80 df = (DecimalFormat) NumberFormat.getInstance(locale, NumberFormat.CURRENCYSTYLE); in DecimalFormatData()
81 currencyPattern = df.toPattern(); in DecimalFormatData()
83 df = (DecimalFormat) NumberFormat.getInstance(locale, NumberFormat.PERCENTSTYLE); in DecimalFormatData()
84 percentPattern = df.toPattern(); in DecimalFormatData()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKLocalizedFieldParser.java225 DateTimeFormatter df = new DateTimeFormatterBuilder() in test_adjacentValuePatterns1() local
228 TemporalAccessor parsed = df.parseUnresolved(text, ppos); in test_adjacentValuePatterns1()
248 DateTimeFormatter df = new DateTimeFormatterBuilder() in test_adjacentValuePatterns2() local
251 TemporalAccessor parsed = df.parseUnresolved(text, ppos); in test_adjacentValuePatterns2()
261 DateTimeFormatter df = new DateTimeFormatterBuilder() in test_adjacentValuePatterns3() local
264 TemporalAccessor parsed = df.parseUnresolved(text, ppos); in test_adjacentValuePatterns3()
267 LocalDate result = LocalDate.parse(text, df); in test_adjacentValuePatterns3()
DTCKDateTimeFormatterBuilder.java597 DateTimeFormatter df = DateTimeFormatter.ofPattern(pattern, Locale.US); in test_appendZoneText_formatGenericTimeZonePatterns() local
598 assertEquals(zdt.format(df), expected); in test_appendZoneText_formatGenericTimeZonePatterns()
617 …DateTimeFormatter df = new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter(Locale.US… in test_appendZoneText_parseGenericTimeZonePatterns() local
618 ZonedDateTime expected = ZonedDateTime.parse(input, df); in test_appendZoneText_parseGenericTimeZonePatterns()
644 …DateTimeFormatter df = new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter(Locale.US… in test_appendZoneText_parseNonGenricTimeZonePatterns_1() local
646 String actual = df.format(zdt); in test_appendZoneText_parseNonGenricTimeZonePatterns_1()
671 DateTimeFormatter df = DateTimeFormatter.ofPattern(pattern, Locale.US).withZone(zId); in test_appendZoneText_parseNonGenricTimeZonePatterns_2() local
672 String actual = df.format(ldt); in test_appendZoneText_parseNonGenricTimeZonePatterns_2()
1011 DateTimeFormatter df = new DateTimeFormatterBuilder().appendPattern("g").toFormatter(); in test_modJulianFieldValues() local
1012 assertEquals(LocalDate.of(y, m, d).format(df), expected); in test_modJulianFieldValues()
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestReducedParser.java414 DateTimeFormatter df in test_reducedWithChronoYear() local
419 String input = df.format(date); in test_reducedWithChronoYear()
422 TemporalAccessor parsed = df.parseUnresolved(input, pos); in test_reducedWithChronoYear()
432 DateTimeFormatter df in test_reducedWithChronoYearOfEra() local
437 String input = df.format(date); in test_reducedWithChronoYearOfEra()
440 TemporalAccessor parsed = df.parseUnresolved(input, pos); in test_reducedWithChronoYearOfEra()
451 DateTimeFormatter df in test_reducedWithLateChronoChange() local
458 String input = df.format(date); in test_reducedWithLateChronoChange()
461 TemporalAccessor parsed = df.parseUnresolved(input, pos); in test_reducedWithLateChronoChange()
473 DateTimeFormatter df in test_reducedWithLateChronoChangeTwice() local
[all …]
/libcore/luni/src/test/java/libcore/libcore/icu/
DLocaleDataTest.java130 SimpleDateFormat df = new SimpleDateFormat("MMM", Locale.ROOT); in test_rootLocale_useRealRootLocaleData() local
131 df.setTimeZone(TimeZone.getTimeZone("GMT")); in test_rootLocale_useRealRootLocaleData()
132 assertEquals("M07", df.format(new Date(1594255915217L))); in test_rootLocale_useRealRootLocaleData()
143 SimpleDateFormat df = new SimpleDateFormat("MMM", Locale.ROOT); in test_rootLocale_notUseRealRootLocaleData() local
144 df.setTimeZone(TimeZone.getTimeZone("GMT")); in test_rootLocale_notUseRealRootLocaleData()
145 assertEquals("Jul", df.format(new Date(1594255915217L))); in test_rootLocale_notUseRealRootLocaleData()
/libcore/support/src/test/java/tests/support/
DSupport_TestWebServer.java737 SimpleDateFormat df = new SimpleDateFormat("EE, dd MMM yyyy HH:mm:ss z"); in printHeaders() local
738 df.setTimeZone(TimeZone.getTimeZone("GMT")); in printHeaders()
742 psPrint(ps, "Date: " + df.format(new Date())); in printHeaders()
775 + df.format(exp) + " GMT"); in printHeaders()
797 + df.format(exp) + " GMT"); in printHeaders()
/libcore/ojluni/src/main/java/java/text/
DMessageFormat.java567 DateFormat df = DateFormat.getDateInstance(DATE_TIME_MODIFIERS[index], in toPattern() local
569 if (fmt.equals(df)) { in toPattern()
573 df = DateFormat.getTimeInstance(DATE_TIME_MODIFIERS[index], in toPattern()
575 if (fmt.equals(df)) { in toPattern()
/libcore/ojluni/src/main/java/java/util/
DScanner.java1283 DecimalFormat df = null; in useLocale() local
1307 df = (DecimalFormat) nf; in useLocale()
1318 positivePrefix = df.getPositivePrefix(); in useLocale()
1321 negativePrefix = df.getNegativePrefix(); in useLocale()
1324 positiveSuffix = df.getPositiveSuffix(); in useLocale()
1327 negativeSuffix = df.getNegativeSuffix(); in useLocale()
DFormatter.java4690 DecimalFormat df = (DecimalFormat) NumberFormat.getIntegerInstance(l);
4691 grpSize = df.getGroupingSize();
4693 if (!df.isGroupingUsed() || grpSize == 0) {
/libcore/dalvik/src/main/java/dalvik/system/
DDexFile.java364 DFEnum(DexFile df) { in DFEnum() argument
366 mNameList = getClassNameList(df.mCookie); in DFEnum()
/libcore/ojluni/src/main/java/sun/net/ftp/impl/
DFtpClient.java109 private DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, java.util.Locale.US); field in FtpClient
257 d = df.parse(fdate); in parseLine()
294 private SimpleDateFormat df = new SimpleDateFormat("yyyyMMddhhmmss"); field in FtpClient.MLSxParser
332 d = df.parse(s); in parseLine()
343 d = df.parse(s); in parseLine()
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
DTestUmmAlQuraChronology.java468 …DateTimeFormatter df = DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG).withChronology(Chronolo… in test_formatterOfLocalizedDate() local
469 assertEquals(df.format(hdt), expected); in test_formatterOfLocalizedDate()