Lines Matching defs:pattern

60  * inserts the formatted strings into the pattern at the appropriate places.
69 * behavior is defined by the pattern that you provide as well as the
101 * pattern string <code>"'{0}'"</code> represents string
104 * <i>String</i>. For example, pattern string <code>"'{''}'"</code> is
113 * subformat, and subformat-dependent pattern rules apply. For example,
114 * pattern string <code>"{1,number,<u>$'#',##</u>}"</code>
121 * pattern. For example, pattern string {@code "'{0}"} is treated as
122 * pattern {@code "'{0}'"}.
124 * <p>Any curly braces within an unquoted pattern must be balanced. For
149 * be a valid pattern string for the {@code Format} subclass used.
225 * In real internationalized programs, the message format pattern and other
289 * above example, or by using a pattern. See {@link ChoiceFormat}
353 * specified pattern.
354 * The constructor first sets the locale, then parses the pattern and
359 * @param pattern the pattern for this message format
360 * @exception IllegalArgumentException if the pattern is invalid
362 public MessageFormat(String pattern) {
364 applyPattern(pattern);
369 * pattern.
370 * The constructor first sets the locale, then parses the pattern and
375 * @param pattern the pattern for this message format
377 * @exception IllegalArgumentException if the pattern is invalid
380 public MessageFormat(String pattern, Locale locale) {
382 applyPattern(pattern);
417 * Sets the pattern used by this message format.
418 * The method parses the pattern and creates a list of subformats
423 * @param pattern the pattern for this message format
424 * @exception IllegalArgumentException if the pattern is invalid
426 public void applyPattern(String pattern) {
437 for (int i = 0; i < pattern.length(); ++i) {
438 char ch = pattern.charAt(i);
441 if (i + 1 < pattern.length()
442 && pattern.charAt(i+1) == '\'') {
509 throw new IllegalArgumentException("Unmatched braces in the pattern.");
511 this.pattern = segments[0].toString();
516 * Returns a pattern representing the current state of the message format.
518 * does not necessarily equal the previously applied pattern.
520 * @return a pattern representing the current state of the message format
527 copyAndFixQuotes(pattern, lastOffset, offsets[i], result);
581 copyAndFixQuotes(pattern, lastOffset, pattern.length(), result);
590 * pattern string.
597 * in the pattern string, then the corresponding new format is used
599 * for any format element in the pattern string, then the
619 * previously set pattern string.
621 * the order of format elements in the pattern string.
623 * If more formats are provided than needed by the pattern string,
628 * Since the order of format elements in a pattern string often
651 * previously set pattern string that use the given argument
659 * in the pattern string, then the new format is used for all such
661 * element in the pattern string, then the new format is ignored.
677 * format element index within the previously set pattern string.
679 * element counting from the start of the pattern string.
681 * Since the order of format elements in a pattern string often
687 * @param formatElementIndex the index of a format element within the pattern
690 * larger than the number of format elements in the pattern string
704 * pattern string.
711 * in the pattern string, then the format used for the last such
713 * is not used for any format element in the pattern string, then
716 * @return the formats used for the arguments within the pattern
735 * previously set pattern string.
737 * the order of format elements in the pattern string.
739 * Since the order of format elements in a pattern string often
747 * @return the formats used for the format elements in the pattern
757 * pattern, with format elements replaced by the formatted objects, to the
827 * Creates a MessageFormat with the given pattern and uses it
830 * <code>(new {@link #MessageFormat(String) MessageFormat}(pattern)).{@link #format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition) format}(arguments, new StringBuffer(), null).toString()</code>
833 * @exception IllegalArgumentException if the pattern is invalid,
838 public static String format(String pattern, Object ... arguments) {
839 MessageFormat temp = new MessageFormat(pattern);
846 * pattern, with format elements replaced by the formatted objects, to the
869 * <code>MessageFormat</code>'s pattern, producing an
925 * <li>If one of the arguments does not occur in the pattern.
932 * For example, if the pattern "{1},{2}" is used with the
942 * is comparing against the pattern "AAD {0} BBB", the error index is
966 if (len == 0 || pattern.regionMatches(patternOffset,
980 int tempLength = (i != maxOffset) ? offsets[i+1] : pattern.length();
986 next = source.indexOf(pattern.substring(patternOffset, tempLength),
1011 int len = pattern.length() - patternOffset;
1012 if (len == 0 || pattern.regionMatches(patternOffset,
1103 && pattern.equals(other.pattern)
1115 return pattern.hashCode(); // enough for reasonable distribution
1180 * is the pattern supplied on construction with all of the {} expressions taken out.
1183 private String pattern = "";
1196 * into the pattern.
1203 * in the order they occur in the pattern, not in the order in which the arguments
1237 result.append(pattern.substring(lastOffset, offsets[i]));
1330 result.append(pattern.substring(lastOffset, pattern.length()));
1474 default: // DecimalFormat pattern
1498 // SimpleDateFormat pattern
1510 // ChoiceFormat pattern
1584 int lastOffset = pattern.length() + 1;