Home
last modified time | relevance | path

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

12

/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 || pattern.isEmpty()) { in initProperties()
273 pattern = pattern.replace('/', File.separatorChar);
275 char[] value = pattern.toCharArray();
276 while ((next = pattern.indexOf('%', cur)) >= 0) {
277 if (++next < pattern.length()) {
380 public FileHandler(String pattern) throws IOException { in FileHandler() argument
381 if (pattern.isEmpty()) { in FileHandler()
384 init(pattern, null, Integer.valueOf(DEFAULT_LIMIT), Integer.valueOf(DEFAULT_COUNT)); 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/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.java278 private final String pattern; field in Pattern
322 return Splitter.split(this, pattern, input.toString(), limit); in split()
335 public String pattern() { in pattern() method in Pattern
336 return pattern; in pattern()
341 return pattern; in toString()
373 public static Pattern compile(String pattern) { in compile() argument
374 return new Pattern(pattern, 0); in compile()
377 private Pattern(String pattern, int flags) throws PatternSyntaxException { in Pattern() argument
381 this.pattern = pattern; in Pattern()
387 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
92 Matcher(Pattern pattern, CharSequence input) { in Matcher() argument
93 usePattern(pattern); in Matcher()
231 public Matcher usePattern(Pattern pattern) { in usePattern() argument
232 if (pattern == null) { in usePattern()
236 this.pattern = pattern; in usePattern()
242 address = openImpl(pattern.address); in usePattern()
332 public Pattern pattern() { in pattern() method in Matcher
333 return pattern; in pattern()
/libcore/luni/src/test/resources/bundles/java/util/logging/
Dres3.properties11 pattern=pattern {0, number}3 key
12 pattern{0,number}=NOLOCALE3
Dres2.properties11 pattern=pattern {0, number}2 key
12 pattern{0,number}=NOLOCALE2
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/test/java/libcore/java/text/
DOldSimpleDateFormatTest.java40 public void test(String pattern, Calendar cal, String expected, int field) { in test() argument
43 format.applyPattern(pattern); in test()
47 System.out.println("Wrong format: \"" + pattern in test()
54 public void parse(String pattern, String input, Date expected, int start, int end) { in parse() argument
55 pFormat.applyPattern(pattern); in parse()
58 assertTrue("Wrong result: " + pattern + " input: " + input in parse()
61 assertTrue("Wrong end position: " + pattern + " input: " + input, in parse()
499 String pattern = f2.toLocalizedPattern(); in test_toLocalizedPattern() local
504 assertTrue("Wrong pattern: " + pattern, pattern in test_toLocalizedPattern()
510 pattern = f2.toLocalizedPattern(); in test_toLocalizedPattern()
[all …]
DOldMessageFormatTest.java43 …String pattern = "A {3, number, currency} B {2, time} C {0, number, percent} D {4} E {1,choice,0#… in setUp() local
44 format1 = new MessageFormat(pattern); in setUp()
87 String pattern = "getLocale test {0,number,#,####}"; in test_getLocale() local
91 mf = new MessageFormat(pattern, l[i]); in test_getLocale()
103 mf = new MessageFormat(pattern); in test_getLocale()
221 …String pattern = "Date: {0,date} Currency: {1, number, currency} Integer: {2, number, integer}"; in test_formatLjava_lang_StringLjava_lang_Object() local
222 String sFormat = MessageFormat.format(pattern, (Object[]) args); in test_formatLjava_lang_StringLjava_lang_Object()
227pattern = "abc {4, number, integer} def {3,date} ghi {2,number} jkl {1,choice,0#low|1#high} mnop {… in test_formatLjava_lang_StringLjava_lang_Object()
230 sFormat = MessageFormat.format(pattern, args_); in test_formatLjava_lang_StringLjava_lang_Object()
283 String pattern = "On {4,date} at {3,time}, he ate {2,number, integer} " + in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition() local
[all …]
/libcore/luni/src/test/java/libcore/java/util/logging/
DOldFormatterTest.java63 String pattern = "pattern without 0 {1, number}"; in testFormatMessage() local
64 r.setMessage(pattern); in testFormatMessage()
65 assertEquals(pattern, f.formatMessage(r)); in testFormatMessage()
/libcore/luni/src/main/java/libcore/icu/
DNativeDecimalFormat.java121 public NativeDecimalFormat(String pattern, DecimalFormatSymbols dfs) { in NativeDecimalFormat() argument
123 this.address = open(pattern, dfs.getCurrencySymbol(), in NativeDecimalFormat()
129 this.lastPattern = pattern; in NativeDecimalFormat()
133 throw new IllegalArgumentException("syntax error: " + re.getMessage() + ": " + pattern); in NativeDecimalFormat()
138 public NativeDecimalFormat(String pattern, LocaleData data) { in NativeDecimalFormat() argument
139 this.address = open(pattern, data.currencySymbol, in NativeDecimalFormat()
144 this.lastPattern = pattern; in NativeDecimalFormat()
267 public void applyLocalizedPattern(String pattern) { in applyLocalizedPattern() argument
268 applyPattern(this.address, true, pattern); in applyLocalizedPattern()
272 public void applyPattern(String pattern) { in applyPattern() argument
[all …]
/libcore/luni/src/main/java/java/text/
DDecimalFormat.java537 public DecimalFormat(String pattern) { in DecimalFormat() argument
538 this(pattern, Locale.getDefault()); in DecimalFormat()
552 public DecimalFormat(String pattern, DecimalFormatSymbols value) { in DecimalFormat() argument
554 initNative(pattern); in DecimalFormat()
558 DecimalFormat(String pattern, Locale locale) { in DecimalFormat() argument
560 initNative(pattern); in DecimalFormat()
563 private void initNative(String pattern) { in initNative() argument
565 this.dform = new NativeDecimalFormat(pattern, symbols); in initNative()
567 throw new IllegalArgumentException(pattern); in initNative()
584 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 …]
DSimpleDateFormat.java219 private String pattern; field in SimpleDateFormat
234 this.pattern = defaultPattern(); in SimpleDateFormat()
252 public SimpleDateFormat(String pattern) { in SimpleDateFormat() argument
253 this(pattern, Locale.getDefault()); in SimpleDateFormat()
349 pattern = template; in SimpleDateFormat()
370 pattern = template; in SimpleDateFormat()
392 pattern = convertPattern(template, formatData.getLocalPatternChars(), PATTERN_CHARS, true); in applyLocalizedPattern()
408 pattern = template; in applyPattern()
452 return super.equals(object) && pattern.equals(simple.pattern) in equals()
541 final int patternLength = pattern.length(); in formatImpl()
[all …]
/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/luni/src/main/java/java/util/
DScanner.java329 public String findInLine(Pattern pattern) { in findInLine() argument
331 checkNull(pattern); in findInLine()
355 matcher.usePattern(pattern); in findInLine()
421 public String findInLine(String pattern) { in findInLine() argument
422 return findInLine(Pattern.compile(pattern)); in findInLine()
457 public String findWithinHorizon(Pattern pattern, int horizon) { in findWithinHorizon() argument
459 checkNull(pattern); in findWithinHorizon()
463 matcher.usePattern(pattern); in findWithinHorizon()
532 public String findWithinHorizon(String pattern, int horizon) { in findWithinHorizon() argument
533 return findWithinHorizon(Pattern.compile(pattern), horizon); in findWithinHorizon()
[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()
/libcore/support/src/test/java/tests/support/
DSupport_MessageFormat.java47 …String pattern = "On {4,date} at {3,time}, he ate {2,number, integer} hamburger{2,choice,1#|1<s} a… in t_format_with_FieldPosition() local
48 MessageFormat format = new MessageFormat(pattern, Locale.US); in t_format_with_FieldPosition()
74 …String pattern = "On {4,date} at {3,time}, he ate {2,number, integer} hamburger{2,choice,1#|1<s} a… in t_formatToCharacterIterator() local
75 MessageFormat format = new MessageFormat(pattern, Locale.US); in t_formatToCharacterIterator()
/libcore/luni/src/main/native/
Djava_util_regex_Pattern.cpp65 static void throwPatternSyntaxException(JNIEnv* env, UErrorCode status, jstring pattern, UParseErro… in throwPatternSyntaxException() argument
70 jobject exception = env->NewObject(exceptionClass, method, message, pattern, error.offset); in throwPatternSyntaxException()

12