本文整理汇总了Java中org.eclipse.jdt.core.dom.PostfixExpression.getOperand方法的典型用法代码示例。如果您正苦于以下问题:Java PostfixExpression.getOperand方法的具体用法?Java PostfixExpression.getOperand怎么用?Java PostfixExpression.getOperand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.dom.PostfixExpression
的用法示例。
在下文中一共展示了PostfixExpression.getOperand方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.eclipse.jdt.core.dom.PostfixExpression; //导入方法依赖的package包/类
@Override
public boolean visit(PostfixExpression exp) {
if(exp.getOperand() instanceof SimpleName) {
String varName = exp.getOperand().toString();
VariableOperation op = null;
if(exp.getOperator() == PostfixExpression.Operator.INCREMENT)
op = new VariableOperation(varName, VariableOperation.Type.INC);
else if(exp.getOperator() == PostfixExpression.Operator.DECREMENT)
op = new VariableOperation(varName, VariableOperation.Type.DEC);
if(op != null)
current.addOperation(op);
}
return true;
}
示例2: visit
import org.eclipse.jdt.core.dom.PostfixExpression; //导入方法依赖的package包/类
@Override
public boolean visit(PostfixExpression node) {
Expression operand = node.getOperand();
if (!considerBinding(resolveBinding(operand), operand)) return true;
ASTNode parent = node.getParent();
if (!(parent instanceof ExpressionStatement)) {
fStatus.addError(
RefactoringCoreMessages
.SelfEncapsulateField_AccessAnalyzer_cannot_convert_postfix_expression,
JavaStatusContext.create(fCUnit, SourceRangeFactory.create(node)));
return false;
}
fRewriter.replace(
node,
createInvocation(node.getAST(), node.getOperand(), node.getOperator().toString()),
createGroupDescription(POSTFIX_ACCESS));
return false;
}
示例3: visit
import org.eclipse.jdt.core.dom.PostfixExpression; //导入方法依赖的package包/类
@Override
public boolean visit(PostfixExpression node) {
Expression operand= node.getOperand();
if (!considerBinding(resolveBinding(operand), operand))
return true;
ASTNode parent= node.getParent();
if (!(parent instanceof ExpressionStatement)) {
fStatus.addError(RefactoringCoreMessages.SelfEncapsulateField_AccessAnalyzer_cannot_convert_postfix_expression,
JavaStatusContext.create(fCUnit, SourceRangeFactory.create(node)));
return false;
}
fRewriter.replace(node,
createInvocation(node.getAST(), node.getOperand(), node.getOperator().toString()),
createGroupDescription(POSTFIX_ACCESS));
return false;
}
示例4: setPostfixExpression
import org.eclipse.jdt.core.dom.PostfixExpression; //导入方法依赖的package包/类
/**
* @param expression
*/
public void setPostfixExpression(PostfixExpression expression) {
this.postfixExpressions.add(expression);
Expression operand = expression.getOperand();
expressionPostfixes.put(operand, expression.getOperator());
analyze(operand);
}
示例5: visit
import org.eclipse.jdt.core.dom.PostfixExpression; //导入方法依赖的package包/类
@Override
public boolean visit(PostfixExpression postfixExpression) {
if (postfixExpression.getOperand() == null) return true;
if (!(postfixExpression.getOperand() instanceof SimpleName)) return true;
SimpleName simpleName = (SimpleName) postfixExpression.getOperand();
if (!isNameReferenceToTemp(simpleName)) return true;
fFirstAssignment = postfixExpression;
return false;
}
示例6: visit
import org.eclipse.jdt.core.dom.PostfixExpression; //导入方法依赖的package包/类
@Override
public boolean visit(PostfixExpression postfixExpression) {
if (postfixExpression.getOperand() == null)
return true;
if (! (postfixExpression.getOperand() instanceof SimpleName))
return true;
SimpleName simpleName= (SimpleName)postfixExpression.getOperand();
if (! isNameReferenceToTemp(simpleName))
return true;
fFirstAssignment= postfixExpression;
return false;
}