Most recent and change to (c)

This commit is contained in:
Bruce Eckel 2015-12-15 11:47:04 -08:00
parent 56ec933b8b
commit 79d6d2110f
1055 changed files with 2575 additions and 2085 deletions

View File

@ -15,6 +15,12 @@
To see options, type: ant -p To see options, type: ant -p
</description> </description>
<condition property="version1.8">
<equals arg1="1.8" arg2="${ant.java.version}"/>
</condition>
<!--===========================================================-->
<macrodef name="jrun"> <macrodef name="jrun">
<attribute name="cls" default="NOT SET"/> <attribute name="cls" default="NOT SET"/>
<attribute name="dirpath" default=""/> <attribute name="dirpath" default=""/>
@ -46,6 +52,8 @@
</sequential> </sequential>
</macrodef> </macrodef>
<!--===========================================================-->
<macrodef name="jrunconsole"> <macrodef name="jrunconsole">
<attribute name="cls" default="NOT SET"/> <attribute name="cls" default="NOT SET"/>
<attribute name="dirpath" default=""/> <attribute name="dirpath" default=""/>
@ -72,11 +80,10 @@
</sequential> </sequential>
</macrodef> </macrodef>
<condition property="version1.8">
<equals arg1="1.8" arg2="${ant.java.version}"/>
</condition>
<target name="base"> <!--===========================================================-->
<target name="base"
description="Build all common dependencies">
<javac includeantruntime="false" <javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.." classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../onjava/"> srcdir="${basedir}/../onjava/">
@ -89,12 +96,24 @@
<compilerarg value="-Xmaxerrs"/> <compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/> <compilerarg value="10"/>
</javac> </javac>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../polymorphism/music/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<javac includeantruntime="false" <javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.." classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../typeinfo/pets/"> srcdir="${basedir}/../typeinfo/pets/">
<compilerarg value="-Xmaxerrs"/> <compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/> <compilerarg value="10"/>
</javac> </javac>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../collections/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
<javac includeantruntime="false" <javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.." classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../generics/coffee/"> srcdir="${basedir}/../generics/coffee/">
@ -107,18 +126,13 @@
<compilerarg value="-Xmaxerrs"/> <compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/> <compilerarg value="10"/>
</javac> </javac>
<javac includeantruntime="false"
classpath="${java.class.path};${basedir};${basedir}/.."
srcdir="${basedir}/../polymorphism/music/">
<compilerarg value="-Xmaxerrs"/>
<compilerarg value="10"/>
</javac>
</target> </target>
<target
depends="base" <!--===========================================================-->
<target name="build"
description="Build all classes in this directory" description="Build all classes in this directory"
name="build"> depends="base">
<fail message="Java 8 required" unless="version1.8"/> <fail message="Java 8 required" unless="version1.8"/>
<echo message="Building '${chapter}'&#13;"/> <echo message="Building '${chapter}'&#13;"/>
<echo file="${antoutput}" append="true" message="Building '${chapter}'&#13;"/> <echo file="${antoutput}" append="true" message="Building '${chapter}'&#13;"/>
@ -134,10 +148,11 @@
<echo file="${antoutput}" append="true" message="Build '${chapter}' succeeded&#13;"/> <echo file="${antoutput}" append="true" message="Build '${chapter}' succeeded&#13;"/>
</target> </target>
<target
depends="base" <!--===========================================================-->
<target name="buildw"
description="Build all classes in this directory, enabling 'Unchecked' warnings" description="Build all classes in this directory, enabling 'Unchecked' warnings"
name="buildw"> depends="base">
<fail message="Java 8 required" unless="version1.8"/> <fail message="Java 8 required" unless="version1.8"/>
<echo message="Building '${chapter}'&#13;"/> <echo message="Building '${chapter}'&#13;"/>
<echo file="${antoutput}" append="true" message="Building '${chapter}'&#13;"/> <echo file="${antoutput}" append="true" message="Building '${chapter}'&#13;"/>
@ -154,10 +169,22 @@
<echo file="${antoutput}" append="true" message="Build '${chapter}' succeeded&#13;"/> <echo file="${antoutput}" append="true" message="Build '${chapter}' succeeded&#13;"/>
</target> </target>
<target <!--===========================================================-->
depends="base" <target name="verifyclean"
description="delete ant verify output files" >
<delete>
<fileset dir="${basedir}" casesensitive="yes">
<include name="**/update_output.bat" />
<include name="**/validate_failures.txt" />
<include name="**/strategies.txt" />
</fileset>
</delete>
<echo message="verifyclean successful"/>
</target>
<target name="verify"
description="Verify output; requires Python 3.5" description="Verify output; requires Python 3.5"
name="verify"> depends="verifyclean">
<exec dir="${basedir}" executable="python" failonerror="true"> <exec dir="${basedir}" executable="python" failonerror="true">
<arg line="../verify_output.py" /> <arg line="../verify_output.py" />
</exec> </exec>

View File

@ -1,5 +1,5 @@
// HelloDate.java // HelloDate.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// annotations/AtUnitComposition.java // annotations/AtUnitComposition.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Creating non-embedded tests. // Creating non-embedded tests.

View File

