Method Interface Definition

A method interface definition defines the parameters for the method, how they are passed, and any alternate syntax that can be used to invoke the method.

General Format:


where verb-signature is:


Syntax Rules

  1. A method interface definition must be nested within an external class.
  2. Procedure-division-header is a format 2 procedure-division-header as specified for a program, except that neither mnemonic-name nor the REPEATED phrase may be specified. The INVOKED phrase, shown in the format above, may optionally be included in the header just before the terminating period. (See the topic The PROCEDURE DIVISION Header for details.)
  3. When the FUNCTION phrase is specified in the verb-signature, the RETURNING phrase must be specified in the PROCEDURE DIVISION header.
  4. Verb-1 must be a COBOL word that is neither a reserved word nor a procedure-name.
  5. The words <OBJECT>, <SELF> and <THIS> are equivalent. One of them must be present once and only once in each verb-signature.
  6. Data-name-3 must be preceded by "<" and followed by ">".
  7. Compulsory-word must be a COBOL word.
  8. Noise-word must be a COBOL word and must be preceded by "[" and followed by "]".
  9. Open-parenthesis and close-parenthesis are "(" and ")" respectively.
    Note: Open-parenthesis and close-parenthesis enable you to define functions that look like intrinsic functions, with parameters enclosed in parentheses.
  10. A verb-signature must not be a subset of another verb-signature.

General Rules

  1. When method-name-1 is invoked using verb-signature, <SELF> is replaced with the object reference to the receiving object.
  2. Noise-words are for readability and are optional when the syntax is used to invoke a method.
  3. If verb-1 is also declared as a data-name in a program, then any reference to that word in that program is to the data-name.