Java-Lang-String Class - Fujitsu J Adapter Class Generator User Manual

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

Advertisement

Generation example
The object method corresponding to instance method getTime() of the java.util.Date
class is generated as shown below:
METHOD-ID. JM-GETTIME AS "getTime".
...
LINKAGE SECTION.
01
RTN-VALUE
PROCEDURE DIVISION RETURNING RTN-VALUE.
...
END METHOD JM-GETTIME.
1. Since there is only one method with name "getTime," a method with name
"getTime" is generated with no number assigned.
Supplement
When a COBOL method name is generated from a Java method name, a number is
assigned to secure the uniqueness of the name. The class browser or method name
cross-reference list file can be used to check the correspondence between Java
methods and COBOL methods. In the case of class browser, it can be identified
from the parameter that appears during method selection. In the case of method
name cross-reference list file, it can be identified from the type of argument of the
constructor.

java-lang-String class

Like other classes, the java.lang.String class is mapped to the java-lang-String class.
However, the java-lang-String class has the following methods for referencing or
setting character string data, in addition to the methods defined in the
java.lang.String class:
Method name
NEW-STRING-X
NEW-STRING-N
GET-STRING-X
GET-STRING-N
GET-STRING-LENGTH-X
GET-STRING-LENGTH-N
NEW-STRING-X method (factory method)
Explanation
This method generates a String object having the character string specified for the
alphanumeric data item as an initial value.
Syntax
class-name
INVOKE
PIC S9(18) COMP-5.
Type
Function
Factory
Generates a String object having the specified
alphanumeric data item as the initial value.
Factory
Generates a String object having the specified
national data item as the initial value.
Object
Fetches the character string as an alphanumeric data
item.
Object
Fetches the character string as a national data item.
Object
Determines alphanumeric data item length.
Object
Determines national data item length.
"NEW-STRING-X" USING
Chapter 5. Adapter Class Reference
initialValue
createdObject
RETURNING
61
[1]

Advertisement

Table of Contents
loading

Table of Contents