Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

AhmadLang / Java, How To Program, 2004

.pdf
Скачиваний:
626
Добавлен:
31.05.2015
Размер:
51.82 Mб
Скачать

separate thread

Passing a generic type Stack to a generic method Passing arrays and individual array elements to methods Payable interface declaration

Payable interface test program processing Invoices and Employees polymorphically

Permutation.java

PermutationTest.java

Poll analysis program

Polygons displayed with drawPolygon and fillPolygon

PolygonsJPanel.java

Predefined character classes Preincrementing and postincrementing

printArray method in which actual type names are replaced by convention with the generic name E Printing a line of text with multiple statements

Printing array elements using generic method printArray Printing array elements using overloaded methods

Printing multiple lines of text with a single statement

Printing positive and negative numbers with and without the + flag Printing the bits in an integer

PriorityQueue test program

Private members of Time1 are not accessible

private superclass members cannot be accessed in subclass Programmer-declared method maximum that has three double parameters

Properties class of package java.util

protected superclass members inherited into subclass BasePlusCommissionEmployee3 Quantifiers used regular expressions

Queue processing program

QueueInheritance extends class List

Random access file created sequentially

RandomAccessAccountRecord class used in the random-access file programs

RandomAccessAccountRecord.java

Raw type test program

Reading a file by opening a connection through a URL

Reading data sequentially from a random-access file

ReadRandomFile.java

ReadRandomFileTest.java

ReadSequentialFile.java

ReadSequentialFileTest.java

ReadTextFile.java

ReadTextFileTest.java

Recursive evaluation of 5!

Redirecting requests to other resources

RedirectServlet.html document to demonstrate redirecting requests to other resources Regular expressions checking birthdays

Reordering output with argument index

ResultSetTableModel enables a JTable to display the contents of a ResultSet

Right-justifying integers in a field

Rolling a six-sided die 6000 times

Rotator bean that maintains a set of advertisements

SalariedEmployee class derived from Employee

SalariedEmployee class that implements interface Payable method getPaymentAmount Scope class demonstrates field and local variable scopes 2nd

Scope class demonstrating scopes of a field and local variables

Scripting a JavaServer Page-welcome.jsp

Sentinel-controlled repetition

Sequential file created using ObjectOutputStream

Sequential file read using an ObjectInputStream

Sequential file reading using a Scanner

Server portion of a client/server stream-socket connection

Server side of client/server Tic-Tac-Toe program

Server side of connectionless client/server computing with datagrams

Set of recursive calls for fibonacci(3)

Shapes.java

Shapes2.java

Shapes2JPanel.java

ShapesJPanel.java

Shifted and scaled random integers

ShowColors.java

ShowColors2.java

ShowColors2JFrame.java

Sieve of Eratosthenes, using a BitSet

SocketMessageManager implementation of MessageManager for communicating via Sockets and multicast DatagramPackets

Squares eliminated by placing a queen in the upper-left corner of a chessboard

Stack class of package java.util

Stack manipulation program

StackComposition uses a composed List object

StackInheritance extends class List

static class variable used maintain a count of the number of Employee objects in memory Static import Math methods.

static member demonstration

String class character-manipulation methods

String class constructors

String class searching methods

String class startsWith and endsWith methods

String class substring methods

String class valueOf methods

String comparisons

String method concat

String methods replace, toLowerCase, toUpperCase, trim and toCharArray

String permutations generated with a recursive method

StringBuffer class append methods

StringBuffer class character-manipulation methods

StringBuffer class constructors

StringBuffer method length and capacity

StringBuffer methods insert and delete

StringTokenizer object used to tokenize strings

Summary of the 32 recursion examples and exercises in this text

Summing integers with the for statement

Superclass private instance variables are accessible to a subclass via public or protected methods inherited by the subclass

Survey.html document that allows users to submit survey responses to SurveyServlet switch statement testing multiple input values

Table of contents (toc.html) to include down the left side of the XHTML document created by Fig. 27.10 Testing the factorial method

Testing the fibonacci method Testing the iterative factorial solution

Testing the recursive method for permutations Testing the Towers of Hanoi solution

Text-printing program

this used implicitly and explicitly to refer to members of an object

Throwable methods getMessage, getStackTrace and printStackTrace Time1 abstract data type implementation as a class

Time1 class declaration maintains the time in 24-hour format

Time1 object used in a program

Time1 object used in an application

Time2 class with overloaded constructors

Towers of Hanoi for the case with four disks

