32 |
|
if (args.length > 0) { |
33 |
|
try { |
34 |
|
setClass = 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 NavigableSet newSet(Class cl) { |
72 |
|
try { |
73 |
< |
NavigableSet m = (NavigableSet)cl.newInstance(); |
73 |
> |
NavigableSet m = (NavigableSet) cl.newInstance(); |
74 |
|
return m; |
75 |
< |
} catch(Exception e) { |
75 |
> |
} catch (Exception e) { |
76 |
|
throw new RuntimeException("Can't instantiate " + cl + ": " + e); |
77 |
|
} |
78 |
|
} |
242 |
|
int sum = 0; |
243 |
|
timer.start("Iter Key ", size); |
244 |
|
for (Iterator it = s.iterator(); it.hasNext(); ) { |
245 |
< |
if(it.next() != MISSING) |
245 |
> |
if (it.next() != MISSING) |
246 |
|
++sum; |
247 |
|
} |
248 |
|
timer.finish(); |
257 |
|
int sum = 0; |
258 |
|
timer.start("Desc Iter Key ", size); |
259 |
|
for (Iterator it = s.descendingIterator(); it.hasNext(); ) { |
260 |
< |
if(it.next() != MISSING) |
260 |
> |
if (it.next() != MISSING) |
261 |
|
++sum; |
262 |
|
} |
263 |
|
timer.finish(); |
371 |
|
|
372 |
|
static void printStats() { |
373 |
|
for (Iterator it = accum.entrySet().iterator(); it.hasNext(); ) { |
374 |
< |
Map.Entry e = (Map.Entry)(it.next()); |
375 |
< |
Stats stats = ((Stats)(e.getValue())); |
374 |
> |
Map.Entry e = (Map.Entry) it.next(); |
375 |
> |
Stats stats = (Stats) e.getValue(); |
376 |
|
int n = stats.number; |
377 |
|
double t; |
378 |
|
if (n > 0) |
408 |
|
void finish() { |
409 |
|
long endTime = System.currentTimeMillis(); |
410 |
|
long time = endTime - startTime; |
411 |
< |
double timePerOp = ((double)time)/numOps; |
411 |
> |
double timePerOp = (double) time / numOps; |
412 |
|
|
413 |
|
Object st = accum.get(name); |
414 |
|
if (st == null) |