Set-array-element method (object method), Explanation, Syntax – FUJITSU J Adapter Class Generator User Manual

Page 69: Parameter and return value, Numbering names, Effective range of name

Advertising
background image

Chapter 5. Adapter Class Reference 69

SET-ARRAY-ELEMENT method (object method)

Explanation
This method sets an element of an array object.
Syntax
INVOKE

anObject

"SET-ARRAY-ELEMENT" USING

inx elemValue

Parameter and return value
• anObject

Specifies the array object in which an element is to be set.

• inx (attribute: PIC S9(9) COMP-5)

Specifies the subscript of the element to be set. The subscript begins from 0.

• elemValue (attribute: Array element type)

Specifies the value to be set in the array element.

Numbering Names

The J adapter class generator generates adapter class names from the names used

for Java classes or interfaces. However, some names cannot be used in both Java

and COBOL because different syntax rules are used. For instance, Java permits

multiple methods with the same name to be defined within the same class if they

have different parameters, while COBOL does not permit such definition. In this

case, methods with the same name in Java must be generated so that they

correspond to different names in COBOL. The J adapter class generator generates a

unique name from each corresponding Java name by adding a hyphen "-" followed

by a number.
This section explains the rules of assigning numbers to names used for adapter

classes.

Effective range of name

The names handled by the J adapter class generator are classified into the following

three types depending on the effective range of a name:
• Name that is always unique according to generation rules

-

Class name

-

Array class name

• Name that needs to be unique between super classes/subclasses

-

Factory method name corresponding to constructor

• Name that needs to be unique within an entire run unit

-

Method name (class/instance)

-

Field (variable) name (class/instance)

Advertising