Chapter 1 Source Code

Using the enum in Java 5
Creating an inner class
Creating a local inner class
Creating a class with a generic type
Making an assertion that fails
A simple class to use for experimenting with types

Chapter 2 Source Code

Using a regex pattern to find URLs in a document
Finding occurrences of repeated words
Replacing occurrences of a word with random variants
Parsing surnames from the U.S. Census data file
Using Arrays.deepToString in Java 5

Chapter 3 Source Code

Using DOM4J to read a UBL document and create HTML output
An XML filter that ignores contents of "ignore" tags
Using Stack and HashMap in a SAX ContentHandler
How SAX events can be sent directly to a ContentHandler
Indexing content using Lucene
Searching content using Lucene
An XML filter that prunes an XML tree
An XML filter that adds an attribute to each tag
A simple SAX ContentHandler
A simple console program to load a SAX ContentHandler
A "screen scraper" that reads data from a web page
Removing all tags from a document (for a screen scraper)

Miscellaneous files

Purchase Order XML file
Log file parser - JavaCC source code
Log file parser to XML - JavaCC source code
Sample log file - good
Sample log file - bad

Chapter 4 Source Code

Creating a simple RDF graph of company/employee relations using Jena
Creating a simple RSS feed
Reading an RSS newsfeed
Implementing a simple RSS poller observer
Filtering RSS newsfeeds using a PollerApproverIF

Chapter 5 Source Code

A JGA Generator that generates the cubes of the natural numbers
A unary functor that returns whether a number is even
Basic bit manipulation using the BitVector class from Colt
Functor that performs an AND function on the bits in a BitVector, and returns a single-bit BitVector
Creating a 4-bit multiplexer using a BitVector functor
A simple implementation of a truth table
A simple class using JScience Quantity objects such as Length and Mass
Creating units in JScience
Using JScience's Rational object
Using Polynomial objects in JScience
Generic Component/Port/Wire framework
Using JGraphT to create a graph (the human organs example)
A simple example of managing Component objects and their connections
Test harness for the SimpleMetaComponent
A TruthTable-based ComponentEngine<Boolean> for use with Component<Boolean>
Running neural nets created in the Joone editor
Using the JGAP genetic algorithms API to evolve a truth table
Joone / JGAP integration (Sourceforge project)
An implementation of a JADE Behaviour
A simple Jade agent that uses a Behaviour
Reading/writing messages in a Jade agent
Example accessing the JWordNet dictionary

Chapter 6 Source Code

A SwiXML GUI description XML file
Loading a SwiXML GUI from an XML description file
Sample SVG file
Creating SVG files with Batik
Dsiplaying SVG files with Batik
Using the JGraph API to display data from a graph
Using JasperReports
Planets report (JasperReports XML file)
Simple 2D data visualization
Simple affine transformation
Creating zoomable GUIs using Piccolo

Chapter 7 Source Code

Basic JFugue example (Mary Had a Little Lamb, and a chord progression)
Example using JFugue Renderer to obtain MIDI event data
Example of sending MIDI output
Using JMusic to synthesize a filtered sawtooth wave
Using JMusic to synthesize a filtered square wave and sawtooth wave
Using JMusic to synthesize a noisy sine wave
Outputting sound using low-level Java Sound
Reading data from input line
Simple Java Speech example
Creating a Javolution RealTimeObject subclass
Using a Javolution RealTimeObject in a PoolContext
Creating a thread that works with a CyclicBarrier

Chapter 8 Source Code

Using LEJOS to control Lego robots
Using the AWT Robot class
Reading data using a GET request with HttpClient
Submitting and reading data using a POST request with HttpClient
A Java-based cell matrix simulator at Cell Matrix
Example Ant build file
BeanShell interpreter usage from Java
Example JUnit test

LGPL License