32 |
|
if (args.length > 0) { |
33 |
|
try { |
34 |
|
mapClass = Class.forName(args[0]); |
35 |
< |
} catch(ClassNotFoundException e) { |
35 |
> |
} catch (ClassNotFoundException e) { |
36 |
|
throw new RuntimeException("Class " + args[0] + " not found."); |
37 |
|
} |
38 |
|
} |
70 |
|
|
71 |
|
static NavigableMap newMap(Class cl) { |
72 |
|
try { |
73 |
< |
NavigableMap m = (NavigableMap)cl.newInstance(); |
73 |
> |
NavigableMap m = (NavigableMap) cl.newInstance(); |
74 |
|
return m; |
75 |
< |
} catch(Exception e) { |
75 |
> |
} catch (Exception e) { |
76 |
|
throw new RuntimeException("Can't instantiate " + cl + ": " + e); |
77 |
|
} |
78 |
|
} |
254 |
|
int sum = 0; |
255 |
|
timer.start("Iter Key ", size); |
256 |
|
for (Iterator it = s.keySet().iterator(); it.hasNext(); ) { |
257 |
< |
if(it.next() != MISSING) |
257 |
> |
if (it.next() != MISSING) |
258 |
|
++sum; |
259 |
|
} |
260 |
|
timer.finish(); |
265 |
|
int sum = 0; |
266 |
|
timer.start("Iter Value ", size); |
267 |
|
for (Iterator it = s.values().iterator(); it.hasNext(); ) { |
268 |
< |
if(it.next() != MISSING) |
268 |
> |
if (it.next() != MISSING) |
269 |
|
++sum; |
270 |
|
} |
271 |
|
timer.finish(); |
275 |
|
int sum = 0; |
276 |
|
timer.start("Iter Entry ", size); |
277 |
|
for (Iterator it = s.entrySet().iterator(); it.hasNext(); ) { |
278 |
< |
if(it.next() != MISSING) |
278 |
> |
if (it.next() != MISSING) |
279 |
|
++sum; |
280 |
|
} |
281 |
|
timer.finish(); |
292 |
|
int sum = 0; |
293 |
|
timer.start("Desc Iter Key ", size); |
294 |
|
for (Iterator it = s.descendingKeySet().iterator(); it.hasNext(); ) { |
295 |
< |
if(it.next() != MISSING) |
295 |
> |
if (it.next() != MISSING) |
296 |
|
++sum; |
297 |
|
} |
298 |
|
timer.finish(); |
434 |
|
|
435 |
|
static void printStats() { |
436 |
|
for (Iterator it = accum.entrySet().iterator(); it.hasNext(); ) { |
437 |
< |
Map.Entry e = (Map.Entry)(it.next()); |
438 |
< |
Stats stats = ((Stats)(e.getValue())); |
437 |
> |
Map.Entry e = (Map.Entry) it.next(); |
438 |
> |
Stats stats = (Stats) e.getValue(); |
439 |
|
int n = stats.number; |
440 |
|
double t; |
441 |
|
if (n > 0) |
471 |
|
void finish() { |
472 |
|
long endTime = System.currentTimeMillis(); |
473 |
|
long time = endTime - startTime; |
474 |
< |
double timePerOp = ((double)time)/numOps; |
474 |
> |
double timePerOp = (double) time /numOps; |
475 |
|
|
476 |
|
Object st = accum.get(name); |
477 |
|
if (st == null) |