public static void main(String[] args) { CompType[] a = Generated.array(new CompType[12], CompType.generator()); print("before sorting:"); print(Arrays.toString(a)); Arrays.sort(a, new CompTypeComparator()); print("after sorting:"); print(Arrays.toString(a)); }
Tester(String testId, int nReaders, int nWriters) { this.testId = testId + " " + nReaders + "r " + nWriters + "w"; this.nReaders = nReaders; this.nWriters = nWriters; writeData = Generated.array(Integer.class, new RandomGenerator.Integer(), containerSize); for (int i = 0; i < testReps; i++) { runTest(); readTime = 0; writeTime = 0; } }
public static void main(String[] args) { double[] dArray = new double[3]; net.mindview.util.CountingGenerator.Double dl = new net.mindview.util.CountingGenerator.Double(); for (int i = 0; i < 3; i++) { dArray[i] = dl.next(); } System.out.println(Arrays.toString(dArray)); // OR double[] dArray2 = ConvertTo.primitive(Generated.array(Double.class, new CountingGenerator.Double(), 5)); System.out.println(Arrays.toString(dArray2)); }
public static void main(String[] args) { double[] doubles = ConvertTo.primitive(Generated.array(Double.class, new CountingGenerator.Double(), 10)); print(Arrays.toString(doubles)); }