Class FormalParameter
java.lang.Object
org.checkerframework.dataflow.expression.JavaExpression
org.checkerframework.dataflow.expression.FormalParameter
A formal parameter, represented by its 1-based index.
 
LocalVariable represents a formal parameter expressed using its name.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final VariableElementThe element for this formal parameter.protected final intThe 1-based index.Fields inherited from class org.checkerframework.dataflow.expression.JavaExpressiontype
- 
Constructor SummaryConstructorsConstructorDescriptionFormalParameter(int index, VariableElement element) Creates a FormalParameter.
- 
Method SummaryModifier and TypeMethodDescription<R,P> R accept(JavaExpressionVisitor<R, P> visitor, P p) Accept method of the visitor pattern.booleancontainsOfClass(Class<? extends JavaExpression> clazz) booleanReturns true if and only if this contains a JavaExpression that is syntactically equal toother.booleanReturns the element for this variable.intgetIndex()Returns the 1-based index of this formal parameter.inthashCode()booleanisDeterministic(AnnotationProvider provider) Returns true if the expression is deterministic.booleanReturns true if and only if the value this expression stands for cannot be changed (with respect to ==) by a method call.booleanReturns true if and only if the value this expression stands for cannot be changed by a method call, including changes to any of its fields.booleanReturns true if and only if the two Java expressions are syntactically identical.toString()Format this verbosely, for debugging.Methods inherited from class org.checkerframework.dataflow.expression.JavaExpressionatConstructorInvocation, atFieldAccess, atMethodBody, atMethodInvocation, atMethodInvocation, containsModifiableAliasOf, containsUnknown, fromArrayAccess, fromNode, fromNodeFieldAccess, fromTree, fromVariableTree, getFormalParameters, getImplicitReceiver, getParametersAsLocalVariables, getPseudoReceiver, getReceiver, getType, listContainsSyntacticEqualJavaExpression, listIsDeterministic, syntacticEqualsList
- 
Field Details- 
indexprotected final int indexThe 1-based index.
- 
elementThe element for this formal parameter.
 
- 
- 
Constructor Details- 
FormalParameterCreates a FormalParameter.- Parameters:
- index- the 1-based index
- element- the element for the formal parameter
 
 
- 
- 
Method Details- 
equals
- 
getIndexpublic int getIndex()Returns the 1-based index of this formal parameter.- Returns:
- the 1-based index of this formal parameter
 
- 
getElementReturns the element for this variable.- Returns:
- the element for this variable
 
- 
hashCodepublic int hashCode()
- 
toString
- 
toStringDebugDescription copied from class:JavaExpressionFormat this verbosely, for debugging.- Overrides:
- toStringDebugin class- JavaExpression
- Returns:
- a verbose string representation of this
 
- 
containsOfClass- Specified by:
- containsOfClassin class- JavaExpression
 
- 
syntacticEqualsDescription copied from class:JavaExpressionReturns true if and only if the two Java expressions are syntactically identical.This exists for use by JavaExpression.containsSyntacticEqualJavaExpression(org.checkerframework.dataflow.expression.JavaExpression).- Specified by:
- syntacticEqualsin class- JavaExpression
- Parameters:
- je- the other Java expression to compare to this one
- Returns:
- true if and only if the two Java expressions are syntactically identical
 
- 
containsSyntacticEqualJavaExpressionDescription copied from class:JavaExpressionReturns true if and only if this contains a JavaExpression that is syntactically equal toother.- Specified by:
- containsSyntacticEqualJavaExpressionin class- JavaExpression
- Parameters:
- other- the JavaExpression to search for
- Returns:
- true if and only if this contains a JavaExpression that is syntactically equal to
     other
 
- 
isUnassignableByOtherCodepublic boolean isUnassignableByOtherCode()Description copied from class:JavaExpressionReturns true if and only if the value this expression stands for cannot be changed (with respect to ==) by a method call. This is the case for local variables, the self reference, final field accesses whose receiver isJavaExpression.isUnassignableByOtherCode(), and operations whose operands are allJavaExpression.isUnmodifiableByOtherCode().- Specified by:
- isUnassignableByOtherCodein class- JavaExpression
- See Also:
 
- 
isUnmodifiableByOtherCodepublic boolean isUnmodifiableByOtherCode()Description copied from class:JavaExpressionReturns true if and only if the value this expression stands for cannot be changed by a method call, including changes to any of its fields.Approximately, this returns true if the expression is JavaExpression.isUnassignableByOtherCode()and its type is immutable.- Specified by:
- isUnmodifiableByOtherCodein class- JavaExpression
- See Also:
 
- 
isDeterministicDescription copied from class:JavaExpressionReturns true if the expression is deterministic.- Specified by:
- isDeterministicin class- JavaExpression
- Parameters:
- provider- an annotation provider (a type factory)
- Returns:
- true if this expression is deterministic
 
- 
acceptDescription copied from class:JavaExpressionAccept method of the visitor pattern.- Specified by:
- acceptin class- JavaExpression
- Type Parameters:
- R- result type of the operation
- P- parameter type
- Parameters:
- visitor- the visitor to be applied to this JavaExpression
- p- the parameter for this operation
- Returns:
- the result of visiting this
 
 
-