net.sourceforge.pmd.symboltable
public class NameOccurrence extends Object
| Constructor Summary | |
|---|---|
| NameOccurrence(SimpleNode location, String image) | |
| Method Summary | |
|---|---|
| int | getArgumentCount() |
| String | getImage() |
| SimpleNode | getLocation() |
| NameOccurrence | getNameForWhichThisIsAQualifier() |
| boolean | isMethodOrConstructorInvocation() |
| boolean | isOnLeftHandSide() A handy method to assert if the name is on the right hand side or the left hand side of an expression. |
| boolean | isOnRightHandSide() |
| boolean | isPartOfQualifiedName() |
| boolean | isSelfAssignment()
Assert it the occurrence is a self assignment such as:
i += 3;
|
| boolean | isThisOrSuper()
Simply return true is the image is equal to keyword 'this' or 'super'.
|
| void | setArgumentCount(int count) |
| void | setIsMethodOrConstructorInvocation() |
| void | setNameWhichThisQualifies(NameOccurrence qualifiedName) |
| boolean | useThisOrSuper()
Simply return if the image start with keyword 'this' or 'super'.
|
A handy method to assert if the name is on the right hand side or the left hand side of
an expression. One basic example:
obj.getMethod(); // Name "getMethod()" returns false, "obj" returns true
Returns:
i += 3;
Returns: true, if the occurrence is self-assignment, false, otherwise.
Returns: return true if image equal to 'this' or 'super'.
Returns: true, if keyword is used, false otherwise.