Home
last modified time | relevance | path

Searched refs:pattern (Results 1 – 25 of 54) sorted by relevance

123

/libcore/luni/src/main/java/java/util/logging/
DFormatter.java64 String pattern = r.getMessage(); in formatMessage() local
69 pattern = rb.getString(pattern); in formatMessage()
71 pattern = r.getMessage(); in formatMessage()
74 if (pattern != null) { in formatMessage()
80 if (pattern.indexOf("{0") >= 0 && params != null && params.length > 0) { in formatMessage()
82 pattern = MessageFormat.format(pattern, params); in formatMessage()
84 pattern = r.getMessage(); in formatMessage()
88 return pattern; in formatMessage()
DFileHandler.java121 private String pattern; field in FileHandler
215 pattern = (p == null) ? getStringProperty(className + ".pattern", in initProperties()
217 if (pattern == null) { in initProperties()
219 } else if (pattern.isEmpty()) { in initProperties()
275 pattern = pattern.replace('/', File.separatorChar);
277 char[] value = pattern.toCharArray();
278 while ((next = pattern.indexOf('%', cur)) >= 0) {
279 if (++next < pattern.length()) {
382 public FileHandler(String pattern) throws IOException { in FileHandler() argument
383 if (pattern.isEmpty()) { in FileHandler()
[all …]
DXMLFormatter.java88 String pattern = r.getMessage(); in formatMessages() local
89 if (rb != null && pattern != null) { in formatMessages()
92 message = rb.getString(pattern); in formatMessages()
98 message = pattern; in formatMessages()
102 append(sb, 1, "key", pattern); in formatMessages()
105 } else if (pattern != null) { in formatMessages()
106 append(sb, 1, "message", pattern); in formatMessages()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/regex/
DReplaceTest.java29 String target, pattern, repl; in testSimpleReplace() local
32 pattern = "fo[^o]"; in testSimpleReplace()
35 Pattern p = Pattern.compile(pattern); in testSimpleReplace()
43 String target, pattern, repl, s; in testCaptureReplace() local
48 pattern = "\\[([0-9]+)\\]([a-z]+)"; in testCaptureReplace()
51 p = Pattern.compile(pattern); in testCaptureReplace()
59 pattern = "\\[([0-9]+)\\]([a-z]+)\\(([0-9]+)\\)([a-z]+)\\{([0-9]+)\\}([a-z]+)"; in testCaptureReplace()
61 p = Pattern.compile(pattern); in testCaptureReplace()
76 String target, pattern, repl, s; in testEscapeReplace() local
79 pattern = "'"; in testEscapeReplace()
[all …]
DMatcherTest.java104 String pattern = "a*b"; in testReplaceAll() local
105 Pattern pat = Pattern.compile(pattern); in testReplaceAll()
139 String pattern = "dog"; in testReplaceFirst() local
140 Pattern pat = Pattern.compile(pattern); in testReplaceFirst()
149 assertEquals(test, test.matcher("aaa").pattern()); in testPattern()
154 .pattern().toString()); in testPattern()
282 assertTrue("Match expected, but failed: " + pat.pattern() in testMatchesQuantifiers()
286 + pat.pattern() + " : " + stringSingles[i][j * 2 + 1], in testMatchesQuantifiers()
294 assertTrue("Match expected, but failed: " + pat.pattern() in testMatchesQuantifiers()
299 + pat.pattern() + " : " in testMatchesQuantifiers()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/
DReplaceTest.java26 String target, pattern, repl; in testSimpleReplace() local
29 pattern = "fo[^o]"; in testSimpleReplace()
32 Pattern p = Pattern.compile(pattern); in testSimpleReplace()
40 String target, pattern, repl, s; in testCaptureReplace() local
45 pattern = "\\[([0-9]+)\\]([a-z]+)"; in testCaptureReplace()
48 p = Pattern.compile(pattern); in testCaptureReplace()
56 pattern = "\\[([0-9]+)\\]([a-z]+)\\(([0-9]+)\\)([a-z]+)\\{([0-9]+)\\}([a-z]+)"; in testCaptureReplace()
58 p = Pattern.compile(pattern); in testCaptureReplace()
71 String target, pattern, repl, s; in testEscapeReplace() local
74 pattern = "'"; in testEscapeReplace()
[all …]
DPatternTest.java177 assertTrue(p.pattern().equals(aPattern)); in testPattern()
422 String pattern = "b)a"; in testCompileStringInt() local
424 Pattern.compile(pattern); in testCompileStringInt()
426 + pattern); in testCompileStringInt()
430 pattern = "bcde)a"; in testCompileStringInt()
432 Pattern.compile(pattern); in testCompileStringInt()
434 + pattern); in testCompileStringInt()
438 pattern = "bbg())a"; in testCompileStringInt()
440 Pattern pat = Pattern.compile(pattern); in testCompileStringInt()
442 + pattern); in testCompileStringInt()
[all …]
/libcore/luni/src/main/java/java/util/regex/
DPattern.java285 private final String pattern; field in Pattern
329 return Splitter.split(this, pattern, input.toString(), limit); in split()
342 public String pattern() { in pattern() method in Pattern
343 return pattern; in pattern()
348 return pattern; in toString()
380 public static Pattern compile(String pattern) { in compile() argument
381 return new Pattern(pattern, 0); in compile()
384 private Pattern(String pattern, int flags) throws PatternSyntaxException { in Pattern() argument
392 this.pattern = pattern; in Pattern()
398 if (pattern == null) { in compile()
[all …]
DPatternSyntaxException.java44 private String pattern; field in PatternSyntaxException
66 public PatternSyntaxException(String description, String pattern, int index) { in PatternSyntaxException() argument
68 this.pattern = pattern; in PatternSyntaxException()
79 return pattern; in getPattern()
105 if (pattern != null) { in getMessage()
107 sb.append(pattern); in getMessage()
DMatcher.java28 private Pattern pattern; field in Matcher
88 Matcher(Pattern pattern, CharSequence input) { in Matcher() argument
89 usePattern(pattern); in Matcher()
226 public Matcher usePattern(Pattern pattern) { in usePattern() argument
227 if (pattern == null) { in usePattern()
231 this.pattern = pattern; in usePattern()
238 address = openImpl(pattern.address); in usePattern()
327 public Pattern pattern() { in pattern() method in Matcher
328 return pattern; in pattern()
539 return getClass().getName() + "[pattern=" + pattern() + in toString()
/libcore/luni/src/test/resources/bundles/java/util/logging/
Dres2.properties11 pattern=pattern {0, number}2 key
12 pattern{0,number}=NOLOCALE2
Dres3.properties11 pattern=pattern {0, number}3 key
12 pattern{0,number}=NOLOCALE3
Dres.properties11 pattern=US_pattern {0, number} key
12 pattern{0,number}=US
Dres_en_US.properties11 pattern=US_pattern {0, number} key
12 pattern{0,number}=US
Dres_zh_CN.properties11 pattern=ZH_CN_pattern {0, number} key
12 pattern{0,number}=ZH_CN
/libcore/luni/src/main/java/libcore/icu/
DICU.java280 String pattern = CACHED_PATTERNS.get(key); in getBestDateTimePattern() local
281 if (pattern == null) { in getBestDateTimePattern()
282 pattern = getBestDateTimePatternNative(skeleton, languageTag); in getBestDateTimePattern()
283 CACHED_PATTERNS.put(key, pattern); in getBestDateTimePattern()
285 return pattern; in getBestDateTimePattern()
291 public static char[] getDateFormatOrder(String pattern) { in getDateFormatOrder() argument
298 for (int i = 0; i < pattern.length(); ++i) { in getDateFormatOrder()
299 char ch = pattern.charAt(i); in getDateFormatOrder()
314 throw new IllegalArgumentException("Bad pattern character '" + ch + "' in " + pattern); in getDateFormatOrder()
316 if (i < pattern.length() - 1 && pattern.charAt(i + 1) == '\'') { in getDateFormatOrder()
[all …]
DNativeDecimalFormat.java154 public NativeDecimalFormat(String pattern, DecimalFormatSymbols dfs) { in NativeDecimalFormat() argument
156 this.address = open(pattern, dfs.getCurrencySymbol(), in NativeDecimalFormat()
162 this.lastPattern = pattern; in NativeDecimalFormat()
166 throw new IllegalArgumentException("syntax error: " + re.getMessage() + ": " + pattern); in NativeDecimalFormat()
171 public NativeDecimalFormat(String pattern, LocaleData data) { in NativeDecimalFormat() argument
172 this.address = open(pattern, data.currencySymbol, in NativeDecimalFormat()
177 this.lastPattern = pattern; in NativeDecimalFormat()
332 public void applyLocalizedPattern(String pattern) { in applyLocalizedPattern() argument
333 applyPattern(this.address, true, pattern); in applyLocalizedPattern()
337 public void applyPattern(String pattern) { in applyPattern() argument
[all …]
/libcore/luni/src/main/java/java/util/
DScanner.java317 public String findInLine(Pattern pattern) { in findInLine() argument
319 checkNotNull(pattern); in findInLine()
343 matcher.usePattern(pattern); in findInLine()
409 public String findInLine(String pattern) { in findInLine() argument
410 return findInLine(Pattern.compile(pattern)); in findInLine()
445 public String findWithinHorizon(Pattern pattern, int horizon) { in findWithinHorizon() argument
447 checkNotNull(pattern); in findWithinHorizon()
451 matcher.usePattern(pattern); in findWithinHorizon()
512 public String findWithinHorizon(String pattern, int horizon) { in findWithinHorizon() argument
513 return findWithinHorizon(Pattern.compile(pattern), horizon); in findWithinHorizon()
[all …]
/libcore/luni/src/main/java/java/text/
DDecimalFormat.java534 public DecimalFormat(String pattern) { in DecimalFormat() argument
535 this(pattern, Locale.getDefault()); in DecimalFormat()
549 public DecimalFormat(String pattern, DecimalFormatSymbols value) { in DecimalFormat() argument
551 initNative(pattern); in DecimalFormat()
555 DecimalFormat(String pattern, Locale locale) { in DecimalFormat() argument
557 initNative(pattern); in DecimalFormat()
560 private void initNative(String pattern) { in initNative() argument
562 this.ndf = new NativeDecimalFormat(pattern, symbols); in initNative()
564 throw new IllegalArgumentException(pattern); in initNative()
581 public void applyLocalizedPattern(String pattern) { in applyLocalizedPattern() argument
[all …]
DMessageFormat.java1152 String pattern = null; in toPattern() local
1155 pattern = ((ChoiceFormat) format).toPattern(); in toPattern()
1157 pattern = decodeDecimalFormat(buffer, format); in toPattern()
1159 pattern = decodeSimpleDateFormat(buffer, format); in toPattern()
1163 if (pattern != null) { in toPattern()
1165 int index = 0, length = pattern.length(), count = 0; in toPattern()
1167 char ch = pattern.charAt(index++); in toPattern()
1228 StringBuilder pattern = new StringBuilder(); in writeObject() local
1232 pattern.append(strings[i]); in writeObject()
1235 pattern.append(strings[maxOffset + 1]); in writeObject()
[all …]
/libcore/luni/src/test/java/libcore/java/util/logging/
DOldFormatterTest.java64 String pattern = "pattern without 0 {1, number}"; in testFormatMessage() local
65 r.setMessage(pattern); in testFormatMessage()
66 assertEquals(pattern, f.formatMessage(r)); in testFormatMessage()
/libcore/luni/src/main/java/java/sql/
DBlob.java97 public long position(Blob pattern, long start) throws SQLException; in position() argument
115 public long position(byte[] pattern, long start) throws SQLException; in position() argument
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DSimpleDateFormatTest.java136 String pattern = "GyMdkHmsSEDFwWahKzZLc"; in test_applyLocalizedPatternLjava_lang_String() local
137 f2.applyLocalizedPattern(pattern); in test_applyLocalizedPatternLjava_lang_String()
138 assertEquals(pattern, f2.toPattern()); in test_applyLocalizedPatternLjava_lang_String()
139 assertEquals(pattern, f2.toLocalizedPattern()); in test_applyLocalizedPatternLjava_lang_String()
399 private void assertFormat(String pattern, Calendar cal, String expected, int field) { in assertFormat() argument
402 format.applyPattern(pattern); in assertFormat()
405 assertTrue("Wrong format: \"" + pattern + "\" expected: " + expected + " result: " + result, in assertFormat()
407 assertEquals("Wrong begin position: " + pattern + "\n" + "expected: " + expected + "\n" + in assertFormat()
409 assertTrue("Wrong end position: " + pattern + " expected: " + expected + " field: " + field, in assertFormat()
713 private void assertParse(String pattern, String input, Date expected, int start, int end) { in assertParse() argument
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DFormatterTest.java1164 final int pattern = 1; in test_format_LString$LObject_GeneralConversionB() local
1169 f.format((String) triple[i][pattern], triple[i][input]); in test_format_LString$LObject_GeneralConversionB()
1171 + ",pattern[" + i + "]:" + triple[i][pattern], triple[i][output], f.toString()); in test_format_LString$LObject_GeneralConversionB()
1174 f.format(((String) triple[i][pattern]).toUpperCase(Locale.US), triple[i][input]); in test_format_LString$LObject_GeneralConversionB()
1176 + ",pattern[" + i + "]:" + triple[i][pattern], ((String) triple[i][output]) in test_format_LString$LObject_GeneralConversionB()
1228 final int pattern = 1; in test_format_LString$LObject_GeneralConversionS() local
1233 f.format((String) triple[i][pattern], triple[i][input]); in test_format_LString$LObject_GeneralConversionS()
1235 + ",pattern[" + i + "]:" + triple[i][pattern], triple[i][output], f.toString()); in test_format_LString$LObject_GeneralConversionS()
1238 f.format(((String) triple[i][pattern]).toUpperCase(Locale.US), triple[i][input]); in test_format_LString$LObject_GeneralConversionS()
1240 + ",pattern[" + i + "]:" + triple[i][pattern], ((String) triple[i][output]) in test_format_LString$LObject_GeneralConversionS()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/
DOldStringTest.java235 String pattern = "[!.1]"; in test_splitLStringLint() local
241 Arrays.equals(results[0], str.split(pattern, 4))); in test_splitLStringLint()
243 Arrays.equals(results[1], str.split(pattern, 9))); in test_splitLStringLint()
245 Arrays.equals(results[1], str.split(pattern, 0))); in test_splitLStringLint()
247 Arrays.equals(results[1], str.split(pattern, -1))); in test_splitLStringLint()
249 Arrays.equals(results[1], str.split(pattern, 10))); in test_splitLStringLint()
251 Arrays.equals(results[1], str.split(pattern, Integer.MAX_VALUE))); in test_splitLStringLint()

123