22 |
|
static int randomSeed = 3122688; |
23 |
|
|
24 |
|
public static void main(String[] args) throws Exception { |
25 |
< |
Class klass = Class.forName(args[0]); |
25 |
> |
Class<?> klass = Class.forName(args[0]); |
26 |
|
int n = (args.length <= 1) ? DEFAULT_SIZE : Integer.parseInt(args[1]); |
27 |
|
int t = (args.length <= 2) ? DEFAULT_TRIALS : Integer.parseInt(args[2]); |
28 |
|
|
32 |
|
System.out.println(); |
33 |
|
|
34 |
|
Collection<Integer>[] colls = |
35 |
< |
(Collection<Integer>[])new Collection[NC]; |
35 |
> |
(Collection<Integer>[])new Collection<?>[NC]; |
36 |
|
|
37 |
|
for (int k = 0; k < colls.length; ++k) { |
38 |
|
Object x = klass.newInstance(); |
86 |
|
int counts() { |
87 |
|
int count = 0; |
88 |
|
for (int k = 0; k < cs.length; ++k) { |
89 |
< |
for (Iterator it = cs[k].iterator(); it.hasNext();) { |
90 |
< |
if (it.next() != null) |
89 |
> |
for (Integer x : cs[k]) { |
90 |
> |
if (x != null) |
91 |
|
++count; |
92 |
|
} |
93 |
|
} |
122 |
|
try { Thread.sleep(500); } |
123 |
|
catch (Exception ex) { return; } |
124 |
|
} |
125 |
– |
|
126 |
– |
|
125 |
|
} |