|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.llnl.babel.symbols.Method
The Method
class defines a sidl method, including modifiers,
return type, name, arguments, and exceptions. Methods may have one of
three definition modifiers: final, static, or abstract. They may also
have one of two communication modifiers: local or oneway. The return type
is either a type or null (which indicates void). The method name is a
simple identifier string. The optional arguments are an ordered collection
or arguments. The method may throw any number of exceptions.
Field Summary | |
static int |
ABSTRACT
|
static int |
FINAL
|
static int |
LOCAL
|
static int |
NORMAL
|
static int |
ONEWAY
|
static java.lang.String[] |
s_comm_mod
|
static java.lang.String[] |
s_def_mod
|
static int |
STATIC
|
Constructor Summary | |
Method()
Create an empty Method object that will be built by
calls to other member functions. |
Method Summary | |
void |
addArgument(Argument arg)
Add another argument to the end of the list of method arguments. |
void |
addThrows(SymbolID id)
Add a symbol identifier to the list of supported exceptions for this method. |
Method |
cloneMethod()
Return a shallow copy of this method object. |
java.util.ArrayList |
getArgumentList()
Return the array of arguments in an ArrayList container. |
java.util.Set |
getBasicArrays()
Return the set of basic array references SymbolID s. |
Comment |
getComment()
Get the comment for the method. |
int |
getCommunicationModifier()
Get the communication modifier for this method. |
java.lang.String |
getCommunicationModifierString()
Return the communication modifier string for this method. |
int |
getDefinitionModifier()
Return the definition modifier for the method. |
java.lang.String |
getDefinitionModifier(boolean is_interface)
Return the explicit definition modifier string for the method based on the type of extendable in which it belongs. |
java.lang.String |
getLongMethodName()
Return the long name of the method (a standard sidl identifier). |
java.lang.String |
getNameExtension()
Return the name extension of the method (a standard sidl identifier). |
Type |
getReturnType()
Get the return type for the method. |
java.lang.String |
getReturnType(java.lang.String parent_pkg)
Return the string corresponding to the return type for this method. |
java.lang.String |
getShortMethodName()
Return the short name of the method (a standard sidl identifier). |
java.lang.String |
getSignature()
Return the signature of the method. |
java.lang.String |
getSignature(boolean is_interface,
java.lang.String parent_pkg)
Return the signature of the method, including the definition modifier based on the extendable type. |
java.lang.String |
getSignaturePreface(boolean is_interface,
java.lang.String parent_pkg)
Return the concatenation of the explicit definition modifier, copy, return type, name and extension. |
java.util.Set |
getSymbolReferences()
Return the set of symbols referred to by this method. |
java.util.Set |
getThrows()
Retrieve the set of exceptions that may be thrown by this method. |
boolean |
hasArrayOrderSpec()
Return true if and only if at least one argument of
this method is an array with an ordering specification. |
boolean |
isAbstract()
Return whether the method is abstract. |
boolean |
isFinal()
Return whether the methos is final. |
boolean |
isReturnCopy()
Get the copy mode for the return type. |
boolean |
isStatic()
Return whether the method is static. |
boolean |
sameBaseSignature(Method m)
Compare the base signatures of the two methods. |
boolean |
sameSignature(Method m)
Compare the signatures of two methods. |
void |
setComment(Comment comment)
Set the comment for the method. |
void |
setCommunicationModifier(int modifier)
Set the communication modifier for the method. |
void |
setDefinitionModifier(int modifier)
Set the definition modifier for the method. |
void |
setMethodName(java.lang.String shortName)
Set the names of the method (a standard sidl identifier). |
void |
setMethodName(java.lang.String shortName,
java.lang.String extension)
Set the names of the method (a standard sidl identifier). |
void |
setReturnCopy(boolean copy)
Set the copy mode for the return type. |
void |
setReturnType(Type type)
Set the return type for the method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NORMAL
public static final int ABSTRACT
public static final int FINAL
public static final int STATIC
public static final int LOCAL
public static final int ONEWAY
public static final java.lang.String[] s_def_mod
public static final java.lang.String[] s_comm_mod
Constructor Detail |
public Method()
Method
object that will be built by
calls to other member functions.
Method Detail |
public Method cloneMethod()
public void addArgument(Argument arg)
public java.util.ArrayList getArgumentList()
ArrayList
container.
public void setComment(Comment comment)
public Comment getComment()
public void setCommunicationModifier(int modifier)
public int getCommunicationModifier()
public java.lang.String getCommunicationModifierString()
public void setDefinitionModifier(int modifier)
public int getDefinitionModifier()
public java.lang.String getDefinitionModifier(boolean is_interface)
is_interface
- the boolean indication of the type of
extendable to which the method belongs.
public boolean isAbstract()
public boolean isFinal()
public boolean isStatic()
public boolean hasArrayOrderSpec()
true
if and only if at least one argument of
this method is an array with an ordering specification. Calling
this on methods without array arguments will return false
.
Calling this method on something like void doIt(in array<int,
2, row-major> x);
will return true
.
public void setMethodName(java.lang.String shortName, java.lang.String extension)
public void setMethodName(java.lang.String shortName)
public java.lang.String getShortMethodName()
public java.lang.String getNameExtension()
public java.lang.String getLongMethodName()
public void setReturnCopy(boolean copy)
public boolean isReturnCopy()
public void setReturnType(Type type)
Type
object with value
Type.VOID
, not a null reference.
public Type getReturnType()
Type
object with a value of
Type.VOID
.
public void addThrows(SymbolID id)
public java.util.Set getThrows()
Set
object that contains
the SymbolID
symbol identifiers for the exception types.
public java.util.Set getSymbolReferences()
SymbolID
.
public java.util.Set getBasicArrays()
SymbolID
s.
This set includes arrays of the fundamental types such as double,
int, etc. as SymbolID
objects.
public java.lang.String getReturnType(java.lang.String parent_pkg)
parent_pkg
- the string containing the parent package. When not
null, it is used to strip the package from the return
string if it is in the specified package.
public java.lang.String getSignaturePreface(boolean is_interface, java.lang.String parent_pkg)
is_interface
- True if interface and want the implicit definition
modifier excluded from the result; otherwise, falseparent_pkg
- the string containing the parent package. When not
null, it is used to strip the package from the return
string if it is in the specified package.
public java.lang.String getSignature(boolean is_interface, java.lang.String parent_pkg)
is_interface
- True if interface and want the implicit definition
modifier excluded from the result; otherwise, falseparent_pkg
- the string containing the parent package. When not
null, it is used to strip the package from the return
string if it is in the specified package.
public java.lang.String getSignature()
public boolean sameSignature(Method m)
public boolean sameBaseSignature(Method m)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |