MCPcopy Create free account
hub / github.com/SWI-Prolog/packages-jpl / parse_params

Method parse_params

src/examples/java/time/Time.java:25–44  ·  view source on GitHub ↗
(String argv[])

Source from the content-addressed store, hash-verified

23 }
24
25 static void parse_params(String argv[]) {
26 int i = 0;
27 while (i < argv.length) {
28 if (argv[i].equals("-help")) {
29 print_help();
30 System.exit(1);
31 } else if (argv[i].equals("-num_trials")) {
32 num_trials = java.lang.Integer.valueOf(argv[i + 1]).intValue();
33 i += 2;
34 } else if (argv[i].equals("-tree_depth")) {
35 tree_depth = java.lang.Integer.valueOf(argv[i + 1]).intValue();
36 i += 2;
37 } else {
38 System.err.println("Unrecognized option: " + argv[i]);
39 print_help();
40 System.exit(1);
41 }
42 }
43 data = new long[num_tests][num_trials];
44 }
45
46 static void print_help() {
47 System.out.println("java Time\n" + "\t-help print this screen\n" + "\t-num_trials <num> specify number of trials (default: 10)\n"

Callers 1

mainMethod · 0.95

Calls 3

print_helpMethod · 0.95
equalsMethod · 0.45
intValueMethod · 0.45

Tested by

no test coverage detected