Fujitsu J Adapter Class Generator User Manual page 24

Fujitsu user's guide j adapter class generator
Table of Contents

Advertisement

24
Chapter 3. Developing Programs
An example of generating a Date class object is shown below:
...
REPOSITORY.
CLASS J-Date AS "java-util-Date"
...
WORKING-STORAGE SECTION
01
anDate OBJECT REFERENCE J-Date.
...
PROCEDURE DIVISION.
...
INVOKE J-Date "Create-Date-01" RETURNING anDate.
...
Note:
Since the adapter class name is very long, it is recommended that an alias be
assigned by specifying AS in the REPOSITORY paragraph.
Invoking a Method
Invoke an instance method by invoking the corresponding adapter class object
method. The method name is the same as that of Java. However, if more than one
method is defined with the same name, append a numeric suffix to distinguish them
Class method"
(see "
An example of invoking the getTime method of the Date class is shown below:
...
REPOSITORY.
CLASS J-Date AS "java-util-Date"
...
WORKING-STORAGE SECTION
01
anDate OBJECT REFERENCE J-Date.
01
currentTime PIC S9(9) COMP-5.
...
PROCEDURE DIVISION.
...
INVOKE anDate "getTime" RETURNING currentTime.
...
Manipulating a Variable
Manipulate a variable through the corresponding adapter class property. The
property name is a Java field name with the prefix "
field is defined with the same name, append a numeric suffix to distinguish them
Class variable
(see "
"Instance method
and
").
Instance variable
" and "
").
JF-
". However, if more than one

Advertisement

Table of Contents
loading

Table of Contents