MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / appendDigits

Method appendDigits

java/src/org/openqa/selenium/json/Input.java:209–225  ·  view source on GitHub ↗

Consume ASCII digits, appending them to the supplied builder in bulk. Stops before the first non-digit character, which is left unconsumed. @param sink StringBuilder that accumulates the digits @return the unconsumed non-digit character as an unsigned UTF-16 code unit; #EOF if i

(StringBuilder sink)

Source from the content-addressed store, hash-verified

207 * input is exhausted
208 */
209 public int appendDigits(StringBuilder sink) {
210 while (fill()) {
211 int start = position + 1;
212 for (int i = start; i < filled; i++) {
213 char c = buffer[i];
214 if (c < '0' || c > '9') {
215 sink.append(buffer, start, i - start);
216 position = i - 1;
217 return c;
218 }
219 }
220 sink.append(buffer, start, filled - start);
221 position = filled - 1;
222 }
223
224 return EOF;
225 }
226
227 /**
228 * Return a string containing the most recently consumed input characters.

Callers 1

readNumberLexemeMethod · 0.80

Calls 2

fillMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected