MCPcopy Create free account
hub / github.com/apache/solr / readFrac

Method readFrac

solr/solrj/src/java/org/noggit/JSONParser.java:573–588  ·  view source on GitHub ↗
(CharArr arr, int lim)

Source from the content-addressed store, hash-verified

571
572 // read digits right of decimal point
573 private int readFrac(CharArr arr, int lim) throws IOException {
574 nstate = HAS_FRACTION; // deliberate set instead of '|'
575 while (--lim >= 0) {
576 int ch = getChar();
577 if (ch >= '0' && ch <= '9') {
578 arr.write(ch);
579 } else if (ch == 'e' || ch == 'E') {
580 arr.write(ch);
581 return readExp(arr, lim);
582 } else {
583 if (ch != -1) start--; // back up
584 return NUMBER;
585 }
586 }
587 return BIGNUMBER;
588 }
589
590 // call after 'e' or 'E' has been seen to read the rest of the exponent
591 private int readExp(CharArr arr, int lim) throws IOException {

Callers 2

readNumberMethod · 0.95
continueNumberMethod · 0.95

Calls 3

getCharMethod · 0.95
readExpMethod · 0.95
writeMethod · 0.65

Tested by

no test coverage detected