Lines Matching defs:sb

86             StringBuilder sb = new StringBuilder(input[i]);
91 testCodePoint(At, sb, 0, golden1[0][i]);
92 testCodePoint(At, sb, 9, golden1[1][i]);
93 testCodePoint(At, sb, sb.length()-1, golden1[2][i]);
98 testCodePoint(At, sb, -1);
99 testCodePoint(At, sb, sb.length());
123 StringBuilder sb = new StringBuilder(input[i]);
128 testCodePoint(Before, sb, 1, golden2[0][i]);
129 testCodePoint(Before, sb, 13, golden2[1][i]);
130 testCodePoint(Before, sb, sb.length(), golden2[2][i]);
135 testCodePoint(Before, sb, 0);
136 testCodePoint(Before, sb, sb.length()+1);
176 StringBuilder sb = new StringBuilder(input[i]).reverse();
178 check(!golden3[i].equals(sb.toString()),
180 sb, golden3[i]);
184 StringBuilder sb = new StringBuilder(testdata1[i][0]).reverse();
186 check(!testdata1[i][1].equals(sb.toString()),
188 sb, testdata1[i][1]);
198 StringBuilder sb = new StringBuilder();
202 StringBuilder rsb = sb.appendCodePoint(c);
203 check(sb != rsb, "appendCodePoint returned a wrong object");
204 int sbc = sb.codePointAt(j);
207 check(!s.equals(sb.toString()),
226 StringBuilder sb = new StringBuilder(s);
227 int length = sb.length();
229 int result = sb.codePointCount(j, length);
230 int expected = Character.codePointCount(sb, j, length);
235 int result = sb.codePointCount(0, j);
236 int expected = Character.codePointCount(sb, 0, j);
243 testCodePointCount(sb, -1, length, IndexOutOfBoundsException.class);
244 testCodePointCount(sb, 0, length+1, IndexOutOfBoundsException.class);
245 testCodePointCount(sb, length, length-1, IndexOutOfBoundsException.class);
259 StringBuilder sb = new StringBuilder(s);
262 int nCodePoints = Character.codePointCount(sb, j, length);
263 int result = sb.offsetByCodePoints(j, nCodePoints);
267 result = sb.offsetByCodePoints(length, -nCodePoints);
270 int cp = sb.codePointBefore(j+1);
280 int nCodePoints = Character.codePointCount(sb, 0, j);
281 int result = sb.offsetByCodePoints(0, nCodePoints);
284 int cp = sb.codePointAt(j-1);
292 result = sb.offsetByCodePoints(j, -nCodePoints);
300 testOffsetByCodePoints(sb, -1, length, IndexOutOfBoundsException.class);
301 testOffsetByCodePoints(sb, 0, length+1, IndexOutOfBoundsException.class);
302 testOffsetByCodePoints(sb, 1, -2, IndexOutOfBoundsException.class);
303 testOffsetByCodePoints(sb, length, length-1, IndexOutOfBoundsException.class);
304 testOffsetByCodePoints(sb, length, -(length+1), IndexOutOfBoundsException.class);
311 static void testCodePoint(boolean isAt, StringBuilder sb, int index, int expected) {
312 int c = isAt ? sb.codePointAt(index) : sb.codePointBefore(index);
316 + sb + ">", c, expected);
319 static void testCodePoint(boolean isAt, StringBuilder sb, int index) {
323 int c = isAt ? sb.codePointAt(index) : sb.codePointBefore(index);
330 + sb + "> should throw StringIndexOutOfBoundsPointerException.");
346 static void testCodePointCount(StringBuilder sb, int beginIndex, int endIndex,
349 int n = sb.codePointCount(beginIndex, endIndex);
359 static void testOffsetByCodePoints(StringBuilder sb, int index, int offset,
362 int n = sb.offsetByCodePoints(index, offset);
404 StringBuilder sb = new StringBuilder();
408 sb.append(" 0x");
409 if (c < 0x10) sb.append('0');
410 if (c < 0x100) sb.append('0');
411 if (c < 0x1000) sb.append('0');
412 sb.append(Integer.toHexString(c));
414 sb.append(' ');
415 return sb.toString();