Package jminusminus
Class MethodContext
java.lang.Object
jminusminus.Context
jminusminus.LocalContext
jminusminus.MethodContext
A method context is where formal parameters are declared. Also, it's where we start computing
 the offsets for local variables (formal parameters included), which are allocated in the
 current stack frame (for a method invocation).
- 
Field SummaryFields inherited from class jminusminus.LocalContextoffsetFields inherited from class jminusminus.ContextclassContext, compilationUnitContext, entries, surroundingContext
- 
Constructor SummaryConstructorsConstructorDescriptionMethodContext(Context surrounding, boolean isStatic, Type methodReturnType) Constructs a method context.
- 
Method SummaryModifier and TypeMethodDescriptionvoidRecords fact that (non-void) method has at least one return.booleanisStatic()Returns true if this is a static method, and false otherwise.booleanReturns true if this (non-void) method has at least one return, and false otherwise.Returns the return type of this method.voidtoJSON(JSONElement json) Adds information pertaining to this context to the given JSON element.Methods inherited from class jminusminus.LocalContextnextOffset, offsetMethods inherited from class jminusminus.ContextaddEntry, addType, classContext, compilationUnitContext, definingType, lookup, lookupType, methodContext, names, surroundingContext
- 
Constructor Details- 
MethodContextConstructs a method context.- Parameters:
- surrounding- the surrounding (class) context.
- isStatic- is this method static?
- methodReturnType- return type of this method.
 
 
- 
- 
Method Details- 
isStaticpublic boolean isStatic()Returns true if this is a static method, and false otherwise.- Returns:
- true if this is a static method, and false otherwise.
 
- 
confirmMethodHasReturnpublic void confirmMethodHasReturn()Records fact that (non-void) method has at least one return.
- 
methodHasReturnpublic boolean methodHasReturn()Returns true if this (non-void) method has at least one return, and false otherwise.- Returns:
- true if this (non-void) method has at least one return, and false otherwise.
 
- 
methodReturnTypeReturns the return type of this method.- Returns:
- the return type of this method.
 
- 
toJSONAdds information pertaining to this context to the given JSON element.- Overrides:
- toJSONin class- LocalContext
- Parameters:
- json- JSON element.
 
 
-