TowersOfHanoi.java

TowersOfHanoiTest.java

Transaction-processing program

TransactionProcessor.java

TransactionProcessorTest.java

TreeNode and Tree class declarations for a binary search tree try-catch-finally exception-handling mechanism Two-dimensional array representation of a maze

Using an object to store a shape

Using floating-point conversion characters Using integer conversion characters Using SortedSets and TreeSets

Using the # flag with conversion characters o and x

Using the ( flag to place parentheses around negative numbers Using the , flag to display number with thousands separator Using the 0 (zero) flag

Using the character and string conversion characters

Using the enhanced for statement to total integers in an array Using the space flag to print a space before non-negative values Using variable-length argument lists

UsingChainedExceptions.java UsingExceptions.java 2nd 3rd

Utility class that displays bit representation of an integer

Validating user information using regular expressions

Vector class of package java.util

Welcome file index.html

WelcomeServlet that responds to a simple HTTP get request

WelcomeServlet2 responds to a get request containing data

WelcomeServlet3 responds to a post request containing data

Wildcard test program

WriteRandomFile.java

WriteRandomFileTest.java

Writing data to a random-access file exception 2nd

Exception class

exception handler exception handling

exception implicit object 2nd 3rd

exception parameter

Exception-handling example with divide by zero Exceptions

ArrayIndexOutOfBoundsException

CannotRealizePlayerException

NoPlayerException

execute

execute an applet in a Web browser 2nd execute method

of CachedRowSet of Executor

of JdbcRowSet

executeQuery method of Statement

executing an application execution stack execution-time error Executor interface

execute method

Executors class

newCachedThreadPool method

newFixedThreadPool method ExecutorService interface 2nd

shutdown method submit method 2nd

Exercises 15 Puzzle

Accounts Payable System Modification Airline Reservation System

Analog Clock Animation Artist

Automatic Jigsaw Puzzle Generator Background Audio

Blackjack game Calendar/Tickler File

Calling Attention to an Image Card Shuffling and Dealing

Catching Exceptions Using Class Exception Catching Exceptions Using Outer Scopes Catching Exceptions with Superclasses

check protection Checkers game

Chess game

Circles Using Class Ellipse2D.Double Coloring Black-and-White Photographs and Images Complex Numbers

Computer Simulator

computer-assisted instruction (CAI) 2nd computing factorials

Concentric Circles Using Class Ellipse2D.Double Concentric Circles Using Method drawArc Constructor Failure

Converting Temperature Crossword

crossword puzzle generator

Date and Time Class

Date Class

De Morgan's Laws Dice Rolling Digital Clock Drawing Cubes Drawing Spirals

Drawing Tetrahedrons

Duplicate Elimination

Dynamic Audio and Graphical Kaleidoscope Eight Queens 2nd

Eight Queens Brute Force Approaches Enhanced Rectangle Class Enhancing Class Date

Enhancing Class Time3 Fibonacci Series

File Matching

File Matching with Multiple Transactions File Matching with Object Serialization Find the Minimum Value in an Array Fireworks Designer

Floor Planner Fractals

Game of Craps

Game of Pool

Generating Mazes Randomly Greatest Common Divisor

Grid Using Class Line2D.Double

Grid Using Class Rectangle2D.Double

Grid Using Method drawLine Grid Using Method drawRect "guess the number" game Hardware Store Inventory Horse Race

HugeInteger Class Image Flasher

Image Zooming

JColorChooser Dialog

Knight's Tour 2nd

Knight's Tour Brute Force Approach Knight's Tour Closed Tour Test Limericks 2nd

Machine Language Programming Maze Generator and Walker

Maze Traversal Using Recursive Backtracking Mazes of Any Size

Metric Conversion Program

Modifying the Internal Data Representation of a Class Morse Code

Multimedia-Based Simpletron Simulator One-Armed Bandit

Order of catch Blocks Palindromes

Payroll System Modification perfect number

Pie Chart

Pig Latin Poker game Print an Array

Print an Array Backwards

Printing Dates and Times Printing Dates in Various Formats Pythagorean Triples

Random Characters Random Colors

Random Interimage Transition

Random Lines Using Class Line2D.Double Random Triangles

Randomly Erasing an Image Rational Numbers

Reaction Time/Reaction Precision Tester

Rectangle Class Recursive power Method Rethrowing Exceptions

Returning Error Indicators from Methods Rotating Images

Rounding Numbers

Sales Commissions

SavingsAccount Class Screen Saver

Screen Saver for Random Number of Lines Screen Saver Using the Java2D API Screen Saver Using Timer

Screen Saver with Shapes Scrolling Image Marquee Scrolling Marquee Sign Selecting Shapes

Set of Integers

Shape Hierarchy

Shift Right

Shuffleboard

Sieve of Eratosthenes Spelling Checker project Student Poll

Telephone-Number Word Generator exercise Text analysis

Text Flasher

"The Twelve Days of Christmas" Song Tic-Tac-Toe

Time to Calculate Fibonacci Numbers Tortoise and the Hare

Tortoise and the Hare Simulation Total Sales

Turtle Graphics 2nd Visualizing Recursion

Writing the Word Equivalent of a Check Amount exists method of File

exit debugger command exit method of System 2nd

exit point

of a control statement

EXITED constant of nested class EventType

exiting a for statement exp method of Math

expanded submenu explicit conversion exponential format exponential method exponential notation exponentiation exponentiation operator expression 2nd 3rd

Expression Language (EL) expressions extend a class

extending a class extends

extends attribute of page directive

extends keyword 2nd 3rd

extensibility

extensible language 2nd 3rd eXtensible Markup Language (XML) extension mapping

extensions mechanism (extending Java with additional class libraries) external event

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z]

