Skip to content

Commit a17f939

Browse files
committed
Added the rest of the performance tests
Will probably need tweaking.
1 parent 0346fc7 commit a17f939

12 files changed

Lines changed: 217 additions & 428 deletions

File tree

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// understandingcollections/RandomBounds.java
1+
// control/RandomBounds.java
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
@@ -7,16 +7,9 @@
77
import onjava.*;
88

99
public class RandomBounds {
10-
static void usage() {
11-
System.out.println("Usage:");
12-
System.out.println("\tRandomBounds lower");
13-
System.out.println("\tRandomBounds upper");
14-
System.exit(1);
15-
}
1610
public static void main(String[] args) {
17-
if(args.length != 1) usage();
1811
new TimedAbort(3);
19-
switch(args[0]) {
12+
switch(args.length == 0 ? "" : args[0]) {
2013
case "lower":
2114
while(Math.random() != 0.0)
2215
; // Keep trying
@@ -28,7 +21,10 @@ public static void main(String[] args) {
2821
System.out.println("Produced 1.0!");
2922
break;
3023
default:
31-
usage();
24+
System.out.println("Usage:");
25+
System.out.println("\tRandomBounds lower");
26+
System.out.println("\tRandomBounds upper");
27+
System.exit(1);
3228
}
3329
}
3430
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// understandingcollections/Lists.java
1+
// understandingcollections/ListOps.java
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
// Things you can do with Lists
66
import java.util.*;
77
import onjava.*;
88

9-
public class Lists {
9+
public class ListOps {
1010
private static boolean b;
1111
private static String s;
1212
private static int i;

understandingcollections/ListPerformance.java

Lines changed: 0 additions & 211 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// understandingcollections/Maps.java
1+
// understandingcollections/MapOps.java
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
@@ -7,7 +7,7 @@
77
import java.util.*;
88
import onjava.*;
99

10-
public class Maps {
10+
public class MapOps {
1111
public static void printKeys(Map<Integer,String> map) {
1212
System.out.print("Size = " + map.size() + ", ");
1313
System.out.print("Keys: ");

understandingcollections/SetPerformance.java

Lines changed: 0 additions & 70 deletions
This file was deleted.

understandingcollections/Test.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

understandingcollections/TestParam.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)