Copyright and jmh testing
This commit is contained in:
parent
84baf7143d
commit
46211235c3
@ -1,7 +1,7 @@
|
||||
// HelloDate.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class HelloDate {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/AtUnitComposition.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Creating non-embedded tests
|
||||
// {java onjava.atunit.AtUnit
|
||||
// build/classes/main/annotations/AtUnitComposition.class}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/AtUnitExample1.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// {java onjava.atunit.AtUnit
|
||||
// build/classes/main/annotations/AtUnitExample1.class}
|
||||
package annotations;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/AtUnitExample2.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Assertions and exceptions can be used in @Tests
|
||||
// {java onjava.atunit.AtUnit
|
||||
// build/classes/main/annotations/AtUnitExample2.class}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/AtUnitExample3.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// {java onjava.atunit.AtUnit
|
||||
// build/classes/main/annotations/AtUnitExample3.class}
|
||||
package annotations;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/AtUnitExample4.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// {java onjava.atunit.AtUnit
|
||||
// build/classes/main/annotations/AtUnitExample4.class}
|
||||
package annotations;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/AtUnitExample5.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// {java onjava.atunit.AtUnit
|
||||
// build/classes/main/annotations/AtUnitExample5.class}
|
||||
package annotations;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/AtUnitExternalTest.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Creating non-embedded tests
|
||||
// {java onjava.atunit.AtUnit
|
||||
// build/classes/main/annotations/AtUnitExternalTest.class}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/HashSetTest.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// {java onjava.atunit.AtUnit
|
||||
// build/classes/main/annotations/HashSetTest.class}
|
||||
package annotations;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/PasswordUtils.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class PasswordUtils {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/SimulatingNull.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/StackL.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// A stack built on a linkedList
|
||||
package annotations;
|
||||
import java.util.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/StackLStringTest.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Applying @Unit to generics
|
||||
// {java onjava.atunit.AtUnit
|
||||
// build/classes/main/annotations/StackLStringTest.class}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/Testable.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
package annotations;
|
||||
import onjava.atunit.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/UseCase.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/UseCaseTracker.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/database/Constraints.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
package annotations.database;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/database/DBTable.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
package annotations.database;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/database/Member.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
package annotations.database;
|
||||
|
||||
@DBTable(name = "MEMBER")
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/database/SQLInteger.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
package annotations.database;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/database/SQLString.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
package annotations.database;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/database/TableCreator.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Reflection-based annotation processor
|
||||
// {java annotations.database.TableCreator
|
||||
// annotations.database.Member}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/database/Uniqueness.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Sample of nested annotations
|
||||
package annotations.database;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/ifx/ExtractInterface.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// javac-based annotation processing
|
||||
package annotations.ifx;
|
||||
import java.lang.annotation.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/ifx/IfaceExtractorProcessor.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// javac-based annotation processing
|
||||
package annotations.ifx;
|
||||
import javax.annotation.processing.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/ifx/Multiplier.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// javac-based annotation processing
|
||||
// {java annotations.ifx.Multiplier}
|
||||
package annotations.ifx;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/simplest/Simple.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// A bare-bones annotation
|
||||
package annotations.simplest;
|
||||
import java.lang.annotation.Retention;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/simplest/SimpleProcessor.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// A bare-bones annotation processor
|
||||
package annotations.simplest;
|
||||
import javax.annotation.processing.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// annotations/simplest/SimpleTest.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Test the "Simple" annotation
|
||||
// {java annotations.simplest.SimpleTest}
|
||||
package annotations.simplest;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/AlphabeticSearch.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Searching with a Comparator
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ArrayCopying.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Demonstrate Arrays.copy() and Arrays.copyOf()
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ArrayOfGenericType.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
|
||||
public class ArrayOfGenericType<T> {
|
||||
T[] array; // OK
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ArrayOfGenerics.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class ArrayOfGenerics {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ArrayOptions.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Initialization & re-assignment of arrays
|
||||
import java.util.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ArraySearching.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Using Arrays.binarySearch()
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/AssemblingMultidimensionalArrays.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Creating multidimensional arrays
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/AutoboxingArrays.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class AutoboxingArrays {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/CollectionComparison.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/CompType.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Implementing Comparable in a class
|
||||
import java.util.*;
|
||||
import java.util.function.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ComparatorTest.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Implementing a Comparator for a class
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ComparingArrays.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Using Arrays.equals()
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/CountUpward.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
import java.util.stream.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/FillingArrays.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Using Arrays.fill()
|
||||
import java.util.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/IceCream.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Returning arrays from methods
|
||||
import java.util.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ModifyExisting.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/MultiDimWrapperArray.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Multidimensional arrays of "wrapper" objects
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/MultidimensionalObjectArrays.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class MultidimensionalObjectArrays {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/MultidimensionalPrimitiveArray.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class MultidimensionalPrimitiveArray {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ParallelPrefix1.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ParallelPrefix2.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ParallelPrefix3.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class ParallelPrefix3 {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ParallelSetAll.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ParameterizedArrayType.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
|
||||
class ClassParameter<T> {
|
||||
public T[] f(T[] arg) { return arg; }
|
||||
|
@ -1,7 +1,7 @@
|
||||
# arrays/PythonLists.py
|
||||
# (c)2016 MindView LLC: see Copyright.txt
|
||||
# We make no guarantees that this code is fit for any purpose.
|
||||
# Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
# Visit http://OnJava8.com for more book information.
|
||||
|
||||
aList = [1, 2, 3, 4, 5]
|
||||
print(type(aList)) # <type 'list'>
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/RaggedArray.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class RaggedArray {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/Reverse.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// The Collections.reverseOrder() Comparator
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/SimpleSetAll.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/StreamFromArray.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/StringSorting.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Sorting an array of Strings
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/TestConvertTo.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
import static onjava.ArrayShow.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/TestCount.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Test counting generators
|
||||
import java.util.*;
|
||||
import java.util.stream.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/TestRand.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Test random generators
|
||||
import java.util.*;
|
||||
import java.util.stream.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/ThreeDWithNew.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class ThreeDWithNew {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// arrays/jmh/ParallelSort.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
package arrays.jmh;
|
||||
import java.util.*;
|
||||
import onjava.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/AdapterMethodIdiom.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// The "Adapter Method" idiom uses for-in
|
||||
// with additional kinds of Iterables
|
||||
import java.util.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/AddingGroups.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Adding groups of elements to Collection objects
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/ApplesAndOrangesWithGenerics.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class ApplesAndOrangesWithGenerics {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/ApplesAndOrangesWithoutGenerics.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Simple collection use (suppressing compiler warnings)
|
||||
// {ThrowsException}
|
||||
import java.util.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/ArrayIsNotIterable.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class ArrayIsNotIterable {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/AsListInference.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
class Snow {}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/CollectionMethods.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import onjava.*;
|
||||
|
||||
public class CollectionMethods {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/CollectionSequence.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/CrossCollectionIteration.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/CrossCollectionIteration2.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/EnvironmentVariables.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// {ValidateByHand}
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/ForInCollections.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// All collections work with for-in
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/GenericsAndUpcasting.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
class GrannySmith extends Apple {}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/InterfaceVsIterator.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/IterableClass.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Anything Iterable works with for-in
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/LinkedListFeatures.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/ListFeatures.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/ListIteration.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/MapOfList.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// {java collections.MapOfList}
|
||||
package collections;
|
||||
import typeinfo.pets.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/ModifyingArraysAsList.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class ModifyingArraysAsList {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/MultiIterableClass.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Adding several Adapter Methods
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/NonCollectionSequence.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/PetMap.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/PrintingCollections.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Collections print themselves automatically
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/PriorityQueueDemo.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class PriorityQueueDemo {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/QueueDemo.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Upcasting to a Queue from a LinkedList
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/SetOfInteger.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class SetOfInteger {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/SetOfString.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class SetOfString {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/SetOperations.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class SetOperations {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/SimpleCollection.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class SimpleCollection {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/SimpleIteration.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import typeinfo.pets.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/SortedSetOfString.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class SortedSetOfString {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/StackCollision.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
|
||||
public class StackCollision {
|
||||
public static void main(String[] args) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/StackTest.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import java.util.*;
|
||||
|
||||
public class StackTest {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/StackTest2.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
import onjava.*;
|
||||
|
||||
public class StackTest2 {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// collections/Statistics.java
|
||||
// (c)2016 MindView LLC: see Copyright.txt
|
||||
// We make no guarantees that this code is fit for any purpose.
|
||||
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
||||
// Visit http://OnJava8.com for more book information.
|
||||
// Simple demonstration of HashMap
|
||||
import java.util.*;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user