Facade design pattern 2nd 3rd facade object

factorial 2nd 3rd

Factorial calculations with a recursive method factorial method

FactorialCalculator.java

FactorialCalculator.java (Iterative)

FactorialTest.java

FactorialTest.java (Iterative)

factory

factory method

Factory Method design pattern 2nd 3rd

faculty.juniata.edu/kruse/cs2java/recurimpl.htm

Fahrenheit 2nd

Fahrenheit equivalent of a Celsius temperature fairness policy of a lock

false keyword 2nd 3rd 4th

fatal error 2nd 3rd fault tolerant fault-tolerant program fetch

fibonacci method

Fibonacci numbers generated with a recursive method Fibonacci Series

Fibonacci series 2nd 3rd defined recursively

FibonacciCalculator.java

FibonacciTest.java

field 2nd 3rd

Field Detail section in API field of a class 2nd

Field Summary section in API field width 2nd 3rd

FIFO (first-in, first-out) file

file attribute of include directive

File class

canRead method canWrite method

exists method

File methods

getAbsolutePath method

getName method

getParent method

getPath method isAbsolute method isDirectory method isFile method 2nd lastModified method

length method

list method toURL method

used to obtain file and directory information file extensions

.aif 2nd

.aiff 2nd

.au 2nd

.avi

.class

.gif

.jpeg

.jpg

.mid 2nd

.mov

.mp3

.mpeg

.mpg

.png

.rmi 2nd

.spl

.swf

.wav

file folder file matching

exercise program

with Multiple Transactions exercise with Object Serialization exercise

File methods

file name

file processing 2nd file server

file-open mode

file-position pointer 2nd

File.pathSeparator

FileDemonstration.java 2nd

FileDemonstrationTest.java 2nd

FileEditor class that encapsulates file-processing capabilities

FileEditor.java

FileInputStream class 2nd 3rd 4th 5th 6th

FileNotFoundException class

FileOutputStream class 2nd 3rd 4th 5th 6th

FileReader class 2nd

FILES_AND_DIRECTORIES constant of JFileChooser

FILES_ONLY constant of JFileChooser

FileWriter class 2nd

filing cabinet fill method

of Arrays

of Collections 2nd

of Graphics2D 2nd 3rd 4th fill method of Arrays

fill pattern fill texture fill with color

fill3DRect method of Graphics 2nd

fillArc method of Graphics 2nd 3rd

filled rectangle filled shapes

filled three-dimensional rectangle filled-in shape

fillOval method of Graphics 2nd 3rd 4th fillPolygon method of Graphics 2nd 3rd

fillRect method of Graphics 2nd 3rd 4th

fillRoundRect method of Graphics

filter

filter stream

FilterInputStream class FilterOutputStream class

final class

keyword 2nd 3rd 4th 5th 6th local variable

variable

variable initialized with a constructor argument 2nd variable must be initialized

final state in the UML 2nd 3rd final value

finalize method 2nd 3rd

of Object finally

block 2nd 3rd clause 2nd 3rd keyword

find method of Matcher 2nd

Find the Minimum Value in an Array exercise fireTableStructureChanged method of AbstractTableModel

Fireworks Designer exercise first method of SortedSet

first pass