|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.dms.util.Utils
at.dms.kjc.CMember
at.dms.kjc.CMethod
public abstract class CMethod
This class represents a class method.
| Field Summary |
|---|
| Fields inherited from class at.dms.kjc.CMember |
|---|
owner |
| Fields inherited from class at.dms.util.Utils |
|---|
EMPTY_LIST, getForLoopCallers |
| Fields inherited from interface at.dms.kjc.Constants |
|---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
| Constructor Summary | |
|---|---|
protected |
CMethod()
|
|
CMethod(CClass owner,
int modifiers,
String ident,
CType returnType,
CType[] parameters,
CClassType[] exceptions,
boolean deprecated)
Constructs a method member. |
| Method Summary | |
|---|---|
void |
checkOverriding(CMethod superMethod)
Checks that overriding/hiding is correct. |
Object |
deepClone()
Returns a deep clone of this object. |
protected void |
deepCloneInto(CMethod other)
Clones all fields of this into |
boolean |
equals(CMethod other)
equals search if two methods have same signature |
void |
genCode(CodeSequence code,
boolean nonVirtual)
Generates a sequence of bytecode |
CMethod |
getMethod()
|
CType[] |
getParameters()
|
CType |
getReturnType()
|
String |
getSignature()
|
CClassType[] |
getThrowables()
|
boolean |
hasSameSignature(CMethod other)
Has this method the same signature as the one given as argument ? NOTE: return type not considered |
boolean |
isAbstract()
Returns true iff this method is abstract. |
boolean |
isApplicableTo(String ident,
CType[] actuals)
Is this method applicable to the specified invocation (JLS 15.12.2.1) ? |
boolean |
isConstructor()
Returns true iff this method is a constructor. |
boolean |
isMoreSpecificThan(CMethod other)
Is this method more specific than the one given as argument (JLS 15.12.2.2) ? |
boolean |
isNative()
Returns true iff this method is native. |
void |
setReturnType(CType type)
|
void |
setThrowables(Hashtable<Serializable,CThrowableInfo> throwables)
This method is used by initializers that knows throwables exceptions only after body was checked. |
String |
toString()
Returns a string representation of this method. |
| Methods inherited from class at.dms.kjc.CMember |
|---|
deepCloneInto, getCClass, getField, getIdent, getJavaName, getModifiers, getOwner, getPrefixName, getQualifiedName, isAccessible, isDeprecated, isFinal, isPrivate, isProtected, isPublic, isStatic, setModifiers |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected CMethod()
public CMethod(CClass owner,
int modifiers,
String ident,
CType returnType,
CType[] parameters,
CClassType[] exceptions,
boolean deprecated)
owner - the owner of this methodmodifiers - the modifiers on this methodident - the ident of this methodreturnType - the return type of this methodparameters - the parameters type of this methodexceptions - a list of all exceptions of the throws listdeprecated - is this method deprecated| Method Detail |
|---|
public CMethod getMethod()
getMethod in class CMemberpublic final CType getReturnType()
public final void setReturnType(CType type)
type - to replace current return type.public final CType[] getParameters()
public String getSignature()
public CClassType[] getThrowables()
public void setThrowables(Hashtable<Serializable,CThrowableInfo> throwables)
throwables - the exceptions that can be thrown by this methodpublic boolean isNative()
public boolean isAbstract()
public boolean isConstructor()
public boolean equals(CMethod other)
other - the other method
public boolean isApplicableTo(String ident,
CType[] actuals)
ident - method invocation nameactuals - method invocation argumentspublic boolean isMoreSpecificThan(CMethod other)
other - the method to compare topublic boolean hasSameSignature(CMethod other)
other - the method to compare to
public void checkOverriding(CMethod superMethod)
throws UnpositionedError
superMethod - method which it overrides
UnositionedError - the analysis detected an error
UnpositionedErrorpublic String toString()
toString in class Object
public void genCode(CodeSequence code,
boolean nonVirtual)
code - the code sequencenonVirtual - force non-virtual dispatchingpublic Object deepClone()
deepClone in interface DeepCloneabledeepClone in class CMemberprotected void deepCloneInto(CMethod other)
other
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||