Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

X 3.1.3.1 General Rules



  1. X Method names that are defined for a class must be unique. (The set of
    X methods "defined for a class" includes the methods introduced by the
    X class definition and the methods inherited from parent classes.)
    
    

    X Note: Method names that differ only in case are not considered
    X unique. For example, naming one method "SAYHELLO" and another method
    X "sayHELLO" is invalid.
    
    
  2. X Method names are processed by the compiler as follows:
    
    
    • X Literal-format methods names are processed in a case-sensitive
      X manner. However, when processing method resolution as part of
      X INVOKE statements or method names that are specified as
      X user-defined words, the compiler ignores any difference in case.
      
      
    • X If necessary, the compiler translates method names to conform to
      X CORBA requirements:
      
      
      • X Hyphens are translated to zero
      • X If the first character of the name is a digit, it is converted
        X as follows:
        • X 1 through 9 are changed to A through I
        • X 0 is changed to J
          
          

  3. X If a method in class-name-1 overrides a method in class-name-2, these
    X two methods must satisfy the following conformance rules:
    
    
    • X The number of formal parameters on the Procedure Division USING
      X phrase must be the same for both methods.
      
      
    • X The presence or absence of the Procedure Division RETURNING phrase
      X must be consistent on the two methods.
      
      
    • X Corresponding parameters in the Procedure Division USING phrases
      X must satisfy the following:
      
      
      • X If a formal parameter is a COBOL elementary data item not
        X described with USAGE IS OBJECT REFERENCE, then the
        X corresponding parameter must have the same PICTURE, USAGE,
        X SIGN, SYNCHRONIZED, JUSTIFIED, and BLANK WHEN ZERO clauses.
        X Note that periods and commas can be interchanged if using the
        X DECIMAL POINT IS COMMA clause, and the PICTURE clause currency
        X symbols can differ.
        
        
      • X If a formal parameter is a COBOL elementary data item
        X described with USAGE IS OBJECT REFERENCE, then the
        X corresponding parameter must be defined with an identical
        X USAGE IS OBJECT REFERENCE clause.
        
        
      • X BY VALUE and BY REFERENCE specifications must be consistent.
        
        

    • X The identifiers specified on the Procedure Division RETURNING
      X phrases must satisfy the following:
      
      
      • X If one of the identifiers is a COBOL elementary data item not
        X described with USAGE IS OBJECT REFERENCE, then the
        X corresponding identifier must have the same PICTURE, USAGE,
        X SIGN, SYNCHRONIZED, JUSTIFIED, and BLANK WHEN ZERO clauses.
        X Note that periods and commas can be interchanged if using the
        X DECIMAL POINT IS COMMA clause, and the PICTURE clause currency
        X symbols can differ.
        
        
      • X If the class-name-2 Procedure Division RETURNING identifier is
        X a universal object reference, the class-name-1 Procedure
        X Division RETURNING identifier must be an object reference
        X (either a universal object reference or an object reference
        X typed to a specific class).
        
        

        X Universal object references are described with USAGE OBJECT
        X REFERENCE and typed object references are described with USAGE
        X OBJECT REFERENCE class-name.
        
        
      • X If the class-name-2 Procedure Division RETURNING identifier is
        X an object reference typed to a specific class, the
        X class-name-1 Procedure Division RETURNING identifier must be
        X an object reference typed to the same class or a derived
        X class.
        
        

    • X For the purpose of conformance checking, a fixed-length group data
      X item is considered to be equivalent to an elementary alphanumeric
      X data item of the same length.
      
      

      X A variable-length group conforms only to other variable-length
      X groups that have the same maximum length.


Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.