/libcore/ojluni/src/test/java/text/Format/MessageFormat/ |
D | MessageRegression.java | 120 …MessageFormat fmt = new MessageFormat("{0,choice,0#no files|1#one file|1< {0,number,integer} files… in Test4058973() local 121 String pat = fmt.toPattern(); in Test4058973() 184 MessageFormat fmt = new MessageFormat("There are {0} apples growing on the {1} tree."); in Test4052223() local 186 Object[] objs = fmt.parse(str, pos); in Test4052223() 396 ChoiceFormat fmt = new ChoiceFormat( in Test4106661() local 398 logln("Formatter Pattern : " + fmt.toPattern()); in Test4106661() 400 logln("Format with -INF : " + fmt.format(Double.NEGATIVE_INFINITY)); in Test4106661() 401 logln("Format with -1.0 : " + fmt.format(-1.0)); in Test4106661() 402 logln("Format with 0 : " + fmt.format(0)); in Test4106661() 403 logln("Format with 0.9 : " + fmt.format(0.9)); in Test4106661() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ |
D | ChoiceFormatTest.java | 404 ChoiceFormat fmt = new ChoiceFormat( in test_formatL() local 407 assertEquals("NEGATIVE_ONE", fmt.format(Long.MIN_VALUE)); in test_formatL() 408 assertEquals("NEGATIVE_ONE", fmt.format(-1)); in test_formatL() 409 assertEquals("ZERO", fmt.format(0)); in test_formatL() 410 assertEquals("ONE", fmt.format(1)); in test_formatL() 411 assertEquals("GREATER_THAN_ONE", fmt.format(Long.MAX_VALUE)); in test_formatL() 418 ChoiceFormat fmt = new ChoiceFormat( in test_formatD() local 420 assertEquals("NEGATIVE_ONE", fmt.format(Double.NEGATIVE_INFINITY)); in test_formatD() 421 assertEquals("NEGATIVE_ONE", fmt.format(-999999999D)); in test_formatD() 422 assertEquals("NEGATIVE_ONE", fmt.format(-1.1)); in test_formatD() [all …]
|
/libcore/ojluni/src/test/java/time/tck/java/time/format/ |
D | TCKDateTimeFormatter.java | 125 private DateTimeFormatter fmt; field in TCKDateTimeFormatter 129 fmt = new DateTimeFormatterBuilder().appendLiteral("ONE") in setUp() 137 … DateTimeFormatter base = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_withLocale() 144 … DateTimeFormatter base = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_withLocale_null() 151 DateTimeFormatter test = fmt; in test_withChronology() 162 DateTimeFormatter test = fmt; in test_withZone() 403 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_format_TemporalAccessor_simple() 410 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_format_TemporalAccessor_noSuchField() 416 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_format_TemporalAccessor_null() 423 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_print_TemporalAppendable() [all …]
|
D | TCKDateTimeParseResolver.java | 1173 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_InstantSeconds() local 1175 TemporalAccessor acc = fmt.parse("86402"); in test_parse_fromField_InstantSeconds() 1190 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_InstantSeconds_NanoOfSecond() local 1192 TemporalAccessor acc = fmt.parse("86402.123456789"); in test_parse_fromField_InstantSeconds_NanoOfSecond() 1208 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_SecondOfDay() local 1210 TemporalAccessor acc = fmt.parse("864"); in test_parse_fromField_SecondOfDay() 1223 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_SecondOfDay_NanoOfSecond() local 1225 TemporalAccessor acc = fmt.parse("864.123456789"); in test_parse_fromField_SecondOfDay_NanoOfSecond() 1239 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_SecondOfMinute() local 1241 TemporalAccessor acc = fmt.parse("32"); in test_parse_fromField_SecondOfMinute() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | OldFormattableTest.java | 49 Formatter fmt = new Formatter(); in testFormatTo() local 52 assertTrue(fmt.format("%1.1s", mf).toString().equals("single precision ")); in testFormatTo() 53 assertTrue(fmt.format("%2.1s", mf).toString().equals("single precision single precision ")); in testFormatTo() 54 …assertTrue(fmt.format("%2.2s", mf).toString().equals("single precision single precision double pre… in testFormatTo()
|
/libcore/ojluni/src/test/java/text/Format/NumberFormat/ |
D | DFSExponential.java | 72 DecimalFormat fmt = new DecimalFormat(pat[p], sym); in DFSExponenTest() local 73 logln(" Pattern: " + fmt.toPattern()); in DFSExponenTest() 74 String locPattern = fmt.toLocalizedPattern(); in DFSExponenTest() 80 String s = fmt.format(val[v]); in DFSExponenTest()
|
D | PositionTest.java | 153 DecimalFormat fmt = (DecimalFormat) NumberFormat.getInstance(); in TestFieldPosition_example() local 154 fmt.setDecimalSeparatorAlwaysShown(true); in TestFieldPosition_example() 166 StringBuffer res = fmt.format(doubleNum[i], buf, pos); in TestFieldPosition_example()
|
/libcore/ojluni/src/test/java/time/tck/java/time/ |
D | AbstractTCKTest.java | 229 Formatter fmt = new Formatter(sb); in dumpSerialStream() local 230 fmt.format(" byte[] bytes = {" ); in dumpSerialStream() 234 fmt.format("%n "); in dumpSerialStream() 236 fmt.format(" %3d,", bytes[i] & 0xff); in dumpSerialStream() 238 fmt.format(" /*"); in dumpSerialStream() 242 fmt.format(" %c", bytes[s + j] & 0xff); in dumpSerialStream() 244 fmt.format(" */"); in dumpSerialStream() 247 fmt.format("%n };%n"); in dumpSerialStream()
|
/libcore/ojluni/src/main/java/java/io/ |
D | Console.java | 172 public Console format(String fmt, Object ...args) { in format() argument 173 formatter.format(fmt, args).flush(); in format() 247 public String readLine(String fmt, Object ... args) { in readLine() argument 251 if (!fmt.isEmpty()) in readLine() 252 pw.format(fmt, args); in readLine() 311 public char[] readPassword(String fmt, Object ... args) { in readPassword() argument 324 if (!fmt.isEmpty()) in readPassword() 325 pw.format(fmt, args); in readPassword()
|
/libcore/luni/src/test/java/libcore/java/text/ |
D | SimpleDateFormatTest.java | 207 private static long parseTimeUtc(String fmt, String value) { in parseTimeUtc() argument 208 return parseDateUtc(Locale.ENGLISH, fmt, value).getTime().getTime(); in parseTimeUtc() 227 private String formatDateUtc(Locale l, String fmt) { in formatDateUtc() argument 228 return formatDate(l, fmt, UTC); in formatDateUtc() 231 private String formatDate(Locale l, String fmt, TimeZone tz) { in formatDate() argument 232 DateFormat dateFormat = new SimpleDateFormat(fmt, l); in formatDate() 237 private static void assertCannotParse(Locale l, String fmt, String value) { in assertCannotParse() argument 238 SimpleDateFormat sdf = new SimpleDateFormat(fmt, l); in assertCannotParse() 242 assertNull("Value " + value + " must not parse in locale " + l + " with format " + fmt, d); in assertCannotParse() 250 private static Calendar parseDateUtc(Locale l, String fmt, String value) { in parseDateUtc() argument [all …]
|
D | DateFormatSymbolsTest.java | 88 private String formatDate(Locale l, String fmt, DateFormatSymbols dfs) { in formatDate() argument 89 SimpleDateFormat sdf = new SimpleDateFormat(fmt, l); in formatDate()
|
/libcore/ojluni/annotations/flagged_api/java/io/ |
D | Console.annotated.java | 39 public java.io.Console format(java.lang.String fmt, java.lang.Object... args) { throw new RuntimeEx… in format() argument 43 public java.lang.String readLine(java.lang.String fmt, java.lang.Object... args) { throw new Runtim… in readLine() argument 47 public char[] readPassword(java.lang.String fmt, java.lang.Object... args) { throw new RuntimeExcep… in readPassword() argument
|
/libcore/ojluni/src/main/java/java/text/ |
D | MessageFormat.java | 543 Format fmt = formats[i]; in toPattern() local 544 if (fmt == null) { in toPattern() 546 } else if (fmt instanceof NumberFormat) { in toPattern() 547 if (fmt.equals(NumberFormat.getInstance(locale))) { in toPattern() 549 } else if (fmt.equals(NumberFormat.getCurrencyInstance(locale))) { in toPattern() 551 } else if (fmt.equals(NumberFormat.getPercentInstance(locale))) { in toPattern() 553 } else if (fmt.equals(NumberFormat.getIntegerInstance(locale))) { in toPattern() 556 if (fmt instanceof DecimalFormat) { in toPattern() 557 result.append(",number,").append(((DecimalFormat)fmt).toPattern()); in toPattern() 558 } else if (fmt instanceof ChoiceFormat) { in toPattern() [all …]
|
/libcore/ojluni/src/test/java/time/test/java/time/format/ |
D | TestZoneTextPrinterParser.java | 236 DateTimeFormatter fmt = new DateTimeFormatterBuilder().appendZoneText(style, preferred) in test_ParseText() local 240 String ret = fmt.parse(text, TemporalQueries.zone()).getId(); in test_ParseText() 254 DateTimeFormatter fmt = getFormatter(locale, style, ci); in parseText() local 262 parse(fmt, zid, expected, zid, locale, style, ci); in parseText() 265 parse(fmt, zid, expected, names[i], locale, style, ci); in parseText() 270 private void parse(DateTimeFormatter fmt, in parse() argument 276 String ret = fmt.parse(text, TemporalQueries.zone()).getId(); in parse()
|
D | TestDateTimeFormatter.java | 216 DateTimeFormatter fmt = DateTimeFormatter.ofPattern(pattern); in test_throws_message() local 218 fmt.format(temporal); in test_throws_message() 237 DateTimeFormatter fmt = new DateTimeFormatterBuilder().appendZoneId().toFormatter() in test_throws_message_chrono() local 241 fmt.format(now); in test_throws_message_chrono() 258 DateTimeFormatter fmt = new DateTimeFormatterBuilder().appendChronologyId().toFormatter() in test_throws_message_zone() local 262 fmt.format(now); in test_throws_message_zone()
|
D | TestTextParserWithLocale.java | 221 DateTimeFormatter fmt = DateTimeFormatter.ofPattern("[GGG ]yyy-MM-dd") in test_chronoLocalDate() local 223 System.out.printf(" %s, [fmt=%s]%n", date.toString(), fmt.format(date)); in test_chronoLocalDate() 224 assertEquals(date, fmt.parse(fmt.format(date), ChronoLocalDate::from)); in test_chronoLocalDate()
|
D | TestDateTimeTextProviderWithLocale.java | 143 DateTimeFormatter fmt = getFormatter(field, style).withLocale(locale); in test_getText() local 144 assertEquals(fmt.format(ZonedDateTime.now().with(field, value.longValue())), expected); in test_getText()
|
D | TestDateTimeTextProvider.java | 138 DateTimeFormatter fmt = getFormatter(field, style).withLocale(locale); in test_getText() local 139 assertEquals(fmt.format(ZonedDateTime.now().with(field, value.longValue())), expected); in test_getText()
|
/libcore/ojluni/annotations/hiddenapi/java/io/ |
D | Console.java | 50 public java.io.Console format(java.lang.String fmt, java.lang.Object... args) { in format() argument 58 public java.lang.String readLine(java.lang.String fmt, java.lang.Object... args) { in readLine() argument 66 public char[] readPassword(java.lang.String fmt, java.lang.Object... args) { in readPassword() argument
|
/libcore/ojluni/src/main/native/ |
D | UnixFileSystem_md.c | 159 int fmt = mode & S_IFMT; in Java_java_io_UnixFileSystem_getBooleanAttributes0() local 161 | ((fmt == S_IFREG) ? java_io_FileSystem_BA_REGULAR : 0) in Java_java_io_UnixFileSystem_getBooleanAttributes0() 162 | ((fmt == S_IFDIR) ? java_io_FileSystem_BA_DIRECTORY : 0)); in Java_java_io_UnixFileSystem_getBooleanAttributes0()
|
D | jvm.h | 1272 jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args); 1275 jio_snprintf(char *str, size_t count, const char *fmt, ...); 1278 jio_fprintf(FILE *, const char *fmt, ...); 1281 jio_vfprintf(FILE *, const char *fmt, va_list args);
|
/libcore/ojluni/src/main/java/java/util/ |
D | Formatter.java | 3206 Formatter fmt = Formatter.this; in printString() local 3207 if (fmt.locale() != l) in printString() 3208 fmt = new Formatter(fmt.out(), l); in printString() 3209 ((Formattable)arg).formatTo(fmt, f.valueOf(), width, precision); in printString()
|