MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

arrays/TestConvertTo.java:12–68  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

10public class TestConvertTo {
11 static final int SIZE = 6;
12 public static void main(String[] args) {
13 Boolean[] a1 = new Boolean[SIZE];
14 Arrays.setAll(a1, new Rand.Boolean()::get);
15 boolean[] a1p = primitive(a1);
16 show("a1p", a1p);
17 Boolean[] a1b = boxed(a1p);
18 show("a1b", a1b);
19
20 Byte[] a2 = new Byte[SIZE];
21 Arrays.setAll(a2, new Rand.Byte()::get);
22 byte[] a2p = primitive(a2);
23 show("a2p", a2p);
24 Byte[] a2b = boxed(a2p);
25 show("a2b", a2b);
26
27 Character[] a3 = new Character[SIZE];
28 Arrays.setAll(a3, new Rand.Character()::get);
29 char[] a3p = primitive(a3);
30 show("a3p", a3p);
31 Character[] a3b = boxed(a3p);
32 show("a3b", a3b);
33
34 Short[] a4 = new Short[SIZE];
35 Arrays.setAll(a4, new Rand.Short()::get);
36 short[] a4p = primitive(a4);
37 show("a4p", a4p);
38 Short[] a4b = boxed(a4p);
39 show("a4b", a4b);
40
41 Integer[] a5 = new Integer[SIZE];
42 Arrays.setAll(a5, new Rand.Integer()::get);
43 int[] a5p = primitive(a5);
44 show("a5p", a5p);
45 Integer[] a5b = boxed(a5p);
46 show("a5b", a5b);
47
48 Long[] a6 = new Long[SIZE];
49 Arrays.setAll(a6, new Rand.Long()::get);
50 long[] a6p = primitive(a6);
51 show("a6p", a6p);
52 Long[] a6b = boxed(a6p);
53 show("a6b", a6b);
54
55 Float[] a7 = new Float[SIZE];
56 Arrays.setAll(a7, new Rand.Float()::get);
57 float[] a7p = primitive(a7);
58 show("a7p", a7p);
59 Float[] a7b = boxed(a7p);
60 show("a7b", a7b);
61
62 Double[] a8 = new Double[SIZE];
63 Arrays.setAll(a8, new Rand.Double()::get);
64 double[] a8p = primitive(a8);
65 show("a8p", a8p);
66 Double[] a8b = boxed(a8p);
67 show("a8b", a8b);
68 }
69}

Callers

nothing calls this directly

Calls 4

primitiveMethod · 0.80
boxedMethod · 0.80
showMethod · 0.65
setAllMethod · 0.45

Tested by

no test coverage detected