gov.llnl.babel.symbols
Class Argument

java.lang.Object
  |
  +--gov.llnl.babel.symbols.Argument

public class Argument
extends java.lang.Object

The Argument class defines a SIDL argument, which consists of a parameter passing mode (IN, INOUT, or OUT with an optional COPY), a type, and a formal parameter name.


Field Summary
static int IN
           
static int INOUT
           
static int OUT
           
 
Constructor Summary
Argument(boolean copy, int mode, Type type, java.lang.String name)
          Create an argument object.
 
Method Summary
 boolean equals(java.lang.Object object)
          Compare two argument objects and return true if they are the same.
 java.lang.String getArgumentString()
          Return a string representation of the argument for outputting the arguments in a method signature, for example.
 java.lang.String getArgumentString(java.lang.String abbrev_pkg)
          Return a string representation of the argument for outputting the arguments in a method signature, for example.
 java.lang.String getFormalName()
          Return the formal name of the parameter identifier.
 int getMode()
          Get the argument parameter passing mode (one of IN, INOUT, or OUT).
 Type getType()
          Return the type of the argument.
 boolean hasArrayOrderSpec()
          Return true if and only if the type of this argument is an array with an with an ordering specification.
 boolean isCopy()
          Return whether the copy flag has been set for this method argument.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IN

public static final int IN
See Also:
Constant Field Values

INOUT

public static final int INOUT
See Also:
Constant Field Values

OUT

public static final int OUT
See Also:
Constant Field Values
Constructor Detail

Argument

public Argument(boolean copy,
                int mode,
                Type type,
                java.lang.String name)
Create an argument object. An argument consist of a copy flag, a parameter passing mode (IN, OUT, INOUT), a type, and a formal parameter name.

Method Detail

isCopy

public boolean isCopy()
Return whether the copy flag has been set for this method argument.


getMode

public int getMode()
Get the argument parameter passing mode (one of IN, INOUT, or OUT).


getFormalName

public java.lang.String getFormalName()
Return the formal name of the parameter identifier.


getType

public Type getType()
Return the type of the argument.


hasArrayOrderSpec

public boolean hasArrayOrderSpec()
Return true if and only if the type of this argument is an array with an with an ordering specification. For example, in array<int, 2, column-major> x would return true. out array<int, 2> x would return false because it does not have an ordering specification. Non-array arguments return false.


getArgumentString

public java.lang.String getArgumentString(java.lang.String abbrev_pkg)
Return a string representation of the argument for outputting the arguments in a method signature, for example. Optionally abbreviate the type if it is declared in the specified package.


getArgumentString

public java.lang.String getArgumentString()
Return a string representation of the argument for outputting the arguments in a method signature, for example.


equals

public boolean equals(java.lang.Object object)
Compare two argument objects and return true if they are the same. Note that the formal name does not need to match for equality.

Overrides:
equals in class java.lang.Object