@ -1,5 +1,5 @@
// annotations/AtUnitExample1.java // annotations/AtUnitExample1.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations; package annotations;

View File

@ -1,5 +1,5 @@
// annotations/AtUnitExample2.java // annotations/AtUnitExample2.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Assertions and exceptions can be used in @Tests. // Assertions and exceptions can be used in @Tests.

View File

@ -1,5 +1,5 @@
// annotations/AtUnitExample3.java // annotations/AtUnitExample3.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations; package annotations;

View File

@ -1,5 +1,5 @@
// annotations/AtUnitExample4.java // annotations/AtUnitExample4.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations; package annotations;
@ -66,16 +66,15 @@ starting
annotations.AtUnitExample4 annotations.AtUnitExample4
. words 'All' . words 'All'
(failed) (failed)
. scramble1 'brontosauruses' . scramble2 'brontosauruses'
ntsaueorosurbs tsaeborornussu
(failed)
. scramble2 'are' . scramble1 'are'
are rae
(failed) (failed)
(3 tests) (3 tests)
>>> 3 FAILURES <<< >>> 2 FAILURES <<<
annotations.AtUnitExample4: words annotations.AtUnitExample4: words
annotations.AtUnitExample4: scramble1 annotations.AtUnitExample4: scramble1
annotations.AtUnitExample4: scramble2
*/ */

View File

@ -1,5 +1,5 @@
// annotations/AtUnitExample5.java // annotations/AtUnitExample5.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations; package annotations;

View File

@ -1,5 +1,5 @@
// annotations/AtUnitExternalTest.java // annotations/AtUnitExternalTest.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Creating non-embedded tests. // Creating non-embedded tests.

View File

@ -1,5 +1,5 @@
// annotations/HashSetTest.java // annotations/HashSetTest.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations; package annotations;

View File

@ -1,5 +1,5 @@
// annotations/PasswordUtils.java // annotations/PasswordUtils.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// annotations/SimulatingNull.java // annotations/SimulatingNull.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,5 @@
// annotations/StackL.java // annotations/StackL.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// A stack built on a linkedList. // A stack built on a linkedList.

View File

@ -1,5 +1,5 @@
// annotations/StackLStringTest.java // annotations/StackLStringTest.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Applying @Unit to generics. // Applying @Unit to generics.

View File

@ -1,5 +1,5 @@
// annotations/Testable.java // annotations/Testable.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations; package annotations;

View File

@ -1,5 +1,5 @@
// annotations/UseCase.java // annotations/UseCase.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@ -1,5 +1,5 @@
// annotations/UseCaseTracker.java // annotations/UseCaseTracker.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.lang.reflect.*; import java.lang.reflect.*;

View File

@ -1,5 +1,5 @@
// annotations/database/Constraints.java // annotations/database/Constraints.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations.database; package annotations.database;

View File

@ -1,5 +1,5 @@
// annotations/database/DBTable.java // annotations/database/DBTable.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations.database; package annotations.database;

View File

@ -1,5 +1,5 @@
// annotations/database/Member.java // annotations/database/Member.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations.database; package annotations.database;

View File

@ -1,5 +1,5 @@
// annotations/database/SQLInteger.java // annotations/database/SQLInteger.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations.database; package annotations.database;

View File

@ -1,5 +1,5 @@
// annotations/database/SQLString.java // annotations/database/SQLString.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package annotations.database; package annotations.database;

View File

@ -1,5 +1,5 @@
// annotations/database/TableCreator.java // annotations/database/TableCreator.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Reflection-based annotation processor. // Reflection-based annotation processor.

View File

@ -1,5 +1,5 @@
// annotations/database/Uniqueness.java // annotations/database/Uniqueness.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Sample of nested annotations // Sample of nested annotations

View File

@ -1,5 +1,5 @@
// annotations/ifx/ExtractInterface.java // annotations/ifx/ExtractInterface.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// javac-based annotation processing. // javac-based annotation processing.

View File

