Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Index
Symbols% (modulus operator) 99&& (AND) Java operator 110,
115, 133*/ (asterisk-slash),
terminating a multipleline comment 48
* (multiply) arithmeticoperator 98
/* (slash-asterisk), beginninga multiple line comment 48
/**, beginning documentationcomments 49
/ (divide) arithmetic operator 98/ (forward slash), compared to
backward slash \ 178// (double slash), indicating
comments 45// (forward slashes), beginning
a single line comment 48{} (braces)
enclosing the body of aclass program 44
indicating the beginningand end of blocks ofcode 44
placing in a switchstatement 126
placing statements in ablock 113
|| (OR) Java logical operator 110,115, 133
+ (add) arithmetic operator 98< (LESS THAN) operator 110, 133<= (LESS THAN OR EQUAL
TO) operator 110, 133<> (NOT EQUAL TO)
operator, not recognizedin Java 110
= (assignment operator)combining arithmetic
operators with 99in Java 98, 110
= (EQUAL TO) COBOLoperator 133
!= (NOT EQUAL TO) Javaoperator 110, 133
!= (NOT EQUAL TO)operator 110
! (NOT) Java operator 110, 133= in the Java assignment
statement 47
260
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 261
== (EQUAL TO) Javaoperator 110, 133
== (EQUAL TO) operator 110> (GREATER THAN)
operator 110,133
>= (GREATER THAN OREQUAL TO) operator 110,
133\ (backward slash) as an
escape character 178: (colon), placing in a switch
statement 126- (hyphen), not allowed as
part of a Java identifier 49– (subtract) arithmetic
operator 98. (period), terminating
COBOL statements 45; (semicolon)
placing in a switchstatement 126
terminating Javastatements 45
Aabs() method of the Math
class 99abstract classes 58, 60abstract keyword 251Abstract Windowing Toolkit.
See AWTAccept button 213Accept button handler object 214Accept command button 209AcceptButtonHandler class
adding to theCustomerGUIFour class 214
creating 213
Access relational databasecreating 184using 236
accessibility, defining to aclass 45
accessor methods 52, 251Account.java program 58–60,
235AccountProcessor.java
program 62–3, 90–1action event object 213action events 213action listener 213ActionListener class 213ActionListener object 213actionPerformed method 213actions, performed by users 199Ada programming language 23add (+) arithmetic operator 98add method of the Container
class 205ADD statement in COBOL 98addActionListener() method 254addWindowListener()
method 254aggregation 32–4, 251Agile Methodology 232Alt key with a menu
mnemonic 225Amortizer.java program 147–9analysis and design, required
by the OO paradigm 231AND (&&) Java operator 110,
115, 133AND COBOL operator 133ANSI standards for COBOL 12Applet HTML tag 226applets 6, 251
diminished capability of 225
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
262 INDEX
applets (cont.)running 226writing 225–6
architecture issues 246–7Area A of the COBOL coding
line 47Area B of the COBOL coding
line 47arguments 54, 251
passing arrays as 166passing to methods 54
arithmetic expression,containing mixed datatypes 93
arithmetic operators 82, 98–9ArithmeticException
exception 85ArithmeticExceptionDemo.java
program 85array elements 157arrays
of arrays 162declaring in COBOL 152declaring in Java 153passing as arguments 166populating COBOL 155–7populating Java 156searching 167–71
arrowed lines in a sequencediagram 237
ASCII character set 68assignment operator (=)
combining arithmeticoperators with 99
in Java 98, 110assignment operators 99, 251assignment statements 47, 70, 251
performing computation 76, 98populating a Java array 157
association 29, 34, 251
asterisk-slash (*/),terminating a multipleline comment 48
attributes 24, 251defining 42inheritance by subclasses 31methods reporting the
values of 52representing by variables
with class scope 71storing values of 190
AWT (Abstract WindowingToolkit) 199, 251
Event package 214hierarchy of classes 199importing 205layout managers in 214
Bbackspace “\b” special
character 178backward slash (\) as an
escape character 178basic arithmetic operators 98bean 6, 251
See also JavaBeansbinary association 35, 251block of statements 113Booch, Grady 23boolean data type 68Boolean value (true or false) 98Boolean variables 251
emulating condition names 117explicitly assigning values
to 118BorderLayout manager 215, 227BoxLayout manager 215, 227braces ({})
enclosing the body of aclass program 44
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 263
indicating the beginningand end of blocks ofcode 44
placing in a switchstatement 126
placing statements in ablock 113
break keyword 123break statement 145browsers
containing bytecodeinterpreters 11
loading and executingapplets 226
business environment,diversity of 16
business logic 232, 233button events 227button objects 214button-handling class 213buttons 209
adding to a window 209–14controlling the behavior of 213functionality added by 213in a GUI 198
byte data type 68, 78, 92byte streams 174, 251bytecode 10bytecode program 12
CC# language 13C++ language 5, 23
compared to Java 9as a hybrid 9increment/decrement
operators inherited from 99CALL statement in COBOL 54Cambridge University Press
web site 17, 246
case keyword in the Javaswitch statement 123
case sensitivityof Java 49of method names 74
case structure 251computing a service charge
using 123–6implementing 121
CastDemo.java program 77casting 76, 93, 252
See also type castingcatch block, executing the
code in 85catch keyword 252catching exceptions 84CD-ROM with this book 58CENTER region of the
content pane 215char data type 68, 70character streams 174, 252character string data,
storing 81character strings 73
defining 73enclosing in double quotes 70
charAt() method 74, 75checking accounts
posting checks to 235–46types of 109
CheckingAccountDA.javaprogram 236
CheckingAccount.javaprogram 60–2
adding code foraccountType 119
with the customNSFException added 89–90
CheckingAccountPD.javaprogram 235
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
264 INDEX
children. See also subclassespermitted only one parent 30
class diagram 35, 42, 232, 233class header 44, 45, 252class methods 168, 252class names, capitalizing 50class programs 25, 42, 231, 252
data defined in 26structure of 44writing 58
class scope 71, 252class variables 71classes 25, 50, 252
data declarations for 80defining accessibility to 45diagramming 26–7general linkage between 29naming 49relationships among 28UML notation for 26
ClassNotFoundException 187ClearButtonHandler class 214client-server computing
model 195Close button in a GUI frame 202CNB. See Community
National Bank (CNB)case study
Coad’s methodology 232COBOL
column restrictions andmargin rules of 47
compared to Java 4, 17as a complementary
development tool withJava 16
demand for programmers 13evolution of 12long-term use of 13
losing data because oftruncation 78
number of programmers 13predicted demise of 12rounding compared to Java 100rounding in 101strength of 12translation to Java 17
COBOL condition. Seeconditions
COBOL programmers,reasons for retraining inJava 15
COBOL subprograms,compared to Javamethods 54
COBOL-74 PERFORMstatements, using towrite loops 131
COBOL-78 syntax for anarray 155
COBOL-85 PERFORMstatements 131
COBOL-85 PERFORM WITHTEST AFTER clause 137
codebeginning and end of
blocks of 44conventions for writing 49
code reuse, inheritance as anexcellent tool for 32
coding shortcuts, involvingJava operators 99
college curricula,programming languagestaught in 14
colon (:), placing in a switchstatement 126
column restrictions 47
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 265
columnsin a relational database 181in a two-dimensional array 160
command button 209comments
indicating with the doubleslash (//) 45
multiple line 48types of 47writing in Java 47–9
Common Request BrokerArchitecture (CORBA) 247,
252communication port,
attaching a Socket objectto 195
Community National Bank(CNB) case study 22
class diagram 35, 42, 233classes 27data declarations for classes 79deployment diagram for 246system for posting checks
235–46types of accounts 31
compile time, validatingclasses and methods at 39
compiled code 252compiled environment 10compilers
indentation ignored byCOBOL and Java 114
for multiple platforms 10complementary development
tools 16complex data types 73, 252Component class, inheriting
attributes and behaviorsfrom Object 199
component diagrams 233components
adding to regions of aBorderLayout 215
of COBOL programs 234of a GUI 199physical location of 246
compound conditions 115, 252computation in Java 82–106computational errors,
trapping in COBOL 87computational methods,
provided by the Mathclass 99
COMPUTE statementarithmetic operators used
in 98in COBOL 76, 98
computeServiceCharge()method
for CheckingAccount 108using if statements 120–1
concatenation operator 75condition names 252
coding in COBOL 117emulating in Java 117, 128
condition values, dynamicallyassigning in COBOL 118
conditional operator 116, 252conditions 109, 252Connection class of
java.sql 184Connection object 185CONSISTS-OF relationship.
See aggregationconstants 252
defining in Java 72in the Math class 100naming 50
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
266 INDEX
constructor method 57, 252for CustomerGUIFive.java 219for the CustomerGUIOne
class 201for CustomerGUIOne.java 202for the CustomerGUISix
class 225for CustomerGUITwo.java 205executing 51–2format of 52not included in an applet 226
Container class 199, 205content pane 205, 215continue keyword
in Java loops 116Java usage compared to
COBOL 145CONTINUE reserved word
completely different usagein COBOL and Java 116
used in a COBOL Ifstatement 116
continue.break statement inJava 145
convention for writing code 49CORBA (Common Request
Broker Architecture) 247, 252CORBA software 247createStatement() connection
method 185currency object 105custom exception 88–9, 253custom exception classes 87–91custom methods 60, 253customer class, adding to the
inheritance hierarchy 35Customer object 191CustomerGUI.java applet 226CustomerGUIOne.java
program 201–2
CustomerGUITwo.javaprogram 203–5
CustomerGUIThree.javaprogram 206–8
CustomerGUIFour.javaprogram 209–12
CustomerGUIFive.javaprogram 215–20
CustomerGUISix.javaprogram 220–5
Customer.java program 44, 53CustomerProcessor.java
program 56–8
DDA (data access) classes 234, 253dashed lines in a sequence
diagram 237data
defining in Java 66–80retrieving using the SQL
Select statement 182data access
classes 234, 253function 234techniques 173
Data Access class program 236data definition
statements for characterstrings 73
writing code for 68Data Division, no equivalent
in Java 68data encapsulation 60data file structure, changing 235data items 42
See also variablesdata streams 174, 258data type classes 253data types 253
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 267
in ascending range of valueorder 93
categories of Java 68changing for variables 76establishing in COBOL 67explicitly casting 93in Java 68mixed in an arithmetic
expression 93truncation errors from
mixing 93writing explicitly 70
database access 181–9database driver 240
See also driversdatabase language, structured 182DataBaseDemo.java program
184–9databases, identifying 185DataInputStream object 177, 195DCOM (Distributed COM)
247, 253decimal format in
NumberFormat 106decimal positions, specifying 77decision rules for service
charges at CNB 109decrement operators 99, 253default case, coding 126deployment diagrams 233, 246,
253descriptive names for
variables 68design. See OO designdevelopment process
discipline 15device independence of Java
program code 174diamond symbol, indicating
aggregation 33
Distributed COM (DCOM) 247,253
distributed systems, overheadrequired by 248
divide (/) arithmetic operator 98divide by zero error,
exception handling for 85DIVIDE statement in COBOL 98division, returning the integer
remainder of 99do loops
compared to while loops 138printing the numbers 1
through 5 137do statement 137documentation comments 49DoLoopDemo.java program 138Double class 94double data type 68, 71, 77,
92double quotes, enclosing
character strings 70double slash (//), indicating
comments 45do-while loop 137DriverManager class 184, 185drivers
for database connectivity 185loading database 240
DSDM 232Dynabook project 23dynamic binding 38, 39, 253
EE constant in the Math class 100EAST region of the content
pane 215edit characters 104edit picture clause 104–6Eiffel language 8, 23
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
268 INDEX
element numbers for Javaarrays 154
elementary item in COBOL 67elements. See array elementsELSE clause 112encapsulation 37, 253END-EVALUATE scope
terminator in COBOL 123endless loop, creating in
Java 134END-PERFORM scope
terminator 131EQUAL TO (=) COBOL
operator 133EQUAL TO (==) Java
operator 110, 133equals() method 73, 74equalsIgnoreCase() method 74error registration 253escape character, backward
slash (\) used as 178EVALUATE statements
compared to switch 123computing a service charge
123–5nested 124
event handling methods 201, 253event listener 200, 201event listening 253event object 200event source 200event-driven programming 199,
253event-handling mechanism 200events 253
generating in GUIs 199handling 213
Exception class, hierarchy of 84exception classes, custom 87–91
exception handling for adivide by zero error 85
exceptions 83, 254catching 84steps for dealing with 84throwing 84
executeQuery method 186explicit casts 93expression 98, 254Extensible Markup Language
(XML) 13eXtreme Programming 232
Ffields 42
See also text fields;variables
File object 176, 177, 190,191
FileInputStream object 190FileOutputStream object 177, 190filespec 176, 190filler, omitting 155–66final keyword 72, 81, 254findZip() method 168, 169FindZipCode.java program 168–9,
171Flavors language 23FLEX system 23Float class 94float data type 68, 92floating point value 62, 69floor() method of the Math
class 99FlowLayout manager 214, 227for loop 140ForLoopDemo.java program 142format() method 105forName() class method 185
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 269
forward slash (/), compared tobackward slash \ 178
forward slashes (//), beginninga single line comment 48
FOUND-IT-SWITCH,defining in COBOL 167
framecentering on the screen 205creating with no
contents 201–2moving manually around
the screen 202functions, isolating in
programs 235Fusion 232
Ggeneralization/specialization
relationship (gen-spec) 29get, beginning an accessor
method 52getAccount() method
calling in the Data Accessclass 241
of Checking-AccountDA.java 236
creating aCheckingAccount object 242
getConnection() method 185getCurrencyInstance()
method 105getInstance() class method 105getString() ResultSet method 186Gosling, James 5graphical elements 198graphical user interfaces. See
GUIsGREATER THAN (>)
operator 110
GREATER THAN OR EQUALTO (>=) operator 110
GridBagLayout manager 215,227
GridLayout manager 215, 227group item in COBOL 67GUIs (graphical user
interfaces) 198components of 199, 205design tools 214graphically designing 214labels in 203writing 226
HHAS-A relationship. See
aggregationHEIGHT variable 201, 202hierarchical structure,
inheritance as 30hybrid languages 9, 23, 254hyphen (-), not allowed as
part of a Java identifier 49
IIDE 254identifiers 49, 254If statements 108
COBOL compared to Java 110,127
computing a service charge118–21
evaluating a condition inCOBOL 109
if statementsin Java 109nested 114structure of Java 111
if-else statement 112
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
270 INDEX
implements keyword 213, 228,254
increment operators 99, 254indentation
ignored by COBOL andJava compilers 114
of nested If statements 121independent modules,
decomposing processinginto 234
index 254in COBOL 153enclosing in a separate
bracket in Java 161in Java 153using brackets for 157
information hiding. Seeencapsulation
information systemscurricula, popularity ofJava 14
inheritance 29–32, 58, 254aggregation and 34as a hierarchical structure 30multiple 30, 255
inheritance relationship 29inherited methods 62init() method in an applet 226initialize() method
calling from Checking-AccountPD.java 239
calling in the data accessclass 239
of Checking-AccountDA.java 236, 240
of Checking-AccountPD.java 236
inline PERFORM 131input stream 174
instance methods 168, 254See also operations
instance variables 119See also attributes
instances 26, 254instruction scope 71, 254int (integer) data type 68, 71, 92integer
converting to a String 95data type categories 68division 77variables 76
Integer class 93, 94interface 213, 228,
254interface function 234Internet, Java redirected to 6Internet Explorer, bytecode
interpreter in 11Internet web browsers,
containing bytecodeinterpreters 11
intValue() method 95I-O class library. See java.io
packageIS programs, languages taught
in undergraduate 14IS-A relationship 29, 30, 58
JJ, beginning Swing class
names 199Jacobson, Ivar 24JApplet class 220, 226JAR (Java ARchive) files 6, 254Java 4
advantages in applicationdevelopment 8–12
business benefits of 5
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 271
case sensitivity of 49column restrictions and
margin rules comparedto COBOL 47
compared to COBOL 4, 17compiling into native code 12as a complementary
development tool withCOBOL 16
differences when comparedto other languages 8
encroachment intoCOBOL’s camp 14
history and overview of 4–6introduction of 6, 23as object-oriented 9popularity of 6–8portability of 10–12potential to replace
COBOL 13program structure of 41–63redirected to the Internet 6replacing COBOL in college
curricula 14rounding in 102running on multiple
platforms 11simplicity of 8static and dynamic binding
supported 39Java ARchive files (JAR files) 6,
254Java Community Process
program 5Java compiler on the
CD-ROM with this book 58Java database connectivity
(JDBC) class programlibrary 184
Java Development Kit (JDK) 6.java extension 64Java Integrated Development
Environment (IDE) 254Java name, licensing of 6Java platform 5Java Remote Method
Invocation (Java RMI) 247Java SDK (Software
Development Kit) 12, 254Java Swing classesJava Swing package. See
Swing packageJava virtual machine (JVM) 6, 10,
255java.awt package 199java.awt.event class 200JavaBeans 6, 9,
251javadoc program 49java.io package 174
class hierarchy 175importing classes 177,
191java.lang class library
containing classes for eachprimitive data type 93
Math class 99java.net package 195JavaOne conference 6JavaScript 6, 255java.sql package 184java.text package 104javax.swing
event class 200package 199
JButton class 209JComponent objects 199JComponents class 199
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
272 INDEX
JDBC (Java databaseconnectivity) classprogram library 184
JDK (Java Development Kit) 6JFrame class 202, 220JLabel
class 203objects 205
JMenuclass 220object 225
JMenuBarclass 220object 225
JMenuItemclass 220objects 225
JPanel objects 220JPasswordField class 206JTextComponent class 205JTextField
class 205objects 205, 208
JVM. See Java virtual machine
KKay, Alan 23
Llabels
adding to a window 203–5in a GUI 198right-aligning within a grid
219languages, taught in
undergraduate ISprograms 14
layout, setting for a GUI 205layout commands 199
layout managers 255in the AWT package 214in Java 227
LayoutManager class 199layouts, setting for panels 220length() method 74, 75length public variable 158, 171LESS THAN (<) operator 110LESS THAN OR EQUAL TO
(<=) operator 110, 133LINKAGE SECTION of a
COBOL program 54listener. See action listenerlistener object 255literals, writing in Java 70loan
amortization schedule 146–9payment 101, 152tracking 160
locale for the NumberFormatclass 104
logical expression 110, 123,255
logical operators 255COBOL compared to Java 126in Java 110Java compared to COBOL 110
Long class 94long data type 68, 92loop counters 140loops
structures of 130terminating the current
iteration 145termination of 137types of Java 129writing in Java 129–49writing within loops in
Java 144
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 273
Mmachine code, compiling
programs into 10main() method 55
not included in an applet 226in OneDimArray-
Demo.java 159in PostChecksGUI.java 239in StringDemo.java 74in TwoDimArrayDemo.java 164
Martin and Odell’smethodology 232
Math class 83, 99–104MathClassDemo.java
program 103Math.E constant 100Math.PI constant 100max() method of the Math
class 99menu bar in a GUI 198menu events 227menu item 220menus
defining 220in GUIs 220
messages 35, 255method call 213method header 44, 46,
255method headings 213method scope 71, 141–255method signature 46, 65,
255methods 24, 255
accessibility of 46beginning in lowercase 50calling 54changing attribute values 52in a class program 44
execution of Java 54inheritance by subclasses 31invoking 54messages invoking 35naming 49obtaining values stored in
objects 94passing arrays to 166provided by the String
class 73reporting the values of
attributes 52throwing exceptions 84
Microsoft, language strategyof 13
Microsoft Access relationaldatabase
creating 184using 236
min() method of the Mathclass 99
mixed data types in anarithmetic expression 93
mnemonic for a menu item 225modules, decomposing
processing into 234modulus operator (%) 99monthly loan payment 146MOVE statement in COBOL 70MS Windows system, loading
drivers for 185multiple inheritance 30, 255multiple line comment 48multiplicity 33, 255multiply (*) arithmetic
operator 98MULTIPLY statement in
COBOL 98mutator methods 52, 255
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
274 INDEX
Nnaming conventions 49n-ary association 35, 255native language compiler 248nested EVALUATE
statements 124nested If statements
computing a service charge118–21
indentation of 121using Java 114
nested loops 143–4nested switch statements 125.NET strategy of Microsoft 13Netscape, bytecode
interpreter in 11networks, accessing 195new keyword in Java 154new line “\n” special
character 178next() method 186NoAccountFoundException
exception 240, 242non-numeric value, trying to
convert with valueOf() 95NORTH region of the content
pane 215NOT (!) Java operator 110, 133NOT COBOL operator 133NOT EQUAL (!=) Java
operator 110NOT EQUAL (!==) operator 110NOT EQUAL TO (<>)
operator 110NOT EQUAL TO (!=) Java
operator 133NOT EQUAL TO (NOT=)
COBOL operator 133notation set for OO modeling 24
NSFException exception 240, 243n-tiered architecture 246NumberFormat class 83, 104–6NumberFormatDemo.java
program 105NumberFormatException
exception 95numbers, formatting with
commas 105numeric data
converting to a String 94types of 92
OObject class 199Object COBOL 13
early versions of 23as a hybrid language 9
object communication 35–7object interface 256Object Management Group
(OMG) 24, 231, 247Object Modeling Technique
(OMT) 232object name 26, 256Object Pascal 9object persistence 175, 189, 256object pointer 26, 256
See also pointerobject reference variables 57, 94,
256Object Request Broker (ORB) 246,
248, 256object scope 71object serialization 173, 175,
189–95, 256object-based languages 29, 255ObjectInputStream object 190Objective-C language 9, 23
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 275
object-orientation. See OOobject-oriented languages. See
OO languagesobject-oriented programming
language (OOPL) 23object-oriented systems 230ObjectOutputStream object 190objects 24, 50, 255
creating 50–2diagramming 26–7Java arrays as 158options for storing 175persistence of 175, 189, 256physical allocation to
different platforms 246physical distribution of
objects 246retrieving 190storing for future access 189wrapping around data 94
ObjectSerializationDemo.javaprogram 191–5
occurs clause in COBOL 153ODBC (Open Database
Connectivity) standard 185OMG (Object Management
Group) 24, 231, 247ON SIZE ERROR clause in
COBOL 87OneDimArrayDemo.java
program 158–60one-dimensional arrays 256
declaring 152–5in Java 151populating 155–7
OO (object-orientation)analysis 23, 232design 231, 233–5development 22, 229–46
history of 22–4of Java 9methodologies 231modeling 24as a new paradigm in
software development 16programming 27software 18
OO (object-oriented)languages 9, 29, 256
OO design 23OOPL (object-oriented
programming language) 23OPEN (Object-Oriented
Process, Environment,and Notation)methodology 232, 256
Open Database Connectivity(ODBC) standard 185
operating systems, providingJVMs 11
operations, defining 42operator precedence, rules of 76operators 49, 133OR (||) Java logical operator 110,
115, 133OR COBOL operator 133ORB (Object Request Broker) 246,
248, 256ordinal values 123output, displaying in Java 57output stream 174
Ppackage diagrams 233, 235, 256packages 246, 256panels 220, 256paragraph name in
PERFORM statements 131
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
276 INDEX
parameter listin a method 46in a method header 54
parameters 54, 256parent. See superclassparentheses, following
method names 50PART-WHOLE relationship 33
See also aggregationpassing by reference 166, 256passwords, creating a text
field for 205PD (problem domain) classes 234,
257percent format in
NumberFormat 106PERFORM statements
in COBOL 129using to write loops 131
performance issues 247PERFORM-UNTIL statement 132PERFORM-VARYING
statementin COBOL 168writing nested loops in
COBOL 143PERFORM-VARYING-AFTER
statement 144PERFORM-VARYING-UNTIL
statement 140period (.), terminating
COBOL statements 45persistent object 175, 189,
256PI constant in the Math class 100PIC X in COBOL 45PICTURE clause in COBOL 67platform independence of
Swing components 197–9
platformscompilers for multiple 10multitude available 10running across all 5running Java on multiple 11
pointer 57See also object pointer
polymorphism 37, 256populating
one-dimensional arrays155–7
two-dimensional arrays162–6
portability 256guaranteed by bytecodes
and JVM 11of Java 10–12sacrificed by producing
executable Java code 248PostChecksGUI.java program 235
GUI window displayed by 239validating input data and
calling recordACheck() 240post-decrement operator
(i– –) 253post-increment operator
(i++) 254post-test loops 130–257
coding in COBOL 137indicating in COBOL 132
pow() method of the Mathclass 99
pre-decrement operator (– –i) 253pre-increment operator (++i) 254pre-test loop 130–257primitive data types 68, 92–3,
257println() method 57
calling to write a data item 177
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 277
passing an array element to 166of System.out 74, 75
PrintStream object 177private accessibility 257
for attributes 45, 60for a method 46
problem domain (PD) classes 234,257
procedural statements,populatingtwo-dimensional arraysin COBOL 162
procedure division code,assigning values to anarray 156
processing function 234program code, locating this
book’s 17program components in
COBOL 234program documentation,
comments producing 49program functions, isolating 235program switch, defining in
COBOL 167programmers, reasons for
retraining in Java 15programming jobs on
nationwide job searchweb sites 15
programming languages,sought in technical jobofferings 15
programscompiling 10naming 50structure of Java 41–63
public accessibility 45, 46,257
public class 50pull-down menus 220–5pure object-oriented
language 9, 23, 257
Rrandom() method of the Math
class 99Rational Corporation 231Rational Unified Process
(RUP) 231readLine() method
calling 177inputting data from a URL 195
readObject() method 190real world objects 24recordACheck() class
method 240, 241recordACheck() custom
method 61, 87–9recordACheck() instance
method 243recordACheck() methods 236recording checks, sequence
diagram for 237redefines clause in COBOL 156reference variable 166, 257relational databases 181
See also Access relationaldatabase
relational expressions 125relationships
among classes 28connecting relational
database tables 181Remote Method Invocation
(RMI) 257restricted accessibility 46, 257ResultSet class 184
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
278 INDEX
ResultSet object 186return data type 46, 52return statement 52, 257right-alignment of
components within acontainer 220
RMI (Remote MethodInvocation) 257
round() method 99, 100,102
ROUNDED clause in COBOL 100,101
round(float) method 100rounding
in COBOL 101COBOL compared to Java 100in Java 102
roundOff() method 102, 146rows
in a relational database 181in a two-dimensional array 160
Rumbaugh, Jim 24runtime, validation at 39RUP (Rational Unified
Process) 231
Sscenarios, depicting a system 237scope 257
of variables 66, 71scope terminating statements,
not provided in Java 45SCRUM 232SDM (systems development
methodology) 231, 258SEARCH verb in COBOL 167searching arrays 167–71Select statement of SQL 182
semicolon (;)placing in a switch
statement 126terminating Java statements 45
sequence diagrams 232, 237, 257sequential file I-O 175–81sequential files
conceptual steps for properOO programming 181
defining in COBOL 175storing Java data in 176
SequentialFileDemo.javaprogram 177–81
Serializable interface 191service charges, computing 109,
118–21, 123–6servlet 6, 257set, beginning a mutator
method 52setJMenuBar method 220setLayout method 205, 214short data type 68, 78, 92simplicity of Java 8Simula simulation language 23single inheritance 30, 257single line comment 48single quotes, enclosing single
character data values 70single-level table in COBOL 151slash-asterisk (/*), beginning
a multiple line comment 48Smalltalk language 8, 23socket 195, 257Socket class in the java.net
package 195Socket object 195solid lines in a sequence
diagram 237
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 279
source object 257SOUTH region of the content
pane 215special characters 178SQL (Structured Query
Language) 182–4, 257SQL package. See java.sql
packageSQL Select statement 185SQL statement, exceptions
resulting from 187SQLException exception class 184sqrt() method of the Math
class 99Statement class of java.sql 184Statement object 185statements
executing more than one 113terminating with a
semicolon (;) 45static (class) methods 100static binding 39, 257static constants in the Math
class 100static keyword 72, 81, 258static method 168, 258static variables 71stream. See data streamsstring 45string arrays 157–60String class 258
methods provided by 73provided by Java 73
String class program 66String objects
comparing the contents oftwo 73
as complex data types 73
string objects, length of 75string value, converting back
to an integer 95String variable
containing the SQL Selectstatement 185
containing URL databaseidentification 185
StringBuffer class 76StringDemo.java program 74–6Structured Query Language.
See SQLsubclasses 29, 58,
258at Community National
Bank 31inheriting from
superclasses 29subprograms, compared to
Java methods 54subscripts 258
accessing atwo-dimensional table inCOBOL 161
in COBOL 153substring() method 74, 75subtract (–) arithmetic
operator 98SUBTRACT statement in
COBOL 98Sun Microsystems 4, 5superclass 29, 58, 65,
258Swing buttons 209Swing class names 199Swing classes, hierarchy of 199Swing components 197–9Swing package 197, 202
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
280 INDEX
SwingConstants.RIGHTparameter 219
Switch block, boundaries of 126switch statements 108, 121
compared to COBOLEVALUATE 123
computing service charges125–6
nested 125System.out class 75systems development
methodology (SDM) 231,258
TTable Look Up in COBOL 167tables
defining two-dimensionalin COBOL 160
in a relational database 181technical job offerings,
programming languagessought 15
technology architecture,decisions regarding 246
terminate() methodof Checking-
AccountDA.java 236of Checking-
AccountPD.java 236terminating condition, testing
in loops 130termination of loops, Java
compared to COBOL 137ternary association 35, 258text fields. See also fields
adding to a window 205–8clearing the text from 214
creating for passwords 205in a GUI 198preloading with text 208
text filereading data from 177writing in Java 176
text-based user interface,switching to a GUI 234
three-tier design 235–46, 248,258
three-tiered system 246throwing exceptions 84, 258tiers in technology
architecture 246title bar in a GUI 198toString() Integer class
method 95transient object 175, 258truncated double value 99truncation errors
avoiding for mixed datatypes 93
avoiding in Java 78truncation of data in COBOL 78try block, execution of 85try-catch structure 84–6
for println() 178for readLine() 178for writeObject() 192
TwoDimArrayDemo.javaprogram 163–6
two-dimensional arrays 160, 258declaring 160–2populating 162–6
two-tiered client-serversystems 246
type casting 93, 258See also casting
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
INDEX 281
UUI (user interface) classes 234UML (Unified Modeling
Language) 24, 231, 258modeling requirements
using 232physical distribution of
objects 246UML notation 24, 26
for a class 26showing aggregation 33
unary association 35, 258Unicode character set 68, 174, 258unified process 231updateAccount() method 236,
244URL (Uniform Resource
Locator) 185URL object 195URLConnection object 195USAGE clause in COBOL 68use cases 232user interface (UI) classes 234user requirements, modeling 232users, actions performed by 199
VVALUE clauses
assigning values tovariables in COBOL 70
establishing values for aCOBOL array 155
populatingtwo-dimensional arraysin COBOL 162
valueOf() Integer classmethod 95
variable definition statements 46
variables 42, 259assigning values to 47, 69beginning with lowercase 50changing data types 76declaring outside a loop 141defining in Java 68evaluating the contents of
123naming 49, 68scope of 66, 71
verbs, including in methodnames 50
virtual machine 10void data type 46
Wweb browsers
containing bytecodeinterpreters 11
loading and executingapplets 226
web page, placing an AppletHTML tag in 226
web-based Java applets 18WEST region of the content
pane 215while clause
at the end of a do-whileloop 137
placement in while and doloops 138
while loopscompared to do loops 138printing the numbers 1
through 5 133writing 147
while statement, writingpre-test loops 132
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information
282 INDEX
WhileLoopDemo.javaprogram 135–6
modifying to demonstratethe for statement 142
modifying to use the dostatement 138
WHOLE relationship 33WIDTH variable 201, 202window events 227windowClosing() method 227windows
adding buttons to 209–14adding labels to 203–5adding text fields to 205–8closing 202displaying 201in a GUI 198improving the layout of 214–20
WITH TEST AFTER(post-test) clause 131
WITH TEST BEFORE(pre-test) clause 131
WORKING-STORAGESECTION of a COBOLprogram 54
World Wide Web access 195wrapper classes 83, 93–8,
259WrapperDemo.java program 96–8writeObject() method 190
XXerox Palo Alto Research
Center (PARC) 23XML (Extensible Markup
Language) 13
ZZipCodeProcessor.java
program 169–71
www.cambridge.org© Cambridge University Press
Cambridge University Press0521546842 - COBOL Programmers Swing with JavaE. Reed Doke, Bill C. Hardgrave and Richard A. JohnsonIndexMore information