scale.clef.decl
Enum ParameterMode

java.lang.Object
  extended by java.lang.Enum<ParameterMode>
      extended by scale.clef.decl.ParameterMode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ParameterMode>

public enum ParameterMode
extends java.lang.Enum<ParameterMode>

This enum specifies the parameter passing mode - by value, by areference, etc.

$Id$

Copyright 2008 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.


Enum Constant Summary
IN_VALUE
          The formal parameter is the actual value.
READ_ONLY
          The formal parameter is an alias for the argument.
REFERENCE
          The formal parameter is an alias for the argument.
VALUE
          The formal parameter is the actual value.
VALUE_RESULT
          The formal parameter is an alias for the argument.
 
Method Summary
 java.lang.String toString()
           
static ParameterMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ParameterMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

VALUE

public static final ParameterMode VALUE
The formal parameter is the actual value. This represents pass-by-value but the formal's value may be altered. This mode is the default for Modula-3 and the only one for C/C++.


REFERENCE

public static final ParameterMode REFERENCE
The formal parameter is an alias for the argument. This represents pass-by-reference where the address of the value is passed as the argument. Therefore, an update to the formal parameter is a direct update the argument (actual parameter) as well. This mode is the only parameter mode for Fortran and represents the var mode for Modula-3.


IN_VALUE

public static final ParameterMode IN_VALUE
The formal parameter is the actual value. This represents pass-by-value but the formal's value may NOT be altered. This mode is used for Ada.


VALUE_RESULT

public static final ParameterMode VALUE_RESULT
The formal parameter is an alias for the argument. This represents pass-by-reference where the address of the value is passed as the argument and represents copy-in and copy-out semantics. This mode is used for Ada's inout mode.


READ_ONLY

public static final ParameterMode READ_ONLY
The formal parameter is an alias for the argument. This represents pass-by-reference where the address of the value is passed as the argument but the value cannot be updated. This mode supports Modula-3's readonly mode, and is efficient for large data structures.

Method Detail

values

public static ParameterMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ParameterMode c : ParameterMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ParameterMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<ParameterMode>