@ -1,5 +1,5 @@
// annotations/ifx/IfaceExtractorProcessor.java // annotations/ifx/IfaceExtractorProcessor.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// javac-based annotation processing. // javac-based annotation processing.
@ -50,30 +50,28 @@ extends AbstractProcessor {
} }
private void private void
writeInterfaceFile(String interfaceName) { writeInterfaceFile(String interfaceName) {
try { try(Writer writer = processingEnv.getFiler()
try(Writer writer = processingEnv.getFiler() .createSourceFile(interfaceName)
.createSourceFile(interfaceName) .openWriter()) {
.openWriter()) { String packageName = elementUtils
String packageName = elementUtils .getPackageOf(interfaceMethods
.getPackageOf(interfaceMethods .get(0)).toString();
.get(0)).toString(); writer.write(
writer.write( "package " + packageName + ";\n");
"package " + packageName + ";\n"); writer.write("public interface " +
writer.write("public interface " + interfaceName + " {\n");
interfaceName + " {\n"); for(Element elem : interfaceMethods) {
for(Element elem : interfaceMethods) { ExecutableElement method =
ExecutableElement method = (ExecutableElement)elem;
(ExecutableElement)elem; String signature = " public ";
String signature = " public "; signature += method.getReturnType()+" ";
signature += method.getReturnType()+" "; signature += method.getSimpleName();
signature += method.getSimpleName(); signature += createArgList(
signature += createArgList( method.getParameters());
method.getParameters()); System.out.println(signature);
System.out.println(signature); writer.write(signature + ";\n");
writer.write(signature + ";\n");
}
writer.write("}");
} }
writer.write("}");
} catch(Exception e) { } catch(Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@ -1,5 +1,5 @@
// annotations/ifx/Multiplier.java // annotations/ifx/Multiplier.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// javac-based annotation processing. // javac-based annotation processing.

View File

@ -1,5 +1,5 @@
// annotations/simplest/Simple.java // annotations/simplest/Simple.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// A bare-bones annotation. // A bare-bones annotation.

View File

@ -1,5 +1,5 @@
// annotations/simplest/SimpleProcessor.java // annotations/simplest/SimpleProcessor.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// A bare-bones annotation processor. // A bare-bones annotation processor.

View File

@ -1,5 +1,5 @@
// annotations/simplest/SimpleTest.java // annotations/simplest/SimpleTest.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Test the "Simple" annotation // Test the "Simple" annotation

View File

@ -1,5 +1,5 @@
// arrays/AlphabeticSearch.java // arrays/AlphabeticSearch.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Searching with a Comparator. // Searching with a Comparator.

View File

@ -1,5 +1,5 @@
// arrays/ArrayOfGenericType.java // arrays/ArrayOfGenericType.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Arrays of generic types won't compile. // Arrays of generic types won't compile.

View File

@ -1,5 +1,5 @@
// arrays/ArrayOfGenerics.java // arrays/ArrayOfGenerics.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// It is possible to create arrays of generics. // It is possible to create arrays of generics.
@ -29,4 +29,3 @@ public class ArrayOfGenerics {
spheres[i] = new ArrayList<>(); spheres[i] = new ArrayList<>();
} }
} }
/* Output: (None) */

View File

@ -1,5 +1,5 @@
// arrays/ArrayOptions.java // arrays/ArrayOptions.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Initialization & re-assignment of arrays. // Initialization & re-assignment of arrays.

View File

@ -1,5 +1,5 @@
// arrays/ArraySearching.java // arrays/ArraySearching.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Using Arrays.binarySearch(). // Using Arrays.binarySearch().

View File

@ -1,5 +1,5 @@
// arrays/AssemblingMultidimensionalArrays.java // arrays/AssemblingMultidimensionalArrays.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Creating multidimensional arrays. // Creating multidimensional arrays.

View File

@ -1,5 +1,5 @@
// arrays/AutoboxingArrays.java // arrays/AutoboxingArrays.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// arrays/ContainerComparison.java // arrays/CollectionComparison.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;
@ -11,7 +11,7 @@ class BerylliumSphere {
public String toString() { return "Sphere " + id; } public String toString() { return "Sphere " + id; }
} }
public class ContainerComparison { public class CollectionComparison {
public static void main(String[] args) { public static void main(String[] args) {
BerylliumSphere[] spheres = new BerylliumSphere[10]; BerylliumSphere[] spheres = new BerylliumSphere[10];
for(int i = 0; i < 5; i++) for(int i = 0; i < 5; i++)

View File

@ -1,5 +1,5 @@
// arrays/CompType.java // arrays/CompType.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Implementing Comparable in a class. // Implementing Comparable in a class.

View File

@ -1,5 +1,5 @@
// arrays/ComparatorTest.java // arrays/ComparatorTest.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Implementing a Comparator for a class. // Implementing a Comparator for a class.

View File

@ -1,5 +1,5 @@
// arrays/ComparingArrays.java // arrays/ComparingArrays.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Using Arrays.equals() // Using Arrays.equals()

View File

@ -1,5 +1,5 @@
// arrays/CopyingArrays.java // arrays/CopyingArrays.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Using System.arraycopy() // Using System.arraycopy()

View File

@ -1,5 +1,5 @@
// arrays/FillingArrays.java // arrays/FillingArrays.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Using Arrays.fill() // Using Arrays.fill()

View File

@ -1,5 +1,5 @@
// arrays/IceCream.java // arrays/IceCream.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Returning arrays from methods. // Returning arrays from methods.

View File

@ -1,5 +1,5 @@
// arrays/MultiDimWrapperArray.java // arrays/MultiDimWrapperArray.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Multidimensional arrays of "wrapper" objects. // Multidimensional arrays of "wrapper" objects.

View File

@ -1,5 +1,5 @@
// arrays/MultidimensionalObjectArrays.java // arrays/MultidimensionalObjectArrays.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// arrays/MultidimensionalPrimitiveArray.java // arrays/MultidimensionalPrimitiveArray.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Creating multidimensional arrays. // Creating multidimensional arrays.

View File

@ -1,5 +1,5 @@
// arrays/ParameterizedArrayType.java // arrays/ParameterizedArrayType.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
@ -23,4 +23,3 @@ public class ParameterizedArrayType {
doubles2 = MethodParameter.f(doubles); doubles2 = MethodParameter.f(doubles);
} }
} }
/* Output: (None) */

View File

@ -1,5 +1,5 @@
// arrays/PrimitiveConversionDemonstration.java // arrays/PrimitiveConversionDemonstration.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
# arrays/PythonLists.py # arrays/PythonLists.py
# ©2016 MindView LLC: see Copyright.txt # (c)2016 MindView LLC: see Copyright.txt
# We make no guarantees that this code is fit for any purpose. # We make no guarantees that this code is fit for any purpose.
# Visit http://mindviewinc.com/Books/OnJava/ for more book information. # Visit http://mindviewinc.com/Books/OnJava/ for more book information.

View File

@ -1,5 +1,5 @@
// arrays/RaggedArray.java // arrays/RaggedArray.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// arrays/RandomSuppliersTest.java // arrays/RandomSuppliersTest.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import onjava.*; import onjava.*;

View File

@ -1,5 +1,5 @@
// arrays/Reverse.java // arrays/Reverse.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// The Collections.reverseOrder() Comparator // The Collections.reverseOrder() Comparator

View File

@ -1,5 +1,5 @@
// arrays/StringSorting.java // arrays/StringSorting.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Sorting an array of Strings. // Sorting an array of Strings.

View File

@ -1,5 +1,5 @@
// arrays/SuppliersTest.java // arrays/SuppliersTest.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.function.*; import java.util.function.*;

View File

@ -1,5 +1,5 @@
// arrays/TestArrayGeneration.java // arrays/TestArrayGeneration.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Test the tools that use generators to fill arrays. // Test the tools that use generators to fill arrays.

View File

@ -1,5 +1,5 @@
// arrays/TestGenerated.java // arrays/TestGenerated.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// arrays/ThreeDWithNew.java // arrays/ThreeDWithNew.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -13,10 +13,10 @@
<jrun cls="ArraySearching" /> <jrun cls="ArraySearching" />
<jrun cls="AssemblingMultidimensionalArrays" /> <jrun cls="AssemblingMultidimensionalArrays" />
<jrun cls="AutoboxingArrays" /> <jrun cls="AutoboxingArrays" />
<jrun cls="CollectionComparison" />
<jrun cls="ComparatorTest" /> <jrun cls="ComparatorTest" />
<jrun cls="ComparingArrays" /> <jrun cls="ComparingArrays" />
<jrun cls="CompType" /> <jrun cls="CompType" />
<jrun cls="ContainerComparison" />
<jrun cls="CopyingArrays" /> <jrun cls="CopyingArrays" />
<jrun cls="FillingArrays" /> <jrun cls="FillingArrays" />
<jrun cls="IceCream" /> <jrun cls="IceCream" />

View File

@ -1,5 +1,5 @@
// assertions/Assert1.java // assertions/Assert1.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Non-informative style of assert // Non-informative style of assert

View File

@ -1,5 +1,5 @@
// assertions/Assert2.java // assertions/Assert2.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Assert with an informative message // Assert with an informative message

View File

@ -1,5 +1,5 @@
// assertions/LoaderAssertions.java // assertions/LoaderAssertions.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Using the class loader to enable assertions // Using the class loader to enable assertions

View File

@ -1,5 +1,5 @@
// assertions/Queue.java // assertions/Queue.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Demonstration of Design by Contract (DbC) combined // Demonstration of Design by Contract (DbC) combined

View File

@ -31,14 +31,14 @@
interfaces/build.xml interfaces/build.xml
innerclasses/build.xml innerclasses/build.xml
functional/build.xml functional/build.xml
containers/build.xml collections/build.xml
streams/build.xml streams/build.xml
exceptions/build.xml exceptions/build.xml
strings/build.xml strings/build.xml
typeinfo/build.xml typeinfo/build.xml
generics/build.xml generics/build.xml
arrays/build.xml arrays/build.xml
containersindepth/build.xml collectionsindepth/build.xml
files/build.xml files/build.xml
enums/build.xml enums/build.xml
annotations/build.xml annotations/build.xml
@ -62,6 +62,46 @@
staticchecking/build.xml staticchecking/build.xml
"/> "/>
<filelist id="testablefiles" dir="."
description="All directories that produce auto-testable results"
files="objects/build.xml
operators/build.xml
control/build.xml
housekeeping/build.xml
hiding/build.xml
com/build.xml
reuse/build.xml
polymorphism/build.xml
interfaces/build.xml
innerclasses/build.xml
functional/build.xml
collections/build.xml
streams/build.xml
exceptions/build.xml
strings/build.xml
typeinfo/build.xml
generics/build.xml
arrays/build.xml
collectionsindepth/build.xml
files/build.xml
enums/build.xml
annotations/build.xml
concurrency/build.xml
patterns/build.xml
unittesting/build.xml
assertions/build.xml
references/build.xml
iostreams/build.xml
standardio/build.xml
newio/build.xml
compression/build.xml
serialization/build.xml
preferences/build.xml
logging/build.xml
debugging/build.xml
staticchecking/build.xml
"/>
<target name="run" description="Compiles and runs all examples"> <target name="run" description="Compiles and runs all examples">
<delete file="errors.txt"/> <delete file="errors.txt"/>
<subant> <subant>
@ -71,6 +111,15 @@
<antcall target="finish"/> <antcall target="finish"/>
</target> </target>
<target name="testable" description="Compiles and runs all examples">
<delete file="errors.txt"/>
<subant>
<filelist refid="testablefiles"/>
</subant>
<available file="errors.txt" property="errors"/>
<antcall target="finish"/>
</target>
<target name="build" description="Compiles all examples"> <target name="build" description="Compiles all examples">
<fail message="Java 8 required" unless="version1.8"/> <fail message="Java 8 required" unless="version1.8"/>
<delete file="errors.txt"/> <delete file="errors.txt"/>
@ -85,8 +134,21 @@
<echo message="Errors occurred. See errors.txt for information."/> <echo message="Errors occurred. See errors.txt for information."/>
</target> </target>
<target name="verifyclean"
description="delete ant verify output files" >
<delete>
<fileset dir="${basedir}" casesensitive="yes">
<include name="update_output.bat" />
<include name="validate_failures.txt" />
<include name="strategies.txt" />
</fileset>
</delete>
<echo message="verifyclean successful"/>
</target>
<target name="verify" <target name="verify"
description="Verify output; requires Python 3.5"> description="Verify output; requires Python 3.5"
depends="verifyclean">
<exec dir="${basedir}" executable="python" failonerror="true"> <exec dir="${basedir}" executable="python" failonerror="true">
<arg line="verify_output.py" /> <arg line="verify_output.py" />
</exec> </exec>

View File

@ -1,5 +1,5 @@
// containers/AdapterMethodIdiom.java // collections/AdapterMethodIdiom.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// The "Adapter Method" idiom uses for-in // The "Adapter Method" idiom uses for-in
@ -9,15 +9,16 @@ import java.util.*;
class ReversibleArrayList<T> extends ArrayList<T> { class ReversibleArrayList<T> extends ArrayList<T> {
public ReversibleArrayList(Collection<T> c) { super(c); } public ReversibleArrayList(Collection<T> c) { super(c); }
public Iterable<T> reversed() { public Iterable<T> reversed() {
return () -> new Iterator<T>() { // <* Describe *> return new Iterable<T>() {
int current = size() - 1; public Iterator<T> iterator() {
@Override return new Iterator<T>() {
public boolean hasNext() { return current > -1; } int current = size() - 1;
@Override public boolean hasNext() { return current > -1; }
public T next() { return get(current--); } public T next() { return get(current--); }
@Override public void remove() { // Not implemented
public void remove() { // Not implemented throw new UnsupportedOperationException();
throw new UnsupportedOperationException(); }
};
} }
}; };
} }
@ -26,7 +27,7 @@ class ReversibleArrayList<T> extends ArrayList<T> {
public class AdapterMethodIdiom { public class AdapterMethodIdiom {
public static void main(String[] args) { public static void main(String[] args) {
ReversibleArrayList<String> ral = ReversibleArrayList<String> ral =
new ReversibleArrayList<>( new ReversibleArrayList<String>(
Arrays.asList("To be or not to be".split(" "))); Arrays.asList("To be or not to be".split(" ")));
// Grabs the ordinary iterator via iterator(): // Grabs the ordinary iterator via iterator():
for(String s : ral) for(String s : ral)

View File

@ -1,5 +1,5 @@
// containers/AddingGroups.java // collections/AddingGroups.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Adding groups of elements to Collection objects. // Adding groups of elements to Collection objects.
@ -22,4 +22,3 @@ public class AddingGroups {
// underlying array cannot be resized. // underlying array cannot be resized.
} }
} }
/* Output: (None) */

View File

@ -1,5 +1,5 @@
// containers/ApplesAndOrangesWithGenerics.java // collections/ApplesAndOrangesWithGenerics.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,8 +1,8 @@
// containers/ApplesAndOrangesWithoutGenerics.java // collections/ApplesAndOrangesWithoutGenerics.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Simple container use (suppressing compiler warnings) // Simple collection use (suppressing compiler warnings)
// {ThrowsException} // {ThrowsException}
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/ArrayIsNotIterable.java // collections/ArrayIsNotIterable.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/AsListInference.java // collections/AsListInference.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Arrays.asList() makes its best guess about type. // Arrays.asList() makes its best guess about type.
@ -34,4 +34,3 @@ public class AsListInference {
new Light(), new Heavy()); new Light(), new Heavy());
} }
} }
/* Output: (None) */

