|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectentities.Method
The Method class represents the information regarding a method.
Field Summary | |
static java.lang.String |
CONSTRUCTOR
Used to specify that the method is a constructor |
static java.lang.String |
DESTRUCTOR
Used to specify that the method is a destructor |
static java.lang.String |
IMPLEMENTED_INSIDE_CLASS
Used to specify that the method is implemented inside the class |
static java.lang.String |
IMPLEMENTED_OUTSIDE_CLASS
Used to specify that the method is not implemented outside the class |
static java.lang.String |
NORMAL
Used to specify that the method is a normal method (not a constructor and not a destructor) |
static java.lang.String |
NOT_IMPLEMENTED
Used to specify that the method is not implemented |
Constructor Summary | |
Method(ScopeManager parentScope,
java.lang.String className,
java.lang.String name,
java.lang.String declarationFile,
int declarationPosition,
java.lang.String type,
boolean constFlag,
boolean pureVirtual,
boolean staticFlag,
boolean virtualFlag,
boolean inlineFlag,
boolean returnedValueConst,
java.lang.String accessType,
java.lang.String returnedType,
java.util.Vector parameters)
Construct a new Method |
Method Summary | |
void |
addClass(ClassEntity cl)
Empty |
void |
addClassHeaderFile(java.lang.String className,
java.lang.String headerFileName)
Empty |
void |
addEnumerator(Enumerator en)
Add an Enumerator object to the method |
void |
addExpression(Expression expr,
ScopeManager wrapper)
Add a statement (of type Expression) to the body of the method |
void |
addExternalField(Variable variable)
Empty |
void |
addExternalMethod(Method method)
Empty |
void |
addField(Variable variable)
Empty |
void |
addFriendClass(Variable variable)
Empty |
void |
addFriendFunction(Function function)
Empty |
void |
addFriendMethod(Method method)
Empty |
void |
addFunction(Function function)
Empty |
void |
addGeneralization(SuperClass superClass)
Empty |
void |
addInitializer(Initializer initializer)
Add an Initializer object to the method |
void |
addMethod(Method method)
Empty |
void |
addNameSpace(NameSpace namespace)
Empty |
void |
addType(java.lang.String name,
java.lang.String type)
Empty |
void |
addUserType(java.lang.String name,
java.lang.String type)
Add a new type defined using typedef to the user types. |
void |
addVariable(Variable var)
Add a Variable to the local variable of the method |
boolean |
areExceptionUsed()
|
static void |
createTable(java.sql.Connection dbConnection)
|
static void |
delete(java.sql.Connection dbConnection,
int id)
|
ScopeManager |
findVariableType(java.lang.String nameToBeFound,
java.lang.StringBuffer typeToBeFound,
Expression expr)
Look for the variable declaration whose name is "nameToBeFound" and return the ScopeManager in which it is defined (if found), filling "typeToBeFound" with the variable type. |
java.lang.String |
getAccessType()
|
java.util.Vector |
getBody()
|
java.lang.String |
getClassName()
|
Method |
getCurrentMethod(java.lang.String methodName,
java.util.Vector parameters)
|
java.lang.String |
getDeclarationFile()
|
int |
getDeclarationPosition()
|
java.lang.String |
getDefinitionFile()
|
Parameter |
getDefinitionParameter(java.lang.String parameterName)
|
java.util.Vector |
getDefinitionParameters()
|
int |
getDefinitionPosition()
|
int |
getEndLine()
|
java.util.Vector |
getEnumerators()
|
java.lang.String |
getImplementation()
|
java.util.Vector |
getInitializers()
|
int |
getInitLine()
|
java.util.Vector |
getLocalVariables()
|
java.lang.String |
getName()
|
java.util.Vector |
getParameters()
|
java.lang.String |
getParameterTypesAsString()
|
ScopeManager |
getParent()
|
java.lang.String |
getReturnedType()
|
java.lang.String |
getSignature()
|
java.util.Vector |
getThrownExceptions()
|
java.util.Vector |
getThrownExceptionsinInDefinition()
|
java.lang.String |
getType()
|
java.util.Hashtable |
getTypeTable()
|
java.util.Hashtable |
getUserTypeTable()
|
void |
insert(java.sql.Connection dbConnection,
int sourceId,
int sourceType)
|
boolean |
isATemplate()
|
boolean |
isConst()
|
boolean |
isImplementedInsideClass()
|
boolean |
isImplementedOutsideClass()
|
boolean |
isInitialized()
|
boolean |
isInline()
|
boolean |
isPureVirtual()
|
boolean |
isStatic()
|
boolean |
isTheReducedSignatureEqual(java.lang.String name,
java.util.Vector parameters)
|
boolean |
isTheSignatureEqual(java.lang.String name,
java.lang.String returnedType,
java.util.Vector parameters,
java.lang.String type)
|
boolean |
isTheSignatureEqual1(java.lang.String name,
java.lang.String returnedType,
java.util.Vector parameters,
java.lang.String type)
|
boolean |
isVirtual()
|
void |
print(java.lang.String indentation)
Print all information |
boolean |
returnsAConstValue()
|
void |
setDefinitionFile(java.lang.String defFile)
|
void |
setDefinitionParameters(java.util.Vector parameters)
The parameter "parameters" represent the formal parameters of the method used when the method is defined |
void |
setDefinitionPosition(int defPosition)
|
void |
setEndLine(int end)
|
void |
setExceptionFlag(boolean exceptionFlag)
|
void |
setImplementation(java.lang.String implementationPosition)
|
void |
setInitializationFlag(boolean initializationFlag)
|
void |
setInitLine(int init)
|
void |
setInlineFlag(boolean inlineFlag)
|
void |
setTemplateFlag(boolean templateFlag)
|
void |
setThrownExceptions(java.util.Vector thrownExceptions)
set the Vector containing the names of exceptions thrown by the function |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CONSTRUCTOR
public static final java.lang.String DESTRUCTOR
public static final java.lang.String NORMAL
public static final java.lang.String NOT_IMPLEMENTED
public static final java.lang.String IMPLEMENTED_INSIDE_CLASS
public static final java.lang.String IMPLEMENTED_OUTSIDE_CLASS
Constructor Detail |
public Method(ScopeManager parentScope, java.lang.String className, java.lang.String name, java.lang.String declarationFile, int declarationPosition, java.lang.String type, boolean constFlag, boolean pureVirtual, boolean staticFlag, boolean virtualFlag, boolean inlineFlag, boolean returnedValueConst, java.lang.String accessType, java.lang.String returnedType, java.util.Vector parameters)
parentScope
- parent entity objectclassName
- Name of the classname
- Name of the methoddeclarationFile
- Name of the file in which the method is declareddeclarationPosition
- Position of the method in the file in which it is declaredtype
- The type of the method (CONSTRUCTOR, DESTRUCTOR, NORMAL)constFlag
- Flag that says if the method is constpureVirtual
- Flag that says if the method is pureVirtualstaticFlag
- Flag that says if the method is staticvirtualFlag
- Flag that says if the method is virtualinlineFlag
- Flag that says if the method has the inline keywordreturnedValueConst
- Flag that says if the returned value is constantaccessType
- Type of access of the methodreturnedType
- Type returned by the methodparameters
- Vectors of Parameter objects corresponding to the method parametersMethod Detail |
public java.lang.String getClassName()
public java.lang.String getName()
getName
in interface ScopeManager
public java.lang.String getDeclarationFile()
public int getDeclarationPosition()
public java.lang.String getDefinitionFile()
public int getDefinitionPosition()
public java.lang.String getType()
public java.lang.String getReturnedType()
public java.util.Vector getLocalVariables()
public java.lang.String getAccessType()
public java.util.Vector getParameters()
public java.util.Vector getDefinitionParameters()
public Parameter getDefinitionParameter(java.lang.String parameterName)
public java.lang.String getParameterTypesAsString()
public java.lang.String getSignature()
public java.util.Vector getEnumerators()
Enumerator
public java.lang.String getImplementation()
public int getInitLine()
public int getEndLine()
public java.util.Vector getBody()
public java.util.Hashtable getTypeTable()
public java.util.Hashtable getUserTypeTable()
public ScopeManager getParent()
getParent
in interface ScopeManager
public java.util.Vector getThrownExceptions()
Ex: class A {void h () throw (Range_Error)};In this case it returns a Vector containing an object (of type String) corresponding to the string "Range_Error".
public java.util.Vector getThrownExceptionsinInDefinition()
Ex: class A {void h ()}; A::h() throw (Range_Error) {..} ;In this case it returns a Vector containing an object (of type String) corresponding to the string "Range_Error".
public Method getCurrentMethod(java.lang.String methodName, java.util.Vector parameters)
getCurrentMethod
in interface ScopeManager
public java.util.Vector getInitializers()
Ex: class Manager : Employee { int level; public: Manager( const string& n, int d, int l); }; Manager::Manager(const string& n, int d, int l): Employee(n, d), level(l) { }In this case it returns a Vector containing two objects (of type Initializer) one corresponding to "Employee" and the second corresponding to "level".
public boolean isConst()
public boolean isStatic()
public boolean isInline()
public boolean isPureVirtual()
public boolean isVirtual()
public boolean isATemplate()
public boolean areExceptionUsed()
public boolean isInitialized()
public boolean returnsAConstValue()
public boolean isTheSignatureEqual1(java.lang.String name, java.lang.String returnedType, java.util.Vector parameters, java.lang.String type)
name
- String corresponding to a method namereturnedType
- String corresponding to the returned type of the methodparameters
- Vector containing the Parameter objects of the methodtype
- String corresponding to the method type
(CONSTRUCTOR, DESTRUCTOR, NORMAL)
public boolean isTheSignatureEqual(java.lang.String name, java.lang.String returnedType, java.util.Vector parameters, java.lang.String type)
name
- String corresponding to a method namereturnedType
- String corresponding to the returned type of the methodparameters
- Vector containing the Parameter objects of the methodtype
- String corresponding to the method type (CONSTRUCTOR, DESTRUCTOR, NORMAL)
public boolean isTheReducedSignatureEqual(java.lang.String name, java.util.Vector parameters)
name
- String corresponding to a method nameparameters
- Vector containing the Parameter objects of the method
public boolean isImplementedInsideClass()
public boolean isImplementedOutsideClass()
public void addEnumerator(Enumerator en)
addEnumerator
in interface ScopeManager
public void addInitializer(Initializer initializer)
public void setThrownExceptions(java.util.Vector thrownExceptions)
public void addNameSpace(NameSpace namespace)
addNameSpace
in interface ScopeManager
public void addExpression(Expression expr, ScopeManager wrapper)
addExpression
in interface ScopeManager
public void addClass(ClassEntity cl)
addClass
in interface ScopeManager
public void addFunction(Function function)
addFunction
in interface ScopeManager
public void addMethod(Method method)
addMethod
in interface ScopeManager
public void addVariable(Variable var)
addVariable
in interface ScopeManager
public void addField(Variable variable)
addField
in interface ScopeManager
public void addType(java.lang.String name, java.lang.String type)
addType
in interface ScopeManager
public void addUserType(java.lang.String name, java.lang.String type)
addUserType
in interface ScopeManager
public void addGeneralization(SuperClass superClass)
addGeneralization
in interface ScopeManager
public void addExternalMethod(Method method)
addExternalMethod
in interface ScopeManager
public void addExternalField(Variable variable)
addExternalField
in interface ScopeManager
public void addFriendFunction(Function function)
addFriendFunction
in interface ScopeManager
public void addFriendMethod(Method method)
addFriendMethod
in interface ScopeManager
public void addFriendClass(Variable variable)
addFriendClass
in interface ScopeManager
public void addClassHeaderFile(java.lang.String className, java.lang.String headerFileName)
addClassHeaderFile
in interface ScopeManager
public void setDefinitionParameters(java.util.Vector parameters)
public void setDefinitionFile(java.lang.String defFile)
defFile
- is name of the file in which the method is definedpublic void setDefinitionPosition(int defPosition)
defPosition
- represents the position (line) of the method name
in the filepublic void setImplementation(java.lang.String implementationPosition)
implementationPosition
- specifies if the the method is implemented,
if is implemented inside the class or if is implemented outside the
class (IMPLEMENTED_INSIDE_CLASS, IMPLEMENTED_INSIDE_CLASS,
NOT_IMPLEMENTED)public void setInitLine(int init)
init
- represents the line position of the first "{".public void setEndLine(int end)
end
- represents the line position of the last "}".public void setInlineFlag(boolean inlineFlag)
public void setTemplateFlag(boolean templateFlag)
templateFlag
- is true if the method is a template methodpublic void setExceptionFlag(boolean exceptionFlag)
exceptionFlag
- is true if the method throws an exceptionpublic void setInitializationFlag(boolean initializationFlag)
initializationFlag
- is true if the method is initializedpublic void print(java.lang.String indentation)
print
in interface ScopeManager
public ScopeManager findVariableType(java.lang.String nameToBeFound, java.lang.StringBuffer typeToBeFound, Expression expr)
findVariableType
in interface ScopeManager
public static void delete(java.sql.Connection dbConnection, int id) throws java.sql.SQLException
java.sql.SQLException
public static void createTable(java.sql.Connection dbConnection) throws java.sql.SQLException
java.sql.SQLException
public void insert(java.sql.Connection dbConnection, int sourceId, int sourceType) throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |