MCPcopy Create free account
hub / github.com/bwaldvogel/liblinear-java / atoi

Method atoi

src/main/java/de/bwaldvogel/liblinear/Linear.java:307–314  ·  view source on GitHub ↗

@param s the string to parse for the integer value @throws IllegalArgumentException if s is empty @throws NumberFormatException see Integer#parseInt(String)

(String s)

Source from the content-addressed store, hash-verified

305 * @throws NumberFormatException see {@link Integer#parseInt(String)}
306 */
307 static int atoi(String s) throws NumberFormatException {
308 if (s == null || s.length() < 1)
309 throw new IllegalArgumentException("Can't convert empty string to integer");
310 // Integer.parseInt doesn't accept '+' prefixed strings
311 if (s.charAt(0) == '+')
312 s = s.substring(1);
313 return Integer.parseInt(s);
314 }
315
316 /**
317 * Loads the model from inputReader.

Callers 7

testAtoiMethod · 0.95
testAtoiInvalidDataMethod · 0.95
loadModelMethod · 0.95
doPredictMethod · 0.80
mainMethod · 0.80
parse_command_lineMethod · 0.80
readProblemMethod · 0.80

Calls

no outgoing calls

Tested by 2

testAtoiMethod · 0.76
testAtoiInvalidDataMethod · 0.76