View File

@ -1,12 +1,12 @@
// containers/ContainerMethods.java // collections/CollectionMethods.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import onjava.*; import onjava.*;
public class ContainerMethods { public class CollectionMethods {
public static void main(String[] args) { public static void main(String[] args) {
ContainerMethodDifferences.main(args); CollectionMethodDifferences.main(args);
} }
} }
/* Output: /* Output:

View File

@ -1,5 +1,5 @@
// containers/CollectionSequence.java // collections/CollectionSequence.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import typeinfo.pets.*; import typeinfo.pets.*;
@ -7,12 +7,12 @@ import java.util.*;
public class CollectionSequence public class CollectionSequence
extends AbstractCollection<Pet> { extends AbstractCollection<Pet> {
private Pet[] pets = Pets.createArray(8); private Pet[] pets = Pets.array(8);
@Override @Override
public int size() { return pets.length; } public int size() { return pets.length; }
@Override @Override
public Iterator<Pet> iterator() { public Iterator<Pet> iterator() {
return new Iterator<Pet>() { return new Iterator<Pet>() { // (1)
private int index = 0; private int index = 0;
@Override @Override
public boolean hasNext() { public boolean hasNext() {

View File

@ -1,11 +1,11 @@
// containers/CrossContainerIteration.java // collections/CrossCollectionIteration.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import typeinfo.pets.*; import typeinfo.pets.*;
import java.util.*; import java.util.*;
public class CrossContainerIteration { public class CrossCollectionIteration {
public static void display(Iterator<Pet> it) { public static void display(Iterator<Pet> it) {
while(it.hasNext()) { while(it.hasNext()) {
Pet p = it.next(); Pet p = it.next();
@ -14,7 +14,7 @@ public class CrossContainerIteration {
System.out.println(); System.out.println();
} }
public static void main(String[] args) { public static void main(String[] args) {
ArrayList<Pet> pets = Pets.arrayList(8); List<Pet> pets = Pets.list(8);
LinkedList<Pet> petsLL = new LinkedList<>(pets); LinkedList<Pet> petsLL = new LinkedList<>(pets);
HashSet<Pet> petsHS = new HashSet<>(pets); HashSet<Pet> petsHS = new HashSet<>(pets);
TreeSet<Pet> petsTS = new TreeSet<>(pets); TreeSet<Pet> petsTS = new TreeSet<>(pets);

View File

@ -1,5 +1,5 @@
// containers/EnvironmentVariables.java // collections/EnvironmentVariables.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/ForInCollections.java // collections/ForInCollections.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// All collections work with for-in. // All collections work with for-in.

View File

@ -1,5 +1,5 @@
// containers/GenericsAndUpcasting.java // collections/GenericsAndUpcasting.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/InterfaceVsIterator.java // collections/InterfaceVsIterator.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import typeinfo.pets.*; import typeinfo.pets.*;
@ -19,7 +19,7 @@ public class InterfaceVsIterator {
System.out.println(); System.out.println();
} }
public static void main(String[] args) { public static void main(String[] args) {
List<Pet> petList = Pets.arrayList(8); List<Pet> petList = Pets.list(8);
Set<Pet> petSet = new HashSet<>(petList); Set<Pet> petSet = new HashSet<>(petList);
Map<String, Pet> petMap = new LinkedHashMap<>(); Map<String, Pet> petMap = new LinkedHashMap<>();
String[] names = ("Ralph, Eric, Robin, Lacey, " + String[] names = ("Ralph, Eric, Robin, Lacey, " +

View File

@ -1,5 +1,5 @@
// containers/IterableClass.java // collections/IterableClass.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Anything Iterable works with for-in. // Anything Iterable works with for-in.

View File

@ -1,5 +1,5 @@
// containers/LinkedListFeatures.java // collections/LinkedListFeatures.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import typeinfo.pets.*; import typeinfo.pets.*;
@ -8,7 +8,7 @@ import java.util.*;
public class LinkedListFeatures { public class LinkedListFeatures {
public static void main(String[] args) { public static void main(String[] args) {
LinkedList<Pet> pets = LinkedList<Pet> pets =
new LinkedList<>(Pets.arrayList(5)); new LinkedList<>(Pets.list(5));
System.out.println(pets); System.out.println(pets);
// Identical: // Identical:
System.out.println( System.out.println(
@ -27,9 +27,9 @@ public class LinkedListFeatures {
System.out.println(pets); System.out.println(pets);
pets.addFirst(new Rat()); pets.addFirst(new Rat());
System.out.println("After addFirst(): " + pets); System.out.println("After addFirst(): " + pets);
pets.offer(Pets.randomPet()); pets.offer(Pets.get());
System.out.println("After offer(): " + pets); System.out.println("After offer(): " + pets);
pets.add(Pets.randomPet()); pets.add(Pets.get());
System.out.println("After add(): " + pets); System.out.println("After add(): " + pets);
pets.addLast(new Hamster()); pets.addLast(new Hamster());
System.out.println("After addLast(): " + pets); System.out.println("After addLast(): " + pets);

View File

@ -1,5 +1,5 @@
// containers/ListFeatures.java // collections/ListFeatures.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import typeinfo.pets.*; import typeinfo.pets.*;
@ -8,7 +8,7 @@ import java.util.*;
public class ListFeatures { public class ListFeatures {
public static void main(String[] args) { public static void main(String[] args) {
Random rand = new Random(47); Random rand = new Random(47);
List<Pet> pets = Pets.arrayList(7); List<Pet> pets = Pets.list(7);
System.out.println("1: " + pets); System.out.println("1: " + pets);
Hamster h = new Hamster(); Hamster h = new Hamster();
pets.add(h); // Automatically resizes pets.add(h); // Automatically resizes
@ -53,7 +53,7 @@ public class ListFeatures {
pets.clear(); // Remove all elements pets.clear(); // Remove all elements
System.out.println("19: " + pets); System.out.println("19: " + pets);
System.out.println("20: " + pets.isEmpty()); System.out.println("20: " + pets.isEmpty());
pets.addAll(Pets.arrayList(4)); pets.addAll(Pets.list(4));
System.out.println("21: " + pets); System.out.println("21: " + pets);
Object[] o = pets.toArray(); Object[] o = pets.toArray();
System.out.println("22: " + o[3]); System.out.println("22: " + o[3]);

View File

@ -1,5 +1,5 @@
// containers/ListIteration.java // collections/ListIteration.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import typeinfo.pets.*; import typeinfo.pets.*;
@ -7,7 +7,7 @@ import java.util.*;
public class ListIteration { public class ListIteration {
public static void main(String[] args) { public static void main(String[] args) {
List<Pet> pets = Pets.arrayList(8); List<Pet> pets = Pets.list(8);
ListIterator<Pet> it = pets.listIterator(); ListIterator<Pet> it = pets.listIterator();
while(it.hasNext()) while(it.hasNext())
System.out.print(it.next() + ", " + it.nextIndex() + System.out.print(it.next() + ", " + it.nextIndex() +
@ -21,7 +21,7 @@ public class ListIteration {
it = pets.listIterator(3); it = pets.listIterator(3);
while(it.hasNext()) { while(it.hasNext()) {
it.next(); it.next();
it.set(Pets.randomPet()); it.set(Pets.get());
} }
System.out.println(pets); System.out.println(pets);
} }

View File

@ -1,8 +1,8 @@
// containers/MapOfList.java // collections/MapOfList.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
package containers; package collections;
import typeinfo.pets.*; import typeinfo.pets.*;
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/ModifyingArraysAsList.java // collections/ModifyingArraysAsList.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/MultiIterableClass.java // collections/MultiIterableClass.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Adding several Adapter Methods. // Adding several Adapter Methods.
@ -7,24 +7,27 @@ import java.util.*;
public class MultiIterableClass extends IterableClass { public class MultiIterableClass extends IterableClass {
public Iterable<String> reversed() { public Iterable<String> reversed() {
return () -> new Iterator<String>() { return new Iterable<String>() {
int current = words.length - 1; public Iterator<String> iterator() {
@Override return new Iterator<String>() {
public boolean hasNext() { return current > -1; } int current = words.length - 1;
@Override public boolean hasNext() { return current > -1; }
public String next() { return words[current--]; } public String next() { return words[current--]; }
@Override public void remove() { // Not implemented
public void remove() { // Not implemented throw new UnsupportedOperationException();
throw new UnsupportedOperationException(); }
};
} }
}; };
} }
public Iterable<String> randomized() { public Iterable<String> randomized() {
return () -> { return new Iterable<String>() {
List<String> shuffled = public Iterator<String> iterator() {
new ArrayList<>(Arrays.asList(words)); List<String> shuffled =
Collections.shuffle(shuffled, new Random(47)); new ArrayList<String>(Arrays.asList(words));
return shuffled.iterator(); Collections.shuffle(shuffled, new Random(47));
return shuffled.iterator();
}
}; };
} }
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -1,12 +1,12 @@
// containers/NonCollectionSequence.java // collections/NonCollectionSequence.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import typeinfo.pets.*; import typeinfo.pets.*;
import java.util.*; import java.util.*;
class PetSequence { class PetSequence {
protected Pet[] pets = Pets.createArray(8); protected Pet[] pets = Pets.array(8);
} }
public class NonCollectionSequence extends PetSequence { public class NonCollectionSequence extends PetSequence {

View File

@ -1,5 +1,5 @@
// containers/PetMap.java // collections/PetMap.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import typeinfo.pets.*; import typeinfo.pets.*;

View File

@ -1,11 +1,11 @@
// containers/PrintingContainers.java // collections/PrintingCollections.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Containers print themselves automatically. // Collections print themselves automatically.
import java.util.*; import java.util.*;
public class PrintingContainers { public class PrintingCollections {
static Collection fill(Collection<String> collection) { static Collection fill(Collection<String> collection) {
collection.add("rat"); collection.add("rat");
collection.add("cat"); collection.add("cat");

View File

@ -1,5 +1,5 @@
// containers/PriorityQueueDemo.java // collections/PriorityQueueDemo.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/QueueDemo.java // collections/QueueDemo.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Upcasting to a Queue from a LinkedList. // Upcasting to a Queue from a LinkedList.

View File

@ -1,5 +1,5 @@
// containers/SetOfInteger.java // collections/SetOfInteger.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/SetOperations.java // collections/SetOperations.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/SimpleCollection.java // collections/SimpleCollection.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/SimpleIteration.java // collections/SimpleIteration.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import typeinfo.pets.*; import typeinfo.pets.*;
@ -7,7 +7,7 @@ import java.util.*;
public class SimpleIteration { public class SimpleIteration {
public static void main(String[] args) { public static void main(String[] args) {
List<Pet> pets = Pets.arrayList(12); List<Pet> pets = Pets.list(12);
Iterator<Pet> it = pets.iterator(); Iterator<Pet> it = pets.iterator();
while(it.hasNext()) { while(it.hasNext()) {
Pet p = it.next(); Pet p = it.next();

View File

@ -1,5 +1,5 @@
// containers/SortedSetOfInteger.java // collections/SortedSetOfInteger.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
// containers/StackCollision.java // collections/StackCollision.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.

View File

@ -1,5 +1,5 @@
// containers/StackTest.java // collections/StackTest.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import onjava.*; import onjava.*;

View File

@ -1,5 +1,5 @@
// containers/Statistics.java // collections/Statistics.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Simple demonstration of HashMap. // Simple demonstration of HashMap.

View File

@ -1,5 +1,5 @@
// containers/UniqueWords.java // collections/UniqueWords.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
import java.util.*; import java.util.*;
@ -20,7 +20,7 @@ public class UniqueWords {
/* Output: /* Output:
[A, B, C, Collections, D, E, F, G, H, HashSet, I, J, K, L, [A, B, C, Collections, D, E, F, G, H, HashSet, I, J, K, L,
M, N, Output, Set, SetOperations, String, System, X, Y, Z, M, N, Output, Set, SetOperations, String, System, X, Y, Z,
add, addAll, added, args, class, containers, contains, add, addAll, added, args, class, collections, contains,
containsAll, false, from, import, in, java, main, new, out, containsAll, false, from, import, in, java, main, new, out,
println, public, remove, removeAll, removed, set1, set2, println, public, remove, removeAll, removed, set1, set2,
split, static, to, true, util, void] split, static, to, true, util, void]

View File

@ -1,5 +1,5 @@
// containers/UniqueWordsAlphabetic.java // collections/UniqueWordsAlphabetic.java
// ©2016 MindView LLC: see Copyright.txt // (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose. // We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Producing an alphabetic listing. // Producing an alphabetic listing.
@ -20,10 +20,10 @@ public class UniqueWordsAlphabetic {
} }
} }
/* Output: /* Output:
[A, add, addAll, added, args, B, C, class, Collections, [A, add, addAll, added, args, B, C, class, collections,
containers, contains, containsAll, D, E, F, false, from, G, contains, containsAll, D, E, F, false, from, G, H, HashSet,
H, HashSet, I, import, in, J, java, K, L, M, main, N, new, I, import, in, J, java, K, L, M, main, N, new, out, Output,
out, Output, println, public, remove, removeAll, removed, println, public, remove, removeAll, removed, Set, set1,
Set, set1, set2, SetOperations, split, static, String, set2, SetOperations, split, static, String, System, to,
System, to, true, util, void, X, Y, Z] true, util, void, X, Y, Z]
*/ */

