MCPcopy Index your code
hub / github.com/VolmitSoftware/Adapt / next

Method next

src/main/java/com/volmit/adapt/util/JSONTokener.java:134–163  ·  view source on GitHub ↗

Get the next character in the source string. @return The next character, or 0 if past the end of the source string.

()

Source from the content-addressed store, hash-verified

132 * @return The next character, or 0 if past the end of the source string.
133 */
134 public char next() throws JSONException {
135 int c;
136 if (this.usePrevious) {
137 this.usePrevious = false;
138 c = this.previous;
139 } else {
140 try {
141 c = this.reader.read();
142 } catch (IOException exception) {
143 throw new JSONException(exception);
144 }
145
146 if (c <= 0) { // End of stream
147 this.eof = true;
148 c = 0;
149 }
150 }
151 this.index += 1;
152 if (this.previous == '\r') {
153 this.line += 1;
154 this.character = c == '\n' ? 0 : 1;
155 } else if (c == '\n') {
156 this.line += 1;
157 this.character = 0;
158 } else {
159 this.character += 1;
160 }
161 this.previous = (char) c;
162 return this.previous;
163 }
164
165 /**
166 * Consume the next character, and check that it matches a specified

Callers 6

moreMethod · 0.95
nextCleanMethod · 0.95
nextStringMethod · 0.95
nextToMethod · 0.95
nextValueMethod · 0.95
skipToMethod · 0.95

Calls 3

syntaxErrorMethod · 0.95
endMethod · 0.95
readMethod · 0.65

Tested by

no test coverage detected