Copyright line

This commit is contained in:
Bruce Eckel 2015-05-29 14:18:51 -07:00
parent 94469c299a
commit 51d7993818
932 changed files with 989 additions and 5 deletions

View File

@ -1,4 +1,5 @@
//: access/Cake.java
// ©2015 MindView LLC: see Copyright.txt
// Accesses a class in a separate compilation unit.
class Cake {

View File

@ -1,4 +1,5 @@
//: access/ChocolateChip.java
// ©2015 MindView LLC: see Copyright.txt
// Can't use package-access member from another package.
import access.dessert.*;

View File

@ -1,4 +1,5 @@
//: access/ChocolateChip2.java
// ©2015 MindView LLC: see Copyright.txt
import access.cookie2.*;
public class ChocolateChip2 extends Cookie {

View File

@ -1,4 +1,5 @@
//: access/Dinner.java
// ©2015 MindView LLC: see Copyright.txt
// Uses the library.
import access.dessert.*;

View File

@ -1,4 +1,5 @@
//: access/FullQualification.java
// ©2015 MindView LLC: see Copyright.txt
public class FullQualification {
public static void main(String[] args) {

View File

@ -1,4 +1,5 @@
//: access/IceCream.java
// ©2015 MindView LLC: see Copyright.txt
// Demonstrates "private" keyword.
class Sundae {

View File

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

View File

@ -1,4 +1,5 @@
//: access/LibTest.java
// ©2015 MindView LLC: see Copyright.txt
// Uses the library.
import net.mindview.simple.*;

View File

@ -1,4 +1,5 @@
//: access/Lunch.java
// ©2015 MindView LLC: see Copyright.txt
// Demonstrates class access specifiers. Make a class
// effectively private with private constructors:

View File

@ -1,4 +1,5 @@
//: access/OrganizedByAccess.java
// ©2015 MindView LLC: see Copyright.txt
public class OrganizedByAccess {
public void pub1() { /* ... */ }

View File

@ -1,4 +1,5 @@
//: access/Pie.java
// ©2015 MindView LLC: see Copyright.txt
// The other class.
class Pie {

View File

@ -1,4 +1,5 @@
//: access/PrintTest.java
// ©2015 MindView LLC: see Copyright.txt
// Uses the static printing methods in Print.java.
import static net.mindview.util.Print.*;

View File

@ -1,4 +1,5 @@
//: access/QualifiedMyClass.java
// ©2015 MindView LLC: see Copyright.txt
public class QualifiedMyClass {
public static void main(String[] args) {

View File

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

View File

@ -1,4 +1,5 @@
//: access/cookie2/Cookie.java
// ©2015 MindView LLC: see Copyright.txt
package access.cookie2;
public class Cookie {

View File

@ -1,4 +1,5 @@
//: access/dessert/Cookie.java
// ©2015 MindView LLC: see Copyright.txt
// Creates a library.
package access.dessert;

View File

@ -1,4 +1,5 @@
//: access/mypackage/MyClass.java
// ©2015 MindView LLC: see Copyright.txt
package access.mypackage;
public class MyClass {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,5 @@
//: arrays/AlphabeticSearch.java
// ©2015 MindView LLC: see Copyright.txt
// Searching with a Comparator.
import java.util.*;
import net.mindview.util.*;

View File

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

View File

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

View File

@ -1,4 +1,5 @@
//: arrays/ArrayOptions.java
// ©2015 MindView LLC: see Copyright.txt
// Initialization & re-assignment of arrays.
import java.util.*;
import static net.mindview.util.Print.*;

View File

@ -1,4 +1,5 @@
//: arrays/ArraySearching.java
// ©2015 MindView LLC: see Copyright.txt
// Using Arrays.binarySearch().
import java.util.*;
import net.mindview.util.*;

View File

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

View File

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

View File

@ -1,4 +1,5 @@
//: arrays/CompType.java
// ©2015 MindView LLC: see Copyright.txt
// Implementing Comparable in a class.
import java.util.*;
import net.mindview.util.*;

View File

@ -1,4 +1,5 @@
//: arrays/ComparatorTest.java
// ©2015 MindView LLC: see Copyright.txt
// Implementing a Comparator for a class.
import java.util.*;
import net.mindview.util.*;

View File

@ -1,4 +1,5 @@
//: arrays/ComparingArrays.java
// ©2015 MindView LLC: see Copyright.txt
// Using Arrays.equals()
import java.util.*;
import static net.mindview.util.Print.*;

View File

@ -1,4 +1,5 @@
//: arrays/ContainerComparison.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*;
import static net.mindview.util.Print.*;

View File

@ -1,4 +1,5 @@
//: arrays/CopyingArrays.java
// ©2015 MindView LLC: see Copyright.txt
// Using System.arraycopy()
import java.util.*;
import static net.mindview.util.Print.*;

View File

@ -1,4 +1,5 @@
//: arrays/FillingArrays.java
// ©2015 MindView LLC: see Copyright.txt
// Using Arrays.fill()
import java.util.*;
import static net.mindview.util.Print.*;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,5 @@
//: arrays/PrimitiveConversionDemonstration.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*;
import net.mindview.util.*;

View File

@ -1,4 +1,5 @@
#: arrays/PythonLists.py
# ©2015 MindView LLC: see Copyright.txt
aList = [1, 2, 3, 4, 5]
print(type(aList)) # <type 'list'>

View File

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

View File

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

View File

@ -1,4 +1,5 @@
//: arrays/Reverse.java
// ©2015 MindView LLC: see Copyright.txt
// The Collections.reverseOrder() Comparator
import java.util.*;
import net.mindview.util.*;

View File

@ -1,4 +1,5 @@
//: arrays/StringSorting.java
// ©2015 MindView LLC: see Copyright.txt
// Sorting an array of Strings.
import java.util.*;
import net.mindview.util.*;

View File

@ -1,4 +1,5 @@
//: arrays/TestArrayGeneration.java
// ©2015 MindView LLC: see Copyright.txt
// Test the tools that use generators to fill arrays.
import java.util.*;
import net.mindview.util.*;

View File

@ -1,4 +1,5 @@
//: arrays/TestGenerated.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*;
import net.mindview.util.*;

View File

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

View File

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

View File

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

View File

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

View File

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

2
clean.bat Normal file
View File

@ -0,0 +1,2 @@
del innerclasses\MultiInterfaces.java
del logging\EmailLogger.java

View File

@ -1,4 +1,5 @@
//: concurrency/ActiveObjectDemo.java
// ©2015 MindView LLC: see Copyright.txt
// Can only pass constants, immutables, "disconnected
// objects," or other active objects as arguments
// to asynch methods.

View File

@ -1,4 +1,5 @@
//: concurrency/AtomicEvenGenerator.java
// ©2015 MindView LLC: see Copyright.txt
// Atomic classes are occasionally useful in regular code.
// {TimeOutDuringTesting}
import java.util.concurrent.atomic.*;

View File

@ -1,4 +1,5 @@
//: concurrency/AtomicIntegerTest.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.*;

View File

@ -1,4 +1,5 @@
//: concurrency/Atomicity.java
// ©2015 MindView LLC: see Copyright.txt
// {Exec: javap -c Atomicity}
public class Atomicity {

View File

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

View File

@ -1,4 +1,5 @@
//: concurrency/AttemptLocking.java
// ©2015 MindView LLC: see Copyright.txt
// Locks in the concurrent library allow you
// to give up on trying to acquire a lock.
import java.util.concurrent.*;

View File

@ -1,4 +1,5 @@
//: concurrency/BankTellerSimulation.java
// ©2015 MindView LLC: see Copyright.txt
// Using queues and multithreading.
// {Args: 5}
import java.util.concurrent.*;

View File

@ -1,4 +1,5 @@
//: concurrency/BasicThreads.java
// ©2015 MindView LLC: see Copyright.txt
// The most basic use of the Thread class.
public class BasicThreads {

View File

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

View File

@ -1,4 +1,5 @@
//: concurrency/CallableDemo.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.concurrent.*;
import java.util.*;

View File

@ -1,4 +1,5 @@
//: concurrency/CaptureUncaughtException.java
// ©2015 MindView LLC: see Copyright.txt
// {TimeOutDuringTesting}
import java.util.concurrent.*;

View File

@ -1,4 +1,5 @@
//: concurrency/CarBuilder.java
// ©2015 MindView LLC: see Copyright.txt
// A complex example of tasks working together.
import java.util.concurrent.*;
import java.util.*;

View File

@ -1,4 +1,5 @@
//: concurrency/Chopstick.java
// ©2015 MindView LLC: see Copyright.txt
// Chopsticks for dining philosophers.
public class Chopstick {

View File

@ -1,4 +1,5 @@
//: concurrency/CloseResource.java
// ©2015 MindView LLC: see Copyright.txt
// Interrupting a blocked task by
// closing the underlying resource.
// {TimeOutDuringTesting}

View File

@ -1,4 +1,5 @@
//: concurrency/CountDownLatchDemo.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.concurrent.*;
import java.util.*;
import static net.mindview.util.Print.*;

View File

@ -1,4 +1,5 @@
//: concurrency/CriticalSection.java
// ©2015 MindView LLC: see Copyright.txt
// {TimeOutDuringTesting}
// (Behavior may have changed in Java 8).
// Synchronizing blocks instead of entire methods. Also

View File

@ -1,4 +1,5 @@
//: concurrency/DaemonFromFactory.java
// ©2015 MindView LLC: see Copyright.txt
// Using a Thread Factory to create daemons.
import java.util.concurrent.*;
import net.mindview.util.*;

View File

@ -1,4 +1,5 @@
//: concurrency/Daemons.java
// ©2015 MindView LLC: see Copyright.txt
// Daemon threads spawn other daemon threads.
import java.util.concurrent.*;
import static net.mindview.util.Print.*;

View File

@ -1,4 +1,5 @@
//: concurrency/DaemonsDontRunFinally.java
// ©2015 MindView LLC: see Copyright.txt
// Daemon threads don't run the finally clause
import java.util.concurrent.*;
import static net.mindview.util.Print.*;

View File

@ -1,4 +1,5 @@
//: concurrency/DeadlockingDiningPhilosophers.java
// ©2015 MindView LLC: see Copyright.txt
// Demonstrates how deadlock can be hidden in a program.
// {Args: 0 5 timeout}
import java.util.concurrent.*;

View File

@ -1,4 +1,5 @@
//: concurrency/DelayQueueDemo.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.concurrent.*;
import java.util.*;
import static java.util.concurrent.TimeUnit.*;

View File

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

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