|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.vishia.java2C.Method
public class Method
Describes a method of a class.
All methods of a class are stored in the private attribute ClassData.methods,
filled using #addMethod(String sNameJava, String sCName, int modifier, LocalIdents.IdentInfos returnType, ClassData[] paramsType)
and there derivatives.
A Method of class can be find out calling ClassData#searchMethod(String, List, boolean)
with given name and given actual Parameters
| Field Summary | |
|---|---|
private boolean |
bUnambiguousness
Set true if more as one methode with the same name is stored. |
ClassData |
declaringClass
The class which declares the implementation of the method. . |
ClassData |
firstDeclaringClass
The class which declares the method primary. |
private short |
idxMtbl
If it is an overrideable method, its number in InheritanceInfo. |
private LocalIdents |
methodIdents
The idents which are seen in the methods focus. |
int |
mode
Some mode bits, ones of modeNoThCxt, modeStatic. |
static int |
modeCtor
Set if it is a ctor. |
static int |
modeCtorAnonymous
Set if it is a ctor of an anonymous class. |
static int |
modeCtorNonStatic
Set if it is a ctor of a non-static inner class. |
static int |
modeNoStacktrace
|
static int |
modeNoThCxt
Modifier bit, when set the method has ThCxt as last argument. |
static int |
modeOverrideable
Modifier bit, when set the method is overrideable (virtual). |
static int |
modeReturnNew
Modifier bit, when set the method returns a new created instance which isn't activated for garbabe collection. |
static int |
modeReturnNonPersistring
Modifier bit, when set, the method returns a StringJc-instance, which's String is replaced in the thread context or it isn't persistent in other way. |
static int |
modeReturnThis
Modifier bit, when set the method returns the same instance as the calling one. |
static int |
modeStatic
Modifier bit, when set the method is static. |
static int |
modeUnknownMethod
|
boolean |
need_thCxt
Set if _thCxt is need in method calls |
FieldData[] |
paramsType
All argument type of the method. |
Method |
primaryMethod
Reference to a primary method if the method overloads another method, else null. |
FieldData |
returnType
Return type of the method. |
java.lang.String |
sCName
Name of the method used in C, with suffixes. |
java.lang.String |
sImplementationName
Name of the implementation of the method, null if not exists (interface). |
java.lang.String |
sJavaName
Name of the method used in Java. |
java.lang.String |
sKeyName
Search name of method in Map ClassData.methods. |
(package private) java.lang.String |
sMethodFormalListDefiniton
The parameter definition after the method name. |
private java.lang.String |
sMethodShortDescription
The method head definition is set, if a method is parsed in first pass. |
java.lang.String |
sMethodTypeName
The first name of the method in an overridden-sequence. |
java.lang.String |
sNameUnambiguous
Name of the method in method tables, base name of the method. |
java.lang.String |
sPathToBase
If the method is declared in a base class or interface too, it is the path necessary to address the base class or interface started from ythis |
java.lang.String |
sPathToMtbl
If the method is declared in a base class or interface too, it is the path to the method table-part. |
(package private) java.lang.String |
sReturnTypeDefinition
|
| Constructor Summary | |
|---|---|
Method(ClassData declaringClass,
Method primaryMethodP,
java.lang.String sKeyName,
java.lang.String sNameJava,
java.lang.String sNameUnambiguous,
java.lang.String sImplementationName,
int modifier,
FieldData returnType,
FieldData[] params,
java.lang.String sPathToMtbl,
java.lang.String sPathToBase)
Initializes a method to store in ClassData. |
|
| Method Summary | |
|---|---|
(package private) int |
checkParameter(java.util.List<CCodeData> paramsTypeCheck)
Checks whether all parameters from an actual method call are matching |
java.lang.String |
gen_MethodForwardDeclaration()
Gets the definition of a method head for the C-code. |
java.lang.String |
gen_MethodHeadDefinition()
Gets the definition of a method (C-code), used in second pass. |
int |
getIdxMtbl()
Returns -1 if it is a final method, or 0..., the index in the InheritanceInfo. |
LocalIdents |
getMethodIdents()
|
boolean |
isAmbigous()
Returns true, if more as one method with the same java name and the same number of arguments exists. |
boolean |
isOverrideable()
Returns true if the method is able to override (dynamic linked) in an inheriting class. |
boolean |
isReturnNew()
Returns true if the method returns a new instance which isn't activated for garbage collection. |
boolean |
isReturnNonPersistring()
Returns true if the method returns a new instance which isn't activated for garbage collection. |
boolean |
isReturnThis()
Returns true if the method returns its own calling instance. |
boolean |
isStatic()
Returns true if the method is static. |
boolean |
isUnknownMethod()
Returns true if the method is auto-created while used, it is not defined. |
boolean |
noStacktrace()
Returns true if the method is able to override (dynamic linked) in an inheriting class. |
void |
putFieldIdent(FieldData field)
|
(package private) boolean |
sameParameterTypes(FieldData[] paramsTypeCheck)
Checks all parameter of the method with given parameter set. |
(package private) void |
setAmbiguousness()
Sets the method ambiguous. |
void |
setMethodHeadDefiniton(java.lang.String description,
java.lang.String retType,
java.lang.String def)
Sets the definiton of a method (C-code). |
void |
setMethodIdents(LocalIdents methodIdents)
|
(package private) void |
stop()
|
java.lang.String |
toString()
Helpfull for debugging in eclipse. |
java.lang.String |
writeStruct()
Writes the structure information of the method for file.stc. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.String sJavaName
public final java.lang.String sKeyName
ClassData.methods. It is the sJavaName plus #9
where 9 symbols the number of arguments.
public final java.lang.String sCName
public final java.lang.String sMethodTypeName
The first name of the method in an overridden-sequence. The method has the postfix
of the first declaring interfaces or class, see declaringClass.
This identifier is used to build the MT_NAME-identifier in the method table,
see ClassData.gen_MethodTableDefinitionContent().
null if the method doesn't override any other and the method won't be overridden.
public final java.lang.String sImplementationName
public final java.lang.String sNameUnambiguous
public final Method primaryMethod
public final java.lang.String sPathToMtbl
public final java.lang.String sPathToBase
ythis
public final FieldData[] paramsType
public final FieldData returnType
public final ClassData firstDeclaringClass
public ClassData declaringClass
private LocalIdents methodIdents
public final boolean need_thCxt
private java.lang.String sMethodShortDescription
java.lang.String sReturnTypeDefinition
java.lang.String sMethodFormalListDefiniton
public static final int modeCtor
public static final int modeCtorNonStatic
public static final int modeCtorAnonymous
public static final int modeNoThCxt
public static final int modeNoStacktrace
public static final int modeStatic
public static final int modeOverrideable
public static final int modeReturnThis
public static final int modeReturnNew
public static final int modeReturnNonPersistring
public static final int modeUnknownMethod
public final int mode
modeNoThCxt, modeStatic.
private boolean bUnambiguousness
private short idxMtbl
| Constructor Detail |
|---|
public Method(ClassData declaringClass,
Method primaryMethodP,
java.lang.String sKeyName,
java.lang.String sNameJava,
java.lang.String sNameUnambiguous,
java.lang.String sImplementationName,
int modifier,
FieldData returnType,
FieldData[] params,
java.lang.String sPathToMtbl,
java.lang.String sPathToBase)
declaringClass - The class which declares this method.primaryMethodP - null or the method of the super-class or interface.
If the method is not an implementation of a super- or interface-declared method,
it is nullsKeyName - Name to searchsNameJava - Name of the method in JavasNameUnambiguous - Name of the method to translate in C. If more than 1 method
with the same sNameJava is given, the sCName should be unambiguous.
But it is without suffix of className.sImplementationName - null if the implementation is not override-able.
If the method is override-able and this param is null, than the suffix for the
implementationName is "_F". Elsewhere it defines the sImplementationName-attribute of the class.modifier - see mode
returnType - The type of return. It isn't a Classdata, but a IdentInfo,
because some additional properties like return by value or reference should be present.params - Array of all argument types.sPathToMtbl - sPathToBase - | Method Detail |
|---|
public void setMethodHeadDefiniton(java.lang.String description,
java.lang.String retType,
java.lang.String def)
public java.lang.String gen_MethodForwardDeclaration()
public java.lang.String gen_MethodHeadDefinition()
public void putFieldIdent(FieldData field)
void setAmbiguousness()
int checkParameter(java.util.List<CCodeData> paramsTypeCheck)
paramsTypeCheck -
ClassData.CastInfo.kCastAble.boolean sameParameterTypes(FieldData[] paramsTypeCheck)
paramsTypeCheck -
public boolean isAmbigous()
public boolean noStacktrace()
public boolean isOverrideable()
public boolean isReturnThis()
public boolean isReturnNew()
public boolean isReturnNonPersistring()
public boolean isStatic()
public boolean isUnknownMethod()
public java.lang.String writeStruct()
public int getIdxMtbl()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public final LocalIdents getMethodIdents()
public final void setMethodIdents(LocalIdents methodIdents)
void stop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||