MCPcopy Index your code
hub / github.com/jOOQ/jOOQ / parse

Method parse

jOOQ/src/main/java/org/jooq/Decfloat.java:217–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

215 }
216
217 private final void parse() {
218 if (coefficient != null || special != null)
219 return;
220
221 String lc;
222 switch (lc = data.toLowerCase()) {
223 case "+nan":
224 case "nan":
225 case "-nan":
226 special = Special.NAN;
227 break;
228
229 case "+infinity":
230 case "infinity":
231 case "+inf":
232 case "inf":
233 special = Special.POSITIVE_INFINITY;
234 break;
235
236 case "-infinity":
237 case "-inf":
238 special = Special.NEGATIVE_INFINITY;
239 break;
240
241 default: {
242 int i = lc.indexOf("e");
243
244 try {
245 if (i == -1) {
246 coefficient = new BigDecimal(data);
247 }
248 else {
249 coefficient = new BigDecimal(data.substring(0, i));
250 exponent = Integer.parseInt(data.substring(i + 1));
251 }
252
253 normalise();
254 }
255
256 // [#10880] If we cannot represent the value internally, then we'll just work with data
257 catch (NumberFormatException ignore) {}
258 break;
259 }
260 }
261 }
262
263 private final void normalise() {
264 int scale = coefficient.scale();

Callers 6

isNaNMethod · 0.95
isPositiveInfinityMethod · 0.95
isNegativeInfinityMethod · 0.95
hashCodeMethod · 0.95
equalsMethod · 0.95
toStringMethod · 0.95

Calls 4

normaliseMethod · 0.95
indexOfMethod · 0.65
substringMethod · 0.65
parseIntMethod · 0.45

Tested by

no test coverage detected