Reorganized

This commit is contained in:
Bruce Eckel 2015-11-03 12:00:44 -08:00
parent 5a25feafef
commit 0edda16067
969 changed files with 2477 additions and 4057 deletions

View File

@ -5,7 +5,7 @@
<description> <description>
Ant build.xml for the source code for chapter ${chapter} Ant build.xml for the source code for chapter ${chapter}
Bruce Eckel on Java Bruce Eckel On Java
Code available at https://github.com/BruceEckel/OnJava-Examples Code available at https://github.com/BruceEckel/OnJava-Examples
See installation instructions in README.md See installation instructions in README.md
See copyright notice in CopyRight.txt See copyright notice in CopyRight.txt

View File

@ -1,5 +1,4 @@
// HelloDate.java // HelloDate.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*; import java.util.*;
public class HelloDate { public class HelloDate {

View File

@ -1,18 +0,0 @@
# *On Java* Code Examples
## Get the Examples ##
[Click here](https://github.com/BruceEckel/OnJava-Examples/archive/master.zip) to download the zip file. Unzip the file into a directory of your choice.
## Build the Examples ##
1. Install the [latest version of Java 8 (JDK8)](http://www.oracle.com/technetwork/java/javase/downloads/index.html). (Use the 32-bit version on Windows because of some library issues).
1. Install Apache Ant. Follow the instructions [here](https://ant.apache.org/manual/install.html#getting).
1. Start a command prompt in the directory where you installed the examples. If your installation is successful, you should be able to type **ant build** and build everything. **ant run** will build AND run the examples. You will initially get some error messages instructing you to install specified packages (jar files), but eventually you should get through the whole build process successfully.
Report bugs in the examples or in the book [here](https://github.com/BruceEckel/OnJava-Examples/issues).
----------
**&copy;2015 Bruce Eckel, MindView LLC. All Rights Reserved. See *Copyright.txt* for usage details.**

View File

@ -1,5 +1,4 @@
// annotations/AtUnitComposition.java // annotations/AtUnitComposition.java
// ©2015 MindView LLC: see Copyright.txt
// Creating non-embedded tests. // Creating non-embedded tests.
package annotations; package annotations;
import com.mindviewinc.atunit.*; import com.mindviewinc.atunit.*;

View File

@ -1,5 +1,4 @@
// annotations/AtUnitExample1.java // annotations/AtUnitExample1.java
// ©2015 MindView LLC: see Copyright.txt
package annotations; package annotations;
import com.mindviewinc.atunit.*; import com.mindviewinc.atunit.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;

View File

@ -1,5 +1,4 @@
// annotations/AtUnitExample2.java // annotations/AtUnitExample2.java
// ©2015 MindView LLC: see Copyright.txt
// Assertions and exceptions can be used in @Tests. // Assertions and exceptions can be used in @Tests.
package annotations; package annotations;
import java.io.*; import java.io.*;

View File

@ -1,5 +1,4 @@
// annotations/AtUnitExample3.java // annotations/AtUnitExample3.java
// ©2015 MindView LLC: see Copyright.txt
package annotations; package annotations;
import com.mindviewinc.atunit.*; import com.mindviewinc.atunit.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;

View File

@ -1,10 +1,8 @@
// annotations/AtUnitExample4.java // annotations/AtUnitExample4.java
// ©2015 MindView LLC: see Copyright.txt
package annotations; package annotations;
import java.util.*; import java.util.*;
import com.mindviewinc.atunit.*; import com.mindviewinc.atunit.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
import static com.mindviewinc.util.Print.*;
public class AtUnitExample4 { public class AtUnitExample4 {
static String theory = "All brontosauruses " + static String theory = "All brontosauruses " +
@ -15,6 +13,7 @@ public class AtUnitExample4 {
public AtUnitExample4(String word) { this.word = word; } public AtUnitExample4(String word) { this.word = word; }
public String getWord() { return word; } public String getWord() { return word; }
public String scrambleWord() { public String scrambleWord() {
// <* Improve this: *>
List<Character> chars = new ArrayList<>(); List<Character> chars = new ArrayList<>();
for(Character c : word.toCharArray()) for(Character c : word.toCharArray())
chars.add(c); chars.add(c);
@ -35,22 +34,22 @@ public class AtUnitExample4 {
return null; return null;
} }
@Test boolean words() { @Test boolean words() {
print("'" + getWord() + "'"); System.out.println("'" + getWord() + "'");
return getWord().equals("are"); return getWord().equals("are");
} }
@Test boolean scramble1() { @Test boolean scramble1() {
// Change to a specific seed to get verifiable results: // Change to a specific seed to get verifiable results:
rand = new Random(47); rand = new Random(47);
print("'" + getWord() + "'"); System.out.println("'" + getWord() + "'");
String scrambled = scrambleWord(); String scrambled = scrambleWord();
print(scrambled); System.out.println(scrambled);
return scrambled.equals("lAl"); return scrambled.equals("lAl");
} }
@Test boolean scramble2() { @Test boolean scramble2() {
rand = new Random(74); rand = new Random(74);
print("'" + getWord() + "'"); System.out.println("'" + getWord() + "'");
String scrambled = scrambleWord(); String scrambled = scrambleWord();
print(scrambled); System.out.println(scrambled);
return scrambled.equals("tsaeborornussu"); return scrambled.equals("tsaeborornussu");
} }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {

View File

@ -1,5 +1,4 @@
// annotations/AtUnitExample5.java // annotations/AtUnitExample5.java
// ©2015 MindView LLC: see Copyright.txt
package annotations; package annotations;
import java.io.*; import java.io.*;
import com.mindviewinc.atunit.*; import com.mindviewinc.atunit.*;

View File

@ -1,5 +1,4 @@
// annotations/AtUnitExternalTest.java // annotations/AtUnitExternalTest.java
// ©2015 MindView LLC: see Copyright.txt
// Creating non-embedded tests. // Creating non-embedded tests.
package annotations; package annotations;
import com.mindviewinc.atunit.*; import com.mindviewinc.atunit.*;

View File

@ -1,5 +1,4 @@
// annotations/HashSetTest.java // annotations/HashSetTest.java
// ©2015 MindView LLC: see Copyright.txt
package annotations; package annotations;
import java.util.*; import java.util.*;
import com.mindviewinc.atunit.*; import com.mindviewinc.atunit.*;

View File

@ -1,5 +1,4 @@
// annotations/PasswordUtils.java // annotations/PasswordUtils.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*; import java.util.*;
public class PasswordUtils { public class PasswordUtils {

View File

@ -1,5 +1,4 @@
// annotations/SimulatingNull.java // annotations/SimulatingNull.java
// ©2015 MindView LLC: see Copyright.txt
import java.lang.annotation.*; import java.lang.annotation.*;
@Target(ElementType.METHOD) @Target(ElementType.METHOD)

View File

@ -1,5 +1,4 @@
// annotations/StackL.java // annotations/StackL.java
// ©2015 MindView LLC: see Copyright.txt
// A stack built on a linkedList. // A stack built on a linkedList.
package annotations; package annotations;
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// annotations/StackLStringTest.java // annotations/StackLStringTest.java
// ©2015 MindView LLC: see Copyright.txt
// Applying @Unit to generics. // Applying @Unit to generics.
package annotations; package annotations;
import com.mindviewinc.atunit.*; import com.mindviewinc.atunit.*;

View File

@ -1,5 +1,4 @@
// annotations/Testable.java // annotations/Testable.java
// ©2015 MindView LLC: see Copyright.txt
package annotations; package annotations;
import com.mindviewinc.atunit.*; import com.mindviewinc.atunit.*;

View File

@ -1,5 +1,4 @@
// annotations/UseCase.java // annotations/UseCase.java
// ©2015 MindView LLC: see Copyright.txt
import java.lang.annotation.*; import java.lang.annotation.*;
@Target(ElementType.METHOD) @Target(ElementType.METHOD)

View File

@ -1,5 +1,4 @@
// annotations/UseCaseTracker.java // annotations/UseCaseTracker.java
// ©2015 MindView LLC: see Copyright.txt
import java.lang.reflect.*; import java.lang.reflect.*;
import java.util.*; import java.util.*;
@ -19,6 +18,7 @@ public class UseCaseTracker {
} }
} }
public static void main(String[] args) { public static void main(String[] args) {
// <* Can't use Arrays.asList() for some reason *>
List<Integer> useCases = new ArrayList<>(); List<Integer> useCases = new ArrayList<>();
Collections.addAll(useCases, 47, 48, 49, 50); Collections.addAll(useCases, 47, 48, 49, 50);
trackUseCases(useCases, PasswordUtils.class); trackUseCases(useCases, PasswordUtils.class);

View File

@ -1,5 +1,4 @@
// annotations/database/Constraints.java // annotations/database/Constraints.java
// ©2015 MindView LLC: see Copyright.txt
package annotations.database; package annotations.database;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,4 @@
// annotations/database/DBTable.java // annotations/database/DBTable.java
// ©2015 MindView LLC: see Copyright.txt
package annotations.database; package annotations.database;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,4 @@
// annotations/database/Member.java // annotations/database/Member.java
// ©2015 MindView LLC: see Copyright.txt
package annotations.database; package annotations.database;
@DBTable(name = "MEMBER") @DBTable(name = "MEMBER")

View File

@ -1,5 +1,4 @@
// annotations/database/SQLInteger.java // annotations/database/SQLInteger.java
// ©2015 MindView LLC: see Copyright.txt
package annotations.database; package annotations.database;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,4 @@
// annotations/database/SQLString.java // annotations/database/SQLString.java
// ©2015 MindView LLC: see Copyright.txt
package annotations.database; package annotations.database;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,4 @@
// annotations/database/TableCreator.java // annotations/database/TableCreator.java
// ©2015 MindView LLC: see Copyright.txt
// Reflection-based annotation processor. // Reflection-based annotation processor.
// {Args: annotations.database.Member} // {Args: annotations.database.Member}
package annotations.database; package annotations.database;

View File

@ -1,5 +1,4 @@
// annotations/database/Uniqueness.java // annotations/database/Uniqueness.java
// ©2015 MindView LLC: see Copyright.txt
// Sample of nested annotations // Sample of nested annotations
package annotations.database; package annotations.database;

View File

@ -1,5 +1,4 @@
// annotations/ifx/ExtractInterface.java // annotations/ifx/ExtractInterface.java
// ©2015 MindView LLC: see Copyright.txt
// javac-based annotation processing. // javac-based annotation processing.
package annotations.ifx; package annotations.ifx;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,4 @@
// annotations/ifx/IfaceExtractorProcessor.java // annotations/ifx/IfaceExtractorProcessor.java
// ©2015 MindView LLC: see Copyright.txt
// javac-based annotation processing. // javac-based annotation processing.
package annotations.ifx; package annotations.ifx;
import javax.annotation.processing.*; import javax.annotation.processing.*;

View File

@ -1,5 +1,4 @@
// annotations/ifx/Multiplier.java // annotations/ifx/Multiplier.java
// ©2015 MindView LLC: see Copyright.txt
// javac-based annotation processing. // javac-based annotation processing.
package annotations.ifx; package annotations.ifx;

View File

@ -1,5 +1,4 @@
// annotations/simplest/Simple.java // annotations/simplest/Simple.java
// ©2015 MindView LLC: see Copyright.txt
// A bare-bones annotation. // A bare-bones annotation.
package annotations.simplest; package annotations.simplest;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@ -1,5 +1,4 @@
// annotations/simplest/SimpleProcessor.java // annotations/simplest/SimpleProcessor.java
// ©2015 MindView LLC: see Copyright.txt
// A bare-bones annotation processor. // A bare-bones annotation processor.
package annotations.simplest; package annotations.simplest;
import javax.annotation.processing.*; import javax.annotation.processing.*;

View File

@ -1,5 +1,4 @@
// annotations/simplest/SimpleTest.java // annotations/simplest/SimpleTest.java
// ©2015 MindView LLC: see Copyright.txt
// Test the "Simple" annotation // Test the "Simple" annotation
package annotations.simplest; package annotations.simplest;

View File

@ -1,5 +1,4 @@
// arrays/AlphabeticSearch.java // arrays/AlphabeticSearch.java
// ©2015 MindView LLC: see Copyright.txt
// Searching with a Comparator. // Searching with a Comparator.
import java.util.*; import java.util.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
@ -7,7 +6,7 @@ import com.mindviewinc.util.*;
public class AlphabeticSearch { public class AlphabeticSearch {
public static void main(String[] args) { public static void main(String[] args) {
String[] sa = Generated.array(new String[30], String[] sa = Generated.array(new String[30],
new RandomGenerator.String(5)); new RandomSupplier.String(5));
Arrays.sort(sa, String.CASE_INSENSITIVE_ORDER); Arrays.sort(sa, String.CASE_INSENSITIVE_ORDER);
System.out.println(Arrays.toString(sa)); System.out.println(Arrays.toString(sa));
int index = Arrays.binarySearch(sa, sa[10], int index = Arrays.binarySearch(sa, sa[10],

View File

@ -1,5 +1,4 @@
// arrays/ArrayOfGenericType.java // arrays/ArrayOfGenericType.java
// ©2015 MindView LLC: see Copyright.txt
// Arrays of generic types won't compile. // Arrays of generic types won't compile.
public class ArrayOfGenericType<T> { public class ArrayOfGenericType<T> {

View File

@ -1,5 +1,4 @@
// arrays/ArrayOfGenerics.java // arrays/ArrayOfGenerics.java
// ©2015 MindView LLC: see Copyright.txt
// It is possible to create arrays of generics. // It is possible to create arrays of generics.
import java.util.*; import java.util.*;

View File

@ -1,8 +1,6 @@
// arrays/ArrayOptions.java // arrays/ArrayOptions.java
// ©2015 MindView LLC: see Copyright.txt
// Initialization & re-assignment of arrays. // Initialization & re-assignment of arrays.
import java.util.*; import java.util.*;
import static com.mindviewinc.util.Print.*;
public class ArrayOptions { public class ArrayOptions {
public static void main(String[] args) { public static void main(String[] args) {
@ -11,7 +9,7 @@ public class ArrayOptions {
BerylliumSphere[] b = new BerylliumSphere[5]; BerylliumSphere[] b = new BerylliumSphere[5];
// The references inside the array are // The references inside the array are
// automatically initialized to null: // automatically initialized to null:
print("b: " + Arrays.toString(b)); System.out.println("b: " + Arrays.toString(b));
BerylliumSphere[] c = new BerylliumSphere[4]; BerylliumSphere[] c = new BerylliumSphere[4];
for(int i = 0; i < c.length; i++) for(int i = 0; i < c.length; i++)
if(c[i] == null) // Can test for null reference if(c[i] == null) // Can test for null reference
@ -25,32 +23,32 @@ public class ArrayOptions {
new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere(),
}; };
// (Trailing comma is optional in both cases) // (Trailing comma is optional in both cases)
print("a.length = " + a.length); System.out.println("a.length = " + a.length);
print("b.length = " + b.length); System.out.println("b.length = " + b.length);
print("c.length = " + c.length); System.out.println("c.length = " + c.length);
print("d.length = " + d.length); System.out.println("d.length = " + d.length);
a = d; a = d;
print("a.length = " + a.length); System.out.println("a.length = " + a.length);
// Arrays of primitives: // Arrays of primitives:
int[] e; // Null reference int[] e; // Null reference
int[] f = new int[5]; int[] f = new int[5];
// The primitives inside the array are // The primitives inside the array are
// automatically initialized to zero: // automatically initialized to zero:
print("f: " + Arrays.toString(f)); System.out.println("f: " + Arrays.toString(f));
int[] g = new int[4]; int[] g = new int[4];
for(int i = 0; i < g.length; i++) for(int i = 0; i < g.length; i++)
g[i] = i*i; g[i] = i*i;
int[] h = { 11, 47, 93 }; int[] h = { 11, 47, 93 };
// Compile error: variable e not initialized: // Compile error: variable e not initialized:
//!print("e.length = " + e.length); //!print("e.length = " + e.length);
print("f.length = " + f.length); System.out.println("f.length = " + f.length);
print("g.length = " + g.length); System.out.println("g.length = " + g.length);
print("h.length = " + h.length); System.out.println("h.length = " + h.length);
e = h; e = h;
print("e.length = " + e.length); System.out.println("e.length = " + e.length);
e = new int[]{ 1, 2 }; e = new int[]{ 1, 2 };
print("e.length = " + e.length); System.out.println("e.length = " + e.length);
} }
} }
/* Output: /* Output:

View File

@ -1,23 +1,22 @@
// arrays/ArraySearching.java // arrays/ArraySearching.java
// ©2015 MindView LLC: see Copyright.txt
// Using Arrays.binarySearch(). // Using Arrays.binarySearch().
import java.util.*; import java.util.*;
import java.util.function.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
import static com.mindviewinc.util.Print.*;
public class ArraySearching { public class ArraySearching {
public static void main(String[] args) { public static void main(String[] args) {
Generator<Integer> gen = Supplier<Integer> gen =
new RandomGenerator.Integer(1000); new RandomSupplier.Integer(1000);
int[] a = ConvertTo.primitive( int[] a = ConvertTo.primitive(
Generated.array(new Integer[25], gen)); Generated.array(new Integer[25], gen));
Arrays.sort(a); Arrays.sort(a);
print("Sorted array: " + Arrays.toString(a)); System.out.println("Sorted array: " + Arrays.toString(a));
while(true) { while(true) {
int r = gen.next(); int r = gen.get();
int location = Arrays.binarySearch(a, r); int location = Arrays.binarySearch(a, r);
if(location >= 0) { if(location >= 0) {
print("Location of " + r + " is " + location + System.out.println("Location of " + r + " is " + location +
", a[" + location + "] = " + a[location]); ", a[" + location + "] = " + a[location]);
break; // Out of while loop break; // Out of while loop
} }

View File

@ -1,5 +1,4 @@
// arrays/AssemblingMultidimensionalArrays.java // arrays/AssemblingMultidimensionalArrays.java
// ©2015 MindView LLC: see Copyright.txt
// Creating multidimensional arrays. // Creating multidimensional arrays.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// arrays/AutoboxingArrays.java // arrays/AutoboxingArrays.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*; import java.util.*;
public class AutoboxingArrays { public class AutoboxingArrays {

View File

@ -1,9 +1,8 @@
// arrays/CompType.java // arrays/CompType.java
// ©2015 MindView LLC: see Copyright.txt
// Implementing Comparable in a class. // Implementing Comparable in a class.
import java.util.*; import java.util.*;
import java.util.function.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
import static com.mindviewinc.util.Print.*;
public class CompType implements Comparable<CompType> { public class CompType implements Comparable<CompType> {
int i; int i;
@ -25,18 +24,18 @@ public class CompType implements Comparable<CompType> {
return (i < rv.i ? -1 : (i == rv.i ? 0 : 1)); return (i < rv.i ? -1 : (i == rv.i ? 0 : 1));
} }
private static Random r = new Random(47); private static Random r = new Random(47);
public static Generator<CompType> generator() { public static Supplier<CompType> generator() {
return () -> return () ->
new CompType(r.nextInt(100), r.nextInt(100)); new CompType(r.nextInt(100), r.nextInt(100));
} }
public static void main(String[] args) { public static void main(String[] args) {
CompType[] a = CompType[] a =
Generated.array(new CompType[12], generator()); Generated.array(new CompType[12], generator());
print("before sorting:"); System.out.println("before sorting:");
print(Arrays.toString(a)); System.out.println(Arrays.toString(a));
Arrays.sort(a); Arrays.sort(a);
print("after sorting:"); System.out.println("after sorting:");
print(Arrays.toString(a)); System.out.println(Arrays.toString(a));
} }
} }
/* Output: /* Output:

View File

@ -1,9 +1,7 @@
// arrays/ComparatorTest.java // arrays/ComparatorTest.java
// ©2015 MindView LLC: see Copyright.txt
// Implementing a Comparator for a class. // Implementing a Comparator for a class.
import java.util.*; import java.util.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
import static com.mindviewinc.util.Print.*;
class CompTypeComparator implements Comparator<CompType> { class CompTypeComparator implements Comparator<CompType> {
public int compare(CompType o1, CompType o2) { public int compare(CompType o1, CompType o2) {
@ -15,11 +13,11 @@ public class ComparatorTest {
public static void main(String[] args) { public static void main(String[] args) {
CompType[] a = Generated.array( CompType[] a = Generated.array(
new CompType[12], CompType.generator()); new CompType[12], CompType.generator());
print("before sorting:"); System.out.println("before sorting:");
print(Arrays.toString(a)); System.out.println(Arrays.toString(a));
Arrays.sort(a, new CompTypeComparator()); Arrays.sort(a, new CompTypeComparator());
print("after sorting:"); System.out.println("after sorting:");
print(Arrays.toString(a)); System.out.println(Arrays.toString(a));
} }
} }
/* Output: /* Output:

View File

@ -1,8 +1,6 @@
// arrays/ComparingArrays.java // arrays/ComparingArrays.java
// Š2015 MindView LLC: see Copyright.txt
// Using Arrays.equals() // Using Arrays.equals()
import java.util.*; import java.util.*;
import static com.mindviewinc.util.Print.*;
public class ComparingArrays { public class ComparingArrays {
public static void main(String[] args) { public static void main(String[] args) {
@ -10,14 +8,14 @@ public class ComparingArrays {
int[] a2 = new int[10]; int[] a2 = new int[10];
Arrays.fill(a1, 47); Arrays.fill(a1, 47);
Arrays.fill(a2, 47); Arrays.fill(a2, 47);
print(Arrays.equals(a1, a2)); System.out.println(Arrays.equals(a1, a2));
a2[3] = 11; a2[3] = 11;
print(Arrays.equals(a1, a2)); System.out.println(Arrays.equals(a1, a2));
String[] s1 = new String[4]; String[] s1 = new String[4];
Arrays.fill(s1, "Hi"); Arrays.fill(s1, "Hi");
String[] s2 = { new String("Hi"), new String("Hi"), String[] s2 = { new String("Hi"), new String("Hi"),
new String("Hi"), new String("Hi") }; new String("Hi"), new String("Hi") };
print(Arrays.equals(s1, s2)); System.out.println(Arrays.equals(s1, s2));
} }
} }
/* Output: /* Output:

View File

@ -1,7 +1,5 @@
// arrays/ContainerComparison.java // arrays/ContainerComparison.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*; import java.util.*;
import static com.mindviewinc.util.Print.*;
class BerylliumSphere { class BerylliumSphere {
private static long counter; private static long counter;
@ -15,24 +13,24 @@ public class ContainerComparison {
BerylliumSphere[] spheres = new BerylliumSphere[10]; BerylliumSphere[] spheres = new BerylliumSphere[10];
for(int i = 0; i < 5; i++) for(int i = 0; i < 5; i++)
spheres[i] = new BerylliumSphere(); spheres[i] = new BerylliumSphere();
print(Arrays.toString(spheres)); System.out.println(Arrays.toString(spheres));
print(spheres[4]); System.out.println(spheres[4]);
List<BerylliumSphere> sphereList= new ArrayList<>(); List<BerylliumSphere> sphereList= new ArrayList<>();
for(int i = 0; i < 5; i++) for(int i = 0; i < 5; i++)
sphereList.add(new BerylliumSphere()); sphereList.add(new BerylliumSphere());
print(sphereList); System.out.println(sphereList);
print(sphereList.get(4)); System.out.println(sphereList.get(4));
int[] integers = { 0, 1, 2, 3, 4, 5 }; int[] integers = { 0, 1, 2, 3, 4, 5 };
print(Arrays.toString(integers)); System.out.println(Arrays.toString(integers));
print(integers[4]); System.out.println(integers[4]);
List<Integer> intList = new ArrayList<>( List<Integer> intList = new ArrayList<>(
Arrays.asList(0, 1, 2, 3, 4, 5)); Arrays.asList(0, 1, 2, 3, 4, 5));
intList.add(97); intList.add(97);
print(intList); System.out.println(intList);
print(intList.get(4)); System.out.println(intList.get(4));
} }
} }
/* Output: /* Output:

View File

@ -1,8 +1,6 @@
// arrays/CopyingArrays.java // arrays/CopyingArrays.java
// ©2015 MindView LLC: see Copyright.txt
// Using System.arraycopy() // Using System.arraycopy()
import java.util.*; import java.util.*;
import static com.mindviewinc.util.Print.*;
public class CopyingArrays { public class CopyingArrays {
public static void main(String[] args) { public static void main(String[] args) {
@ -10,26 +8,26 @@ public class CopyingArrays {
int[] j = new int[10]; int[] j = new int[10];
Arrays.fill(i, 47); Arrays.fill(i, 47);
Arrays.fill(j, 99); Arrays.fill(j, 99);
print("i = " + Arrays.toString(i)); System.out.println("i = " + Arrays.toString(i));
print("j = " + Arrays.toString(j)); System.out.println("j = " + Arrays.toString(j));
System.arraycopy(i, 0, j, 0, i.length); System.arraycopy(i, 0, j, 0, i.length);
print("j = " + Arrays.toString(j)); System.out.println("j = " + Arrays.toString(j));
int[] k = new int[5]; int[] k = new int[5];
Arrays.fill(k, 103); Arrays.fill(k, 103);
System.arraycopy(i, 0, k, 0, k.length); System.arraycopy(i, 0, k, 0, k.length);
print("k = " + Arrays.toString(k)); System.out.println("k = " + Arrays.toString(k));
Arrays.fill(k, 103); Arrays.fill(k, 103);
System.arraycopy(k, 0, i, 0, k.length); System.arraycopy(k, 0, i, 0, k.length);
print("i = " + Arrays.toString(i)); System.out.println("i = " + Arrays.toString(i));
// Objects: // Objects:
Integer[] u = new Integer[10]; Integer[] u = new Integer[10];
Integer[] v = new Integer[5]; Integer[] v = new Integer[5];
Arrays.fill(u, 47); Arrays.fill(u, 47);
Arrays.fill(v, 99); Arrays.fill(v, 99);
print("u = " + Arrays.toString(u)); System.out.println("u = " + Arrays.toString(u));
print("v = " + Arrays.toString(v)); System.out.println("v = " + Arrays.toString(v));
System.arraycopy(v, 0, u, u.length/2, v.length); System.arraycopy(v, 0, u, u.length/2, v.length);
print("u = " + Arrays.toString(u)); System.out.println("u = " + Arrays.toString(u));
} }
} }
/* Output: /* Output:

View File

@ -1,8 +1,6 @@
// arrays/FillingArrays.java // arrays/FillingArrays.java
// ©2015 MindView LLC: see Copyright.txt
// Using Arrays.fill() // Using Arrays.fill()
import java.util.*; import java.util.*;
import static com.mindviewinc.util.Print.*;
public class FillingArrays { public class FillingArrays {
public static void main(String[] args) { public static void main(String[] args) {
@ -17,26 +15,26 @@ public class FillingArrays {
double[] a8 = new double[size]; double[] a8 = new double[size];
String[] a9 = new String[size]; String[] a9 = new String[size];
Arrays.fill(a1, true); Arrays.fill(a1, true);
print("a1 = " + Arrays.toString(a1)); System.out.println("a1 = " + Arrays.toString(a1));
Arrays.fill(a2, (byte)11); Arrays.fill(a2, (byte)11);
print("a2 = " + Arrays.toString(a2)); System.out.println("a2 = " + Arrays.toString(a2));
Arrays.fill(a3, 'x'); Arrays.fill(a3, 'x');
print("a3 = " + Arrays.toString(a3)); System.out.println("a3 = " + Arrays.toString(a3));
Arrays.fill(a4, (short)17); Arrays.fill(a4, (short)17);
print("a4 = " + Arrays.toString(a4)); System.out.println("a4 = " + Arrays.toString(a4));
Arrays.fill(a5, 19); Arrays.fill(a5, 19);
print("a5 = " + Arrays.toString(a5)); System.out.println("a5 = " + Arrays.toString(a5));
Arrays.fill(a6, 23); Arrays.fill(a6, 23);
print("a6 = " + Arrays.toString(a6)); System.out.println("a6 = " + Arrays.toString(a6));
Arrays.fill(a7, 29); Arrays.fill(a7, 29);
print("a7 = " + Arrays.toString(a7)); System.out.println("a7 = " + Arrays.toString(a7));
Arrays.fill(a8, 47); Arrays.fill(a8, 47);
print("a8 = " + Arrays.toString(a8)); System.out.println("a8 = " + Arrays.toString(a8));
Arrays.fill(a9, "Hello"); Arrays.fill(a9, "Hello");
print("a9 = " + Arrays.toString(a9)); System.out.println("a9 = " + Arrays.toString(a9));
// Manipulating ranges: // Manipulating ranges:
Arrays.fill(a9, 3, 5, "World"); Arrays.fill(a9, 3, 5, "World");
print("a9 = " + Arrays.toString(a9)); System.out.println("a9 = " + Arrays.toString(a9));
} }
} }
/* Output: /* Output:

View File

@ -1,5 +1,4 @@
// arrays/IceCream.java // arrays/IceCream.java
// ©2015 MindView LLC: see Copyright.txt
// Returning arrays from methods. // Returning arrays from methods.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// arrays/MultiDimWrapperArray.java // arrays/MultiDimWrapperArray.java
// ©2015 MindView LLC: see Copyright.txt
// Multidimensional arrays of "wrapper" objects. // Multidimensional arrays of "wrapper" objects.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// arrays/MultidimensionalObjectArrays.java // arrays/MultidimensionalObjectArrays.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*; import java.util.*;
public class MultidimensionalObjectArrays { public class MultidimensionalObjectArrays {

View File

@ -1,5 +1,4 @@
// arrays/MultidimensionalPrimitiveArray.java // arrays/MultidimensionalPrimitiveArray.java
// ©2015 MindView LLC: see Copyright.txt
// Creating multidimensional arrays. // Creating multidimensional arrays.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// arrays/ParameterizedArrayType.java // arrays/ParameterizedArrayType.java
// ©2015 MindView LLC: see Copyright.txt
class ClassParameter<T> { class ClassParameter<T> {
public T[] f(T[] arg) { return arg; } public T[] f(T[] arg) { return arg; }

View File

@ -1,17 +1,16 @@
// arrays/PrimitiveConversionDemonstration.java // arrays/PrimitiveConversionDemonstration.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*; import java.util.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
public class PrimitiveConversionDemonstration { public class PrimitiveConversionDemonstration {
public static void main(String[] args) { public static void main(String[] args) {
Integer[] a = Generated.array(Integer.class, Integer[] a = Generated.array(Integer.class,
new CountingGenerator.Integer(), 15); new CountingSupplier.Integer(), 15);
int[] b = ConvertTo.primitive(a); int[] b = ConvertTo.primitive(a);
System.out.println(Arrays.toString(b)); System.out.println(Arrays.toString(b));
boolean[] c = ConvertTo.primitive( boolean[] c = ConvertTo.primitive(
Generated.array(Boolean.class, Generated.array(Boolean.class,
new CountingGenerator.Boolean(), 7)); new CountingSupplier.Boolean(), 7));
System.out.println(Arrays.toString(c)); System.out.println(Arrays.toString(c));
} }
} }

View File

@ -1,5 +1,4 @@
# arrays/PythonLists.py # arrays/PythonLists.py
# ©2015 MindView LLC: see Copyright.txt
aList = [1, 2, 3, 4, 5] aList = [1, 2, 3, 4, 5]
print(type(aList)) # <type 'list'> print(type(aList)) # <type 'list'>
@ -22,4 +21,3 @@ class MyList(list): # Inherit from list
list2 = MyList(aList) list2 = MyList(aList)
print(type(list2)) # <class '__main__.MyList'> print(type(list2)) # <class '__main__.MyList'>
print(list2.getReversed()) # [8, 7, 6, 5, 4, 3, 2, 1] print(list2.getReversed()) # [8, 7, 6, 5, 4, 3, 2, 1]
#>

View File

@ -1,5 +1,4 @@
// arrays/RaggedArray.java // arrays/RaggedArray.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*; import java.util.*;
public class RaggedArray { public class RaggedArray {

View File

@ -1,10 +1,9 @@
// arrays/RandomGeneratorsTest.java // arrays/RandomSuppliersTest.java
// ©2015 MindView LLC: see Copyright.txt
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
public class RandomGeneratorsTest { public class RandomSuppliersTest {
public static void main(String[] args) { public static void main(String[] args) {
GeneratorsTest.test(RandomGenerator.class); SuppliersTest.test(RandomSupplier.class);
} }
} }
/* Output: /* Output:

View File

@ -1,19 +1,17 @@
// arrays/Reverse.java // arrays/Reverse.java
// ©2015 MindView LLC: see Copyright.txt
// The Collections.reverseOrder() Comparator // The Collections.reverseOrder() Comparator
import java.util.*; import java.util.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
import static com.mindviewinc.util.Print.*;
public class Reverse { public class Reverse {
public static void main(String[] args) { public static void main(String[] args) {
CompType[] a = Generated.array( CompType[] a = Generated.array(
new CompType[12], CompType.generator()); new CompType[12], CompType.generator());
print("before sorting:"); System.out.println("before sorting:");
print(Arrays.toString(a)); System.out.println(Arrays.toString(a));
Arrays.sort(a, Collections.reverseOrder()); Arrays.sort(a, Collections.reverseOrder());
print("after sorting:"); System.out.println("after sorting:");
print(Arrays.toString(a)); System.out.println(Arrays.toString(a));
} }
} }
/* Output: /* Output:

View File

@ -1,21 +1,19 @@
// arrays/StringSorting.java // arrays/StringSorting.java
// ©2015 MindView LLC: see Copyright.txt
// Sorting an array of Strings. // Sorting an array of Strings.
import java.util.*; import java.util.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
import static com.mindviewinc.util.Print.*;
public class StringSorting { public class StringSorting {
public static void main(String[] args) { public static void main(String[] args) {
String[] sa = Generated.array(new String[20], String[] sa = Generated.array(new String[20],
new RandomGenerator.String(5)); new RandomSupplier.String(5));
print("Before sort: " + Arrays.toString(sa)); System.out.println("Before sort: " + Arrays.toString(sa));
Arrays.sort(sa); Arrays.sort(sa);
print("After sort: " + Arrays.toString(sa)); System.out.println("After sort: " + Arrays.toString(sa));
Arrays.sort(sa, Collections.reverseOrder()); Arrays.sort(sa, Collections.reverseOrder());
print("Reverse sort: " + Arrays.toString(sa)); System.out.println("Reverse sort: " + Arrays.toString(sa));
Arrays.sort(sa, String.CASE_INSENSITIVE_ORDER); Arrays.sort(sa, String.CASE_INSENSITIVE_ORDER);
print("Case-insensitive sort: " + Arrays.toString(sa)); System.out.println("Case-insensitive sort: " + Arrays.toString(sa));
} }
} }
/* Output: /* Output:

View File

@ -1,16 +1,16 @@
// arrays/GeneratorsTest.java // arrays/SuppliersTest.java
// ©2015 MindView LLC: see Copyright.txt import java.util.function.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
public class GeneratorsTest { public class SuppliersTest {
public static int size = 10; public static int size = 10;
public static void test(Class<?> surroundingClass) { public static void test(Class<?> surroundingClass) {
for(Class<?> type : surroundingClass.getClasses()) { for(Class<?> type : surroundingClass.getClasses()) {
System.out.print(type.getSimpleName() + ": "); System.out.print(type.getSimpleName() + ": ");
try { try {
Generator<?> g = (Generator<?>)type.newInstance(); Supplier<?> g = (Supplier<?>)type.newInstance();
for(int i = 0; i < size; i++) for(int i = 0; i < size; i++)
System.out.printf(g.next() + " "); System.out.printf(g.get() + " ");
System.out.println(); System.out.println();
} catch(InstantiationException | } catch(InstantiationException |
IllegalAccessException e) { IllegalAccessException e) {
@ -19,7 +19,7 @@ public class GeneratorsTest {
} }
} }
public static void main(String[] args) { public static void main(String[] args) {
test(CountingGenerator.class); test(CountingSupplier.class);
} }
} }
/* Output: /* Output:

View File

@ -1,38 +1,36 @@
// arrays/TestArrayGeneration.java // arrays/TestArrayGeneration.java
// ©2015 MindView LLC: see Copyright.txt
// Test the tools that use generators to fill arrays. // Test the tools that use generators to fill arrays.
import java.util.*; import java.util.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
import static com.mindviewinc.util.Print.*;
public class TestArrayGeneration { public class TestArrayGeneration {
public static void main(String[] args) { public static void main(String[] args) {
int size = 6; int size = 6;
boolean[] a1 = ConvertTo.primitive(Generated.array( boolean[] a1 = ConvertTo.primitive(Generated.array(
Boolean.class, new RandomGenerator.Boolean(), size)); Boolean.class, new RandomSupplier.Boolean(), size));
print("a1 = " + Arrays.toString(a1)); System.out.println("a1 = " + Arrays.toString(a1));
byte[] a2 = ConvertTo.primitive(Generated.array( byte[] a2 = ConvertTo.primitive(Generated.array(
Byte.class, new RandomGenerator.Byte(), size)); Byte.class, new RandomSupplier.Byte(), size));
print("a2 = " + Arrays.toString(a2)); System.out.println("a2 = " + Arrays.toString(a2));
char[] a3 = ConvertTo.primitive(Generated.array( char[] a3 = ConvertTo.primitive(Generated.array(
Character.class, Character.class,
new RandomGenerator.Character(), size)); new RandomSupplier.Character(), size));
print("a3 = " + Arrays.toString(a3)); System.out.println("a3 = " + Arrays.toString(a3));
short[] a4 = ConvertTo.primitive(Generated.array( short[] a4 = ConvertTo.primitive(Generated.array(
Short.class, new RandomGenerator.Short(), size)); Short.class, new RandomSupplier.Short(), size));
print("a4 = " + Arrays.toString(a4)); System.out.println("a4 = " + Arrays.toString(a4));
int[] a5 = ConvertTo.primitive(Generated.array( int[] a5 = ConvertTo.primitive(Generated.array(
Integer.class, new RandomGenerator.Integer(), size)); Integer.class, new RandomSupplier.Integer(), size));
print("a5 = " + Arrays.toString(a5)); System.out.println("a5 = " + Arrays.toString(a5));
long[] a6 = ConvertTo.primitive(Generated.array( long[] a6 = ConvertTo.primitive(Generated.array(
Long.class, new RandomGenerator.Long(), size)); Long.class, new RandomSupplier.Long(), size));
print("a6 = " + Arrays.toString(a6)); System.out.println("a6 = " + Arrays.toString(a6));
float[] a7 = ConvertTo.primitive(Generated.array( float[] a7 = ConvertTo.primitive(Generated.array(
Float.class, new RandomGenerator.Float(), size)); Float.class, new RandomSupplier.Float(), size));
print("a7 = " + Arrays.toString(a7)); System.out.println("a7 = " + Arrays.toString(a7));
double[] a8 = ConvertTo.primitive(Generated.array( double[] a8 = ConvertTo.primitive(Generated.array(
Double.class, new RandomGenerator.Double(), size)); Double.class, new RandomSupplier.Double(), size));
print("a8 = " + Arrays.toString(a8)); System.out.println("a8 = " + Arrays.toString(a8));
} }
} }
/* Output: /* Output:

View File

@ -1,5 +1,4 @@
// arrays/TestGenerated.java // arrays/TestGenerated.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*; import java.util.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
@ -7,10 +6,10 @@ public class TestGenerated {
public static void main(String[] args) { public static void main(String[] args) {
Integer[] a = { 9, 8, 7, 6 }; Integer[] a = { 9, 8, 7, 6 };
System.out.println(Arrays.toString(a)); System.out.println(Arrays.toString(a));
a = Generated.array(a, new CountingGenerator.Integer()); a = Generated.array(a, new CountingSupplier.Integer());
System.out.println(Arrays.toString(a)); System.out.println(Arrays.toString(a));
Integer[] b = Generated.array(Integer.class, Integer[] b = Generated.array(Integer.class,
new CountingGenerator.Integer(), 15); new CountingSupplier.Integer(), 15);
System.out.println(Arrays.toString(b)); System.out.println(Arrays.toString(b));
} }
} }

View File

@ -1,5 +1,4 @@
// arrays/ThreeDWithNew.java // arrays/ThreeDWithNew.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*; import java.util.*;
public class ThreeDWithNew { public class ThreeDWithNew {

View File

@ -19,7 +19,6 @@
<jrun cls="ContainerComparison" /> <jrun cls="ContainerComparison" />
<jrun cls="CopyingArrays" /> <jrun cls="CopyingArrays" />
<jrun cls="FillingArrays" /> <jrun cls="FillingArrays" />
<jrun cls="GeneratorsTest" />
<jrun cls="IceCream" /> <jrun cls="IceCream" />
<jrun cls="MultidimensionalObjectArrays" /> <jrun cls="MultidimensionalObjectArrays" />
<jrun cls="MultidimensionalPrimitiveArray" /> <jrun cls="MultidimensionalPrimitiveArray" />
@ -27,9 +26,10 @@
<jrun cls="ParameterizedArrayType" /> <jrun cls="ParameterizedArrayType" />
<jrun cls="PrimitiveConversionDemonstration" /> <jrun cls="PrimitiveConversionDemonstration" />
<jrun cls="RaggedArray" /> <jrun cls="RaggedArray" />
<jrun cls="RandomGeneratorsTest" /> <jrun cls="RandomSuppliersTest" />
<jrun cls="Reverse" /> <jrun cls="Reverse" />
<jrun cls="StringSorting" /> <jrun cls="StringSorting" />
<jrun cls="SuppliersTest" />
<jrun cls="TestArrayGeneration" /> <jrun cls="TestArrayGeneration" />
<jrun cls="TestGenerated" /> <jrun cls="TestGenerated" />
<jrun cls="ThreeDWithNew" /> <jrun cls="ThreeDWithNew" />

View File

@ -1,5 +1,4 @@
// assertions/Assert1.java // assertions/Assert1.java
// ©2015 MindView LLC: see Copyright.txt
// Non-informative style of assert // Non-informative style of assert
// {JVMArgs: -ea} // Must run with -ea // {JVMArgs: -ea} // Must run with -ea
// {ThrowsException} // {ThrowsException}

View File

@ -1,5 +1,4 @@
// assertions/Assert2.java // assertions/Assert2.java
// ©2015 MindView LLC: see Copyright.txt
// Assert with an informative message // Assert with an informative message
// {JVMArgs: -ea} // {JVMArgs: -ea}
// {ThrowsException} // {ThrowsException}

View File

@ -1,5 +1,4 @@
// assertions/LoaderAssertions.java // assertions/LoaderAssertions.java
// ©2015 MindView LLC: see Copyright.txt
// Using the class loader to enable assertions // Using the class loader to enable assertions
// {ThrowsException} // {ThrowsException}

View File

@ -1,5 +1,4 @@
// assertions/Queue.java // assertions/Queue.java
// ©2015 MindView LLC: see Copyright.txt
// Demonstration of Design by Contract (DbC) combined // Demonstration of Design by Contract (DbC) combined
// with white-box unit testing. // with white-box unit testing.
// (Install libraries from www.junit.org) // (Install libraries from www.junit.org)

View File

@ -15,7 +15,6 @@
<jrun cls="com.mindviewinc.util.Countries" dirpath="../com/mindviewinc/util" /> <jrun cls="com.mindviewinc.util.Countries" dirpath="../com/mindviewinc/util" />
<jrun cls="com.mindviewinc.util.Directory" dirpath="../com/mindviewinc/util" /> <jrun cls="com.mindviewinc.util.Directory" dirpath="../com/mindviewinc/util" />
<jrun cls="com.mindviewinc.util.Hex" dirpath="../com/mindviewinc/util" /> <jrun cls="com.mindviewinc.util.Hex" dirpath="../com/mindviewinc/util" />
<jrun cls="com.mindviewinc.util.New" dirpath="../com/mindviewinc/util" />
<jrun cls="com.mindviewinc.util.TextFile" dirpath="../com/mindviewinc/util" /> <jrun cls="com.mindviewinc.util.TextFile" dirpath="../com/mindviewinc/util" />
</target> </target>

View File

@ -1,12 +1,10 @@
// com/mindviewinc/atunit/AtUnit.java // com/mindviewinc/atunit/AtUnit.java
// ©2015 MindView LLC: see Copyright.txt
// An annotation-based unit-test framework. // An annotation-based unit-test framework.
package com.mindviewinc.atunit; package com.mindviewinc.atunit;
import java.lang.reflect.*; import java.lang.reflect.*;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
import static com.mindviewinc.util.Print.*;
public class AtUnit implements ProcessFiles.Strategy { public class AtUnit implements ProcessFiles.Strategy {
static Class<?> testClass; static Class<?> testClass;
@ -18,13 +16,13 @@ public class AtUnit implements ProcessFiles.Strategy {
.setDefaultAssertionStatus(true); // Enable asserts .setDefaultAssertionStatus(true); // Enable asserts
new ProcessFiles(new AtUnit(), "class").start(args); new ProcessFiles(new AtUnit(), "class").start(args);
if(failures == 0) if(failures == 0)
print("OK (" + testsRun + " tests)"); System.out.println("OK (" + testsRun + " tests)");
else { else {
print("(" + testsRun + " tests)"); System.out.println("(" + testsRun + " tests)");
print("\n>>> " + failures + " FAILURE" + System.out.println("\n>>> " + failures + " FAILURE" +
(failures > 1 ? "S" : "") + " <<<"); (failures > 1 ? "S" : "") + " <<<");
for(String failed : failedTests) for(String failed : failedTests)
print(" " + failed); System.out.println(" " + failed);
} }
} }
@Override @Override
@ -53,17 +51,17 @@ public class AtUnit implements ProcessFiles.Strategy {
try { try {
if(!Modifier.isPublic(testClass if(!Modifier.isPublic(testClass
.getDeclaredConstructor().getModifiers())) { .getDeclaredConstructor().getModifiers())) {
print("Error: " + testClass + System.out.println("Error: " + testClass +
" default constructor must be public"); " no-arg constructor must be public");
System.exit(1); System.exit(1);
} }
} catch(NoSuchMethodException e) { } catch(NoSuchMethodException e) {
// Synthesized default constructor; OK // Synthesized no-arg constructor; OK
} }
print(testClass.getName()); System.out.println(testClass.getName());
} }
for(Method m : testMethods) { for(Method m : testMethods) {
printnb(" . " + m.getName() + " "); System.out.print(" . " + m.getName() + " ");
try { try {
Object testObject = createTestObject(creator); Object testObject = createTestObject(creator);
boolean success = false; boolean success = false;
@ -76,9 +74,9 @@ public class AtUnit implements ProcessFiles.Strategy {
} }
} catch(InvocationTargetException e) { } catch(InvocationTargetException e) {
// Actual exception is inside e: // Actual exception is inside e:
print(e.getCause()); System.out.println(e.getCause());
} }
print(success ? "" : "(failed)"); System.out.println(success ? "" : "(failed)");
testsRun++; testsRun++;
if(!success) { if(!success) {
failures++; failures++;
@ -146,7 +144,7 @@ public class AtUnit implements ProcessFiles.Strategy {
throw new RuntimeException("Couldn't run " + throw new RuntimeException("Couldn't run " +
"@TestObject (creator) method."); "@TestObject (creator) method.");
} }
} else { // Use the default constructor: } else { // Use the no-arg constructor:
try { try {
return testClass.newInstance(); return testClass.newInstance();
} catch(InstantiationException | } catch(InstantiationException |

View File

@ -1,10 +1,8 @@
// com/mindviewinc/atunit/ClassNameFinder.java // com/mindviewinc/atunit/ClassNameFinder.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.atunit; package com.mindviewinc.atunit;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import com.mindviewinc.util.*; import com.mindviewinc.util.*;
import static com.mindviewinc.util.Print.*;
public class ClassNameFinder { public class ClassNameFinder {
public static String thisClass(byte[] classBytes) { public static String thisClass(byte[] classBytes) {
@ -67,11 +65,11 @@ public class ClassNameFinder {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
if(args.length > 0) { if(args.length > 0) {
for(String arg : args) for(String arg : args)
print(thisClass(BinaryFile.read(new File(arg)))); System.out.println(thisClass(BinaryFile.read(new File(arg))));
} else } else
// Walk the entire tree: // Walk the entire tree: <* Use NIO2 here *>
for(File klass : Directory.walk(".", ".*\\.class")) for(File klass : Directory.walk(".", ".*\\.class"))
print(thisClass(BinaryFile.read(klass))); System.out.println(thisClass(BinaryFile.read(klass)));
} }
} }
/* Output: /* Output:

View File

@ -1,5 +1,4 @@
// com/mindviewinc/atunit/Test.java // com/mindviewinc/atunit/Test.java
// ©2015 MindView LLC: see Copyright.txt
// The @Test tag. // The @Test tag.
package com.mindviewinc.atunit; package com.mindviewinc.atunit;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/atunit/TestObjectCleanup.java // com/mindviewinc/atunit/TestObjectCleanup.java
// ©2015 MindView LLC: see Copyright.txt
// The @Unit @TestObjectCleanup tag. // The @Unit @TestObjectCleanup tag.
package com.mindviewinc.atunit; package com.mindviewinc.atunit;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/atunit/TestObjectCreate.java // com/mindviewinc/atunit/TestObjectCreate.java
// ©2015 MindView LLC: see Copyright.txt
// The @Unit @TestObjectCreate tag. // The @Unit @TestObjectCreate tag.
package com.mindviewinc.atunit; package com.mindviewinc.atunit;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/atunit/TestProperty.java // com/mindviewinc/atunit/TestProperty.java
// ©2015 MindView LLC: see Copyright.txt
// The @Unit @TestProperty tag. // The @Unit @TestProperty tag.
package com.mindviewinc.atunit; package com.mindviewinc.atunit;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/simple/List.java // com/mindviewinc/simple/List.java
// ©2015 MindView LLC: see Copyright.txt
// Creating a package. // Creating a package.
package com.mindviewinc.simple; package com.mindviewinc.simple;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/simple/Vector.java // com/mindviewinc/simple/Vector.java
// ©2015 MindView LLC: see Copyright.txt
// Creating a package. // Creating a package.
package com.mindviewinc.simple; package com.mindviewinc.simple;

View File

@ -1,14 +1,14 @@
// com/mindviewinc/util/BasicGenerator.java // com/mindviewinc/util/BasicSupplier.java
// ©2015 MindView LLC: see Copyright.txt // Automatically create a Supplier, given a class
// Automatically create a Generator, given a class
// with a default (no-arg) constructor. // with a default (no-arg) constructor.
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.function.*;
public class BasicGenerator<T> implements Generator<T> { public class BasicSupplier<T> implements Supplier<T> {
private Class<T> type; private Class<T> type;
public BasicGenerator(Class<T> type){ this.type = type; } public BasicSupplier(Class<T> type){ this.type = type; }
@Override @Override
public T next() { public T get() {
try { try {
// Assumes type is a public class: // Assumes type is a public class:
return type.newInstance(); return type.newInstance();
@ -18,7 +18,7 @@ public class BasicGenerator<T> implements Generator<T> {
} }
} }
// Produce a Default generator given a type token: // Produce a Default generator given a type token:
public static <T> Generator<T> create(Class<T> type) { public static <T> Supplier<T> create(Class<T> type) {
return new BasicGenerator<>(type); return new BasicSupplier<>(type);
} }
} }

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/BinaryFile.java // com/mindviewinc/util/BinaryFile.java
// ©2015 MindView LLC: see Copyright.txt
// Utility for reading files in binary form. // Utility for reading files in binary form.
package com.mindviewinc.util; package com.mindviewinc.util;
import java.io.*; import java.io.*;

View File

@ -1,17 +1,17 @@
// com/mindviewinc/util/CollectionData.java // com/mindviewinc/util/CollectionData.java
// ©2015 MindView LLC: see Copyright.txt
// A Collection filled with data using a generator object. // A Collection filled with data using a generator object.
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.*; import java.util.*;
import java.util.function.*;
public class CollectionData<T> extends ArrayList<T> { public class CollectionData<T> extends ArrayList<T> {
public CollectionData(Generator<T> gen, int quantity) { public CollectionData(Supplier<T> gen, int quantity) {
for(int i = 0; i < quantity; i++) for(int i = 0; i < quantity; i++)
add(gen.next()); add(gen.get());
} }
// A generic convenience method: // A generic convenience method:
public static <T> CollectionData<T> public static <T> CollectionData<T>
list(Generator<T> gen, int quantity) { list(Supplier<T> gen, int quantity) {
return new CollectionData<>(gen, quantity); return new CollectionData<>(gen, quantity);
} }
} }

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/ContainerMethodDifferences.java // com/mindviewinc/util/ContainerMethodDifferences.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
import java.lang.reflect.*; import java.lang.reflect.*;
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/ConvertTo.java // com/mindviewinc/util/ConvertTo.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
public class ConvertTo { public class ConvertTo {

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/CountingIntegerList.java // com/mindviewinc/util/CountingIntegerList.java
// ©2015 MindView LLC: see Copyright.txt
// List of any length, containing sample data. // List of any length, containing sample data.
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/CountingMapData.java // com/mindviewinc/util/CountingMapData.java
// ©2015 MindView LLC: see Copyright.txt
// Unlimited-length Map containing sample data. // Unlimited-length Map containing sample data.
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.*; import java.util.*;

View File

@ -1,82 +1,82 @@
// com/mindviewinc/util/CountingGenerator.java // com/mindviewinc/util/CountingSupplier.java
// ©2015 MindView LLC: see Copyright.txt
// Simple generator implementations. // Simple generator implementations.
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.function.*;
public class CountingGenerator { public class CountingSupplier {
public static class public static class
Boolean implements Generator<java.lang.Boolean> { Boolean implements Supplier<java.lang.Boolean> {
private boolean value = false; private boolean value = false;
@Override @Override
public java.lang.Boolean next() { public java.lang.Boolean get() {
value = !value; // Just flips back and forth value = !value; // Just flips back and forth
return value; return value;
} }
} }
public static class public static class
Byte implements Generator<java.lang.Byte> { Byte implements Supplier<java.lang.Byte> {
private byte value = 0; private byte value = 0;
@Override @Override
public java.lang.Byte next() { return value++; } public java.lang.Byte get() { return value++; }
} }
static char[] chars = ("abcdefghijklmnopqrstuvwxyz" + static char[] chars = ("abcdefghijklmnopqrstuvwxyz" +
"ABCDEFGHIJKLMNOPQRSTUVWXYZ").toCharArray(); "ABCDEFGHIJKLMNOPQRSTUVWXYZ").toCharArray();
public static class public static class
Character implements Generator<java.lang.Character> { Character implements Supplier<java.lang.Character> {
int index = -1; int index = -1;
@Override @Override
public java.lang.Character next() { public java.lang.Character get() {
index = (index + 1) % chars.length; index = (index + 1) % chars.length;
return chars[index]; return chars[index];
} }
} }
public static class public static class
String implements Generator<java.lang.String> { String implements Supplier<java.lang.String> {
private int length = 7; private int length = 7;
Generator<java.lang.Character> cg = new Character(); Supplier<java.lang.Character> cg = new Character();
public String() {} public String() {}
public String(int length) { this.length = length; } public String(int length) { this.length = length; }
@Override @Override
public java.lang.String next() { public java.lang.String get() {
char[] buf = new char[length]; char[] buf = new char[length];
for(int i = 0; i < length; i++) for(int i = 0; i < length; i++)
buf[i] = cg.next(); buf[i] = cg.get();
return new java.lang.String(buf); return new java.lang.String(buf);
} }
} }
public static class public static class
Short implements Generator<java.lang.Short> { Short implements Supplier<java.lang.Short> {
private short value = 0; private short value = 0;
@Override @Override
public java.lang.Short next() { return value++; } public java.lang.Short get() { return value++; }
} }
public static class public static class
Integer implements Generator<java.lang.Integer> { Integer implements Supplier<java.lang.Integer> {
private int value = 0; private int value = 0;
@Override @Override
public java.lang.Integer next() { return value++; } public java.lang.Integer get() { return value++; }
} }
public static class public static class
Long implements Generator<java.lang.Long> { Long implements Supplier<java.lang.Long> {
private long value = 0; private long value = 0;
@Override @Override
public java.lang.Long next() { return value++; } public java.lang.Long get() { return value++; }
} }
public static class public static class
Float implements Generator<java.lang.Float> { Float implements Supplier<java.lang.Float> {
private float value = 0; private float value = 0;
@Override @Override
public java.lang.Float next() { public java.lang.Float get() {
float result = value; float result = value;
value += 1.0; value += 1.0;
return result; return result;
} }
} }
public static class public static class
Double implements Generator<java.lang.Double> { Double implements Supplier<java.lang.Double> {
private double value = 0.0; private double value = 0.0;
@Override @Override
public java.lang.Double next() { public java.lang.Double get() {
double result = value; double result = value;
value += 1.0; value += 1.0;
return result; return result;

View File

@ -1,9 +1,7 @@
// com/mindviewinc/util/Countries.java // com/mindviewinc/util/Countries.java
// ©2015 MindView LLC: see Copyright.txt
// "Flyweight" Maps and Lists of sample data. // "Flyweight" Maps and Lists of sample data.
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.*; import java.util.*;
import static com.mindviewinc.util.Print.*;
public class Countries { public class Countries {
public static final String[][] DATA = { public static final String[][] DATA = {
@ -226,18 +224,18 @@ public class Countries {
return new ArrayList<>(select(size).keySet()); return new ArrayList<>(select(size).keySet());
} }
public static void main(String[] args) { public static void main(String[] args) {
print(capitals(10)); System.out.println(capitals(10));
print(names(10)); System.out.println(names(10));
print(new HashMap<>(capitals(3))); System.out.println(new HashMap<>(capitals(3)));
print(new LinkedHashMap<>(capitals(3))); System.out.println(new LinkedHashMap<>(capitals(3)));
print(new TreeMap<>(capitals(3))); System.out.println(new TreeMap<>(capitals(3)));
print(new Hashtable<>(capitals(3))); System.out.println(new Hashtable<>(capitals(3)));
print(new HashSet<>(names(6))); System.out.println(new HashSet<>(names(6)));
print(new LinkedHashSet<>(names(6))); System.out.println(new LinkedHashSet<>(names(6)));
print(new TreeSet<>(names(6))); System.out.println(new TreeSet<>(names(6)));
print(new ArrayList<>(names(6))); System.out.println(new ArrayList<>(names(6)));
print(new LinkedList<>(names(6))); System.out.println(new LinkedList<>(names(6)));
print(capitals().get("BRAZIL")); System.out.println(capitals().get("BRAZIL"));
} }
} }
/* Output: /* Output:

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/DaemonThreadFactory.java // com/mindviewinc/util/DaemonThreadFactory.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.concurrent.*; import java.util.concurrent.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/DaemonThreadPoolExecutor.java // com/mindviewinc/util/DaemonThreadPoolExecutor.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.concurrent.*; import java.util.concurrent.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/Deque.java // com/mindviewinc/util/Deque.java
// ©2015 MindView LLC: see Copyright.txt
// Creating a Deque from a LinkedList. // Creating a Deque from a LinkedList.
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/Directory.java // com/mindviewinc/util/Directory.java
// ©2015 MindView LLC: see Copyright.txt
// Produce a sequence of File objects that match a // Produce a sequence of File objects that match a
// regular expression in either a local directory, // regular expression in either a local directory,
// or by walking a directory tree. // or by walking a directory tree.
@ -81,8 +80,8 @@ public final class Directory {
/* Output: (First 20 Lines) /* Output: (First 20 Lines)
dirs: [] dirs: []
files: [ files: [
.\BasicGenerator.class .\BasicSupplier.class
.\BasicGenerator.java .\BasicSupplier.java
.\BinaryFile.class .\BinaryFile.class
.\BinaryFile.java .\BinaryFile.java
.\CollectionData.class .\CollectionData.class
@ -93,10 +92,10 @@ files: [
.\ContainerMethodDifferences.java .\ContainerMethodDifferences.java
.\ConvertTo.class .\ConvertTo.class
.\ConvertTo.java .\ConvertTo.java
.\CountingGenerator$Boolean.class .\CountingSupplier$Boolean.class
.\CountingGenerator$Byte.class .\CountingSupplier$Byte.class
.\CountingGenerator$Character.class .\CountingSupplier$Character.class
.\CountingGenerator$Double.class .\CountingSupplier$Double.class
.\CountingGenerator$Float.class .\CountingSupplier$Float.class
... ...
*/ */

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/Enums.java // com/mindviewinc/util/Enums.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/FiveTuple.java // com/mindviewinc/util/FiveTuple.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
public class FiveTuple<A, B, C, D, E> public class FiveTuple<A, B, C, D, E>

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/FourTuple.java // com/mindviewinc/util/FourTuple.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
public class FourTuple<A, B, C, D> public class FourTuple<A, B, C, D>

View File

@ -1,16 +1,16 @@
// com/mindviewinc/util/Generated.java // com/mindviewinc/util/Generated.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.function.*;
public class Generated { public class Generated {
// Fill an existing array: // Fill an existing array:
public static <T> T[] array(T[] a, Generator<T> gen) { public static <T> T[] array(T[] a, Supplier<T> gen) {
return new CollectionData<>(gen, a.length).toArray(a); return new CollectionData<>(gen, a.length).toArray(a);
} }
// Create a new array: // Create a new array:
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> T[] array(Class<T> type, public static <T> T[] array(Class<T> type,
Generator<T> gen, int size) { Supplier<T> gen, int size) {
T[] a = T[] a =
(T[])java.lang.reflect.Array.newInstance(type, size); (T[])java.lang.reflect.Array.newInstance(type, size);
return new CollectionData<>(gen, size).toArray(a); return new CollectionData<>(gen, size).toArray(a);

View File

@ -1,5 +0,0 @@
// com/mindviewinc/util/Generator.java
// ©2015 MindView LLC: see Copyright.txt
// A generic interface.
package com.mindviewinc.util;
public interface Generator<T> { T next(); }

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/Hex.java // com/mindviewinc/util/Hex.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
import java.io.*; import java.io.*;

View File

@ -1,34 +1,34 @@
// com/mindviewinc/util/MapData.java // com/mindviewinc/util/MapData.java
// ©2015 MindView LLC: see Copyright.txt
// A Map filled with data using a generator object. // A Map filled with data using a generator object.
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.*; import java.util.*;
import java.util.function.*;
public class MapData<K, V> extends LinkedHashMap<K, V> { public class MapData<K, V> extends LinkedHashMap<K, V> {
// A single Pair Generator: // A single Pair Supplier:
public MapData(Generator<Pair<K, V>> gen, int quantity) { public MapData(Supplier<Pair<K, V>> gen, int quantity) {
for(int i = 0; i < quantity; i++) { for(int i = 0; i < quantity; i++) {
Pair<K, V> p = gen.next(); Pair<K, V> p = gen.get();
put(p.key, p.value); put(p.key, p.value);
} }
} }
// Two separate Generators: // Two separate Suppliers:
public MapData(Generator<K> genK, Generator<V> genV, public MapData(Supplier<K> genK, Supplier<V> genV,
int quantity) { int quantity) {
for(int i = 0; i < quantity; i++) { for(int i = 0; i < quantity; i++) {
put(genK.next(), genV.next()); put(genK.get(), genV.get());
} }
} }
// A key Generator and a single value: // A key Supplier and a single value:
public MapData(Generator<K> genK, V value, int quantity){ public MapData(Supplier<K> genK, V value, int quantity){
for(int i = 0; i < quantity; i++) { for(int i = 0; i < quantity; i++) {
put(genK.next(), value); put(genK.get(), value);
} }
} }
// An Iterable and a value Generator: // An Iterable and a value Supplier:
public MapData(Iterable<K> genK, Generator<V> genV) { public MapData(Iterable<K> genK, Supplier<V> genV) {
for(K key : genK) { for(K key : genK) {
put(key, genV.next()); put(key, genV.get());
} }
} }
// An Iterable and a single value: // An Iterable and a single value:
@ -39,19 +39,19 @@ public class MapData<K, V> extends LinkedHashMap<K, V> {
} }
// Generic convenience methods: // Generic convenience methods:
public static <K, V> MapData<K, V> public static <K, V> MapData<K, V>
map(Generator<Pair<K, V>> gen, int quantity) { map(Supplier<Pair<K, V>> gen, int quantity) {
return new MapData<>(gen, quantity); return new MapData<>(gen, quantity);
} }
public static <K, V> MapData<K, V> public static <K, V> MapData<K, V>
map(Generator<K> genK, Generator<V> genV, int quantity) { map(Supplier<K> genK, Supplier<V> genV, int quantity) {
return new MapData<>(genK, genV, quantity); return new MapData<>(genK, genV, quantity);
} }
public static <K, V> MapData<K, V> public static <K, V> MapData<K, V>
map(Generator<K> genK, V value, int quantity) { map(Supplier<K> genK, V value, int quantity) {
return new MapData<>(genK, value, quantity); return new MapData<>(genK, value, quantity);
} }
public static <K, V> MapData<K, V> public static <K, V> MapData<K, V>
map(Iterable<K> genK, Generator<V> genV) { map(Iterable<K> genK, Supplier<V> genV) {
return new MapData<>(genK, genV); return new MapData<>(genK, genV);
} }
public static <K, V> MapData<K, V> public static <K, V> MapData<K, V>

View File

@ -0,0 +1,16 @@
// com/mindviewinc/util/MouseClick.java
// Helper interface to allow lambda expressions
package com.mindviewinc.util;
import java.awt.event.*;
// Default everything except mouseClicked():
public interface MouseClick extends MouseListener {
@Override
public default void mouseEntered(MouseEvent e) {}
@Override
public default void mouseExited(MouseEvent e) {}
@Override
public default void mousePressed(MouseEvent e) {}
@Override
public default void mouseReleased(MouseEvent e) {}
}

View File

@ -1,33 +0,0 @@
// com/mindviewinc/util/New.java
// ©2015 MindView LLC: see Copyright.txt
// Utilities to simplify generic container creation
// by using type argument inference.
package com.mindviewinc.util;
import java.util.*;
public class New {
public static <K, V> Map<K, V> map() {
return new HashMap<>();
}
public static <T> List<T> list() {
return new ArrayList<>();
}
public static <T> LinkedList<T> lList() {
return new LinkedList<>();
}
public static <T> Set<T> set() {
return new HashSet<>();
}
public static <T> Queue<T> queue() {
return new LinkedList<>();
}
// Examples:
public static void main(String[] args) {
Map<String, List<String>> sls = New.map();
List<String> ls = New.list();
LinkedList<String> lls = New.lList();
Set<String> ss = New.set();
Queue<String> qs = New.queue();
}
}
/* Output: (None) */

View File

@ -1,4 +1,3 @@
// com/mindviewinc/util/Null.java // com/mindviewinc/util/Null.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
public interface Null {} public interface Null {}

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/OSExecute.java // com/mindviewinc/util/OSExecute.java
// ©2015 MindView LLC: see Copyright.txt
// Run an operating system command // Run an operating system command
// and send the output to the console. // and send the output to the console.
package com.mindviewinc.util; package com.mindviewinc.util;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/OSExecuteException.java // com/mindviewinc/util/OSExecuteException.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
public class OSExecuteException extends RuntimeException { public class OSExecuteException extends RuntimeException {

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/PPrint.java // com/mindviewinc/util/PPrint.java
// ©2015 MindView LLC: see Copyright.txt
// Pretty-printer for collections // Pretty-printer for collections
package com.mindviewinc.util; package com.mindviewinc.util;
import java.util.*; import java.util.*;

View File

@ -1,5 +1,4 @@
// com/mindviewinc/util/Pair.java // com/mindviewinc/util/Pair.java
// ©2015 MindView LLC: see Copyright.txt
package com.mindviewinc.util; package com.mindviewinc.util;
public class Pair<K, V> { public class Pair<K, V> {

Some files were not shown because too many files have changed in this diff Show More