Copyright line
This commit is contained in:
parent
94469c299a
commit
51d7993818
@ -1,4 +1,5 @@
|
||||
//: access/Cake.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Accesses a class in a separate compilation unit.
|
||||
|
||||
class Cake {
|
||||
|
@ -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.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/ChocolateChip2.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import access.cookie2.*;
|
||||
|
||||
public class ChocolateChip2 extends Cookie {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/Dinner.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Uses the library.
|
||||
import access.dessert.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/FullQualification.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
|
||||
public class FullQualification {
|
||||
public static void main(String[] args) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/IceCream.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Demonstrates "private" keyword.
|
||||
|
||||
class Sundae {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/ImportedMyClass.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import access.mypackage.*;
|
||||
|
||||
public class ImportedMyClass {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/LibTest.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Uses the library.
|
||||
import net.mindview.simple.*;
|
||||
|
||||
|
@ -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:
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/OrganizedByAccess.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
|
||||
public class OrganizedByAccess {
|
||||
public void pub1() { /* ... */ }
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/Pie.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// The other class.
|
||||
|
||||
class Pie {
|
||||
|
@ -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.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/QualifiedMyClass.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
|
||||
public class QualifiedMyClass {
|
||||
public static void main(String[] args) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/SingleImport.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class SingleImport {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/cookie2/Cookie.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package access.cookie2;
|
||||
|
||||
public class Cookie {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/dessert/Cookie.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Creates a library.
|
||||
package access.dessert;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: access/mypackage/MyClass.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package access.mypackage;
|
||||
|
||||
public class MyClass {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/AtUnitComposition.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Creating non-embedded tests.
|
||||
package annotations;
|
||||
import net.mindview.atunit.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/AtUnitExample1.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations;
|
||||
import net.mindview.atunit.*;
|
||||
import net.mindview.util.*;
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/AtUnitExample3.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations;
|
||||
import net.mindview.atunit.*;
|
||||
import net.mindview.util.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/AtUnitExample4.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations;
|
||||
import java.util.*;
|
||||
import net.mindview.atunit.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/AtUnitExample5.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations;
|
||||
import java.io.*;
|
||||
import net.mindview.atunit.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/AtUnitExternalTest.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Creating non-embedded tests.
|
||||
package annotations;
|
||||
import net.mindview.atunit.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/HashSetTest.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations;
|
||||
import java.util.*;
|
||||
import net.mindview.atunit.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/PasswordUtils.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.*;
|
||||
|
||||
public class PasswordUtils {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/SimulatingNull.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/StackL.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// A stack built on a linkedList.
|
||||
package annotations;
|
||||
import java.util.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/StackLStringTest.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Applying @Unit to generics.
|
||||
package annotations;
|
||||
import net.mindview.atunit.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/Testable.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations;
|
||||
import net.mindview.atunit.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/UseCase.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/UseCaseTracker.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/database/Constraints.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations.database;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/database/DBTable.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations.database;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/database/Member.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations.database;
|
||||
|
||||
@DBTable(name = "MEMBER")
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/database/SQLInteger.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations.database;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/database/SQLString.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
package annotations.database;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/database/Uniqueness.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Sample of nested annotations
|
||||
package annotations.database;
|
||||
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/ifx/Multiplier.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// javac-based annotation processing.
|
||||
package annotations.ifx;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: annotations/simplest/SimpleTest.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Test the "Simple" annotation
|
||||
package annotations.simplest;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/AlphabeticSearch.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Searching with a Comparator.
|
||||
import java.util.*;
|
||||
import net.mindview.util.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/ArrayOfGenericType.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Arrays of generic types won't compile.
|
||||
|
||||
public class ArrayOfGenericType<T> {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/ArrayOfGenerics.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// It is possible to create arrays of generics.
|
||||
import java.util.*;
|
||||
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/ArraySearching.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Using Arrays.binarySearch().
|
||||
import java.util.*;
|
||||
import net.mindview.util.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/AssemblingMultidimensionalArrays.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Creating multidimensional arrays.
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/AutoboxingArrays.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.*;
|
||||
|
||||
public class AutoboxingArrays {
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/ContainerComparison.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.*;
|
||||
import static net.mindview.util.Print.*;
|
||||
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/GeneratorsTest.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import net.mindview.util.*;
|
||||
|
||||
public class GeneratorsTest {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/IceCream.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Returning arrays from methods.
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/MultiDimWrapperArray.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Multidimensional arrays of "wrapper" objects.
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/MultidimensionalObjectArrays.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.*;
|
||||
|
||||
public class MultidimensionalObjectArrays {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/MultidimensionalPrimitiveArray.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Creating multidimensional arrays.
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/ParameterizedArrayType.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
|
||||
class ClassParameter<T> {
|
||||
public T[] f(T[] arg) { return arg; }
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/PrimitiveConversionDemonstration.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.*;
|
||||
import net.mindview.util.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#: arrays/PythonLists.py
|
||||
# ©2015 MindView LLC: see Copyright.txt
|
||||
|
||||
aList = [1, 2, 3, 4, 5]
|
||||
print(type(aList)) # <type 'list'>
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/RaggedArray.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.*;
|
||||
|
||||
public class RaggedArray {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/RandomGeneratorsTest.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import net.mindview.util.*;
|
||||
|
||||
public class RandomGeneratorsTest {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/Reverse.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// The Collections.reverseOrder() Comparator
|
||||
import java.util.*;
|
||||
import net.mindview.util.*;
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/TestGenerated.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.*;
|
||||
import net.mindview.util.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: arrays/ThreeDWithNew.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.*;
|
||||
|
||||
public class ThreeDWithNew {
|
||||
|
@ -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}
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: assertions/Assert2.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Assert with an informative message
|
||||
// {JVMArgs: -ea}
|
||||
// {ThrowsException}
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: assertions/LoaderAssertions.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Using the class loader to enable assertions
|
||||
// {ThrowsException}
|
||||
|
||||
|
@ -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
2
clean.bat
Normal file
@ -0,0 +1,2 @@
|
||||
del innerclasses\MultiInterfaces.java
|
||||
del logging\EmailLogger.java
|
@ -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.
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: concurrency/Atomicity.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// {Exec: javap -c Atomicity}
|
||||
|
||||
public class Atomicity {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: concurrency/AtomicityTest.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.concurrent.*;
|
||||
|
||||
public class AtomicityTest implements Runnable {
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: concurrency/BankTellerSimulation.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Using queues and multithreading.
|
||||
// {Args: 5}
|
||||
import java.util.concurrent.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: concurrency/BasicThreads.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// The most basic use of the Thread class.
|
||||
|
||||
public class BasicThreads {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: concurrency/CachedThreadPool.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.concurrent.*;
|
||||
|
||||
public class CachedThreadPool {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: concurrency/CallableDemo.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
import java.util.concurrent.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: concurrency/CaptureUncaughtException.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// {TimeOutDuringTesting}
|
||||
import java.util.concurrent.*;
|
||||
|
||||
|
@ -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.*;
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: concurrency/Chopstick.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Chopsticks for dining philosophers.
|
||||
|
||||
public class Chopstick {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//: concurrency/CloseResource.java
|
||||
// ©2015 MindView LLC: see Copyright.txt
|
||||
// Interrupting a blocked task by
|
||||
// closing the underlying resource.
|
||||
// {TimeOutDuringTesting}
|
||||
|
@ -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.*;
|
||||
|
@ -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
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -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.*;
|
||||
|
@ -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
Loading…
x
Reference in New Issue
Block a user