当前位置: 首页>>代码示例>>Java>>正文


Java PostfixExpression.getOperand方法代码示例

本文整理汇总了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;
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:17,代码来源:VarParser.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:AccessAnalyzer.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:AccessAnalyzer.java

示例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);
}
 
开发者ID:junit-tools-team,项目名称:junit-tools,代码行数:10,代码来源:TestCasesGenerator.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:TempAssignmentFinder.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:TempAssignmentFinder.java


注:本文中的org.eclipse.jdt.core.dom.PostfixExpression.getOperand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。