View File

@ -1,7 +1,7 @@
<?xml version="1.0" ?> <?xml version="1.0" ?>
<project default="run"> <project default="run">
<property name="chapter" value="containers"/> <property name="chapter" value="collections"/>
<property name="excludedfiles" value=""/> <property name="excludedfiles" value=""/>
<import file="../Ant-Common.xml"/> <import file="../Ant-Common.xml"/>
<import file="../Ant-Clean.xml"/> <import file="../Ant-Clean.xml"/>
@ -13,9 +13,9 @@
<jrun cls="ApplesAndOrangesWithoutGenerics" failOnError='false' msg='* Exception was Expected *' /> <jrun cls="ApplesAndOrangesWithoutGenerics" failOnError='false' msg='* Exception was Expected *' />
<jrun cls="ArrayIsNotIterable" /> <jrun cls="ArrayIsNotIterable" />
<jrun cls="AsListInference" /> <jrun cls="AsListInference" />
<jrun cls="CollectionMethods" />
<jrun cls="CollectionSequence" /> <jrun cls="CollectionSequence" />
<jrun cls="ContainerMethods" /> <jrun cls="CrossCollectionIteration" />
<jrun cls="CrossContainerIteration" />
<jrun cls="EnvironmentVariables" /> <jrun cls="EnvironmentVariables" />
<jrun cls="ForInCollections" /> <jrun cls="ForInCollections" />
<jrun cls="GenericsAndUpcasting" /> <jrun cls="GenericsAndUpcasting" />
@ -24,12 +24,12 @@
<jrun cls="LinkedListFeatures" /> <jrun cls="LinkedListFeatures" />
<jrun cls="ListFeatures" /> <jrun cls="ListFeatures" />
<jrun cls="ListIteration" /> <jrun cls="ListIteration" />
<jrun cls="containers.MapOfList" dirpath="../containers" /> <jrun cls="collections.MapOfList" dirpath="../collections" />
<jrun cls="ModifyingArraysAsList" /> <jrun cls="ModifyingArraysAsList" />
<jrun cls="MultiIterableClass" /> <jrun cls="MultiIterableClass" />
<jrun cls="NonCollectionSequence" /> <jrun cls="NonCollectionSequence" />
<jrun cls="PetMap" /> <jrun cls="PetMap" />
<jrun cls="PrintingContainers" /> <jrun cls="PrintingCollections" />
<jrun cls="PriorityQueueDemo" /> <jrun cls="PriorityQueueDemo" />
<jrun cls="QueueDemo" /> <jrun cls="QueueDemo" />
<jrun cls="SetOfInteger" /> <jrun cls="SetOfInteger" />

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