189 |
// Helper that returns the text up to the next format opener. The |
// Helper that returns the text up to the next format opener. The |
190 |
// text is put into BUFFER. Returns index of character after end of |
// text is put into BUFFER. Returns index of character after end of |
191 |
// string. Throws IllegalArgumentException on error. |
// string. Throws IllegalArgumentException on error. |
192 |
private static final int scanString (String pat, int index, |
private static int scanString(String pat, int index, StringBuffer buffer) |
|
StringBuffer buffer) |
|
193 |
{ |
{ |
194 |
int max = pat.length(); |
int max = pat.length(); |
195 |
buffer.setLength(0); |
buffer.setLength(0); |
219 |
|
|
220 |
// This helper retrieves a single part of a format element. Returns |
// This helper retrieves a single part of a format element. Returns |
221 |
// the index of the terminating character. |
// the index of the terminating character. |
222 |
private static final int scanFormatElement (String pat, int index, |
private static int scanFormatElement(String pat, int index, |
223 |
StringBuffer buffer, |
StringBuffer buffer, char term) |
|
char term) |
|
224 |
{ |
{ |
225 |
int max = pat.length(); |
int max = pat.length(); |
226 |
buffer.setLength(0); |
buffer.setLength(0); |
264 |
|
|
265 |
// This is used to parse a format element and whatever non-format |
// This is used to parse a format element and whatever non-format |
266 |
// text might trail it. |
// text might trail it. |
267 |
private static final int scanFormat (String pat, int index, |
private static int scanFormat(String pat, int index, StringBuffer buffer, |
268 |
StringBuffer buffer, Vector elts, |
Vector elts, Locale locale) |
|
Locale locale) |
|
269 |
{ |
{ |
270 |
MessageFormatElement mfe = new MessageFormatElement (); |
MessageFormatElement mfe = new MessageFormatElement (); |
271 |
elts.addElement(mfe); |
elts.addElement(mfe); |