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


Java PrefixExpression.Operator方法代码示例

本文整理汇总了Java中org.eclipse.jdt.core.dom.PrefixExpression.Operator方法的典型用法代码示例。如果您正苦于以下问题:Java PrefixExpression.Operator方法的具体用法?Java PrefixExpression.Operator怎么用?Java PrefixExpression.Operator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.core.dom.PrefixExpression的用法示例。


在下文中一共展示了PrefixExpression.Operator方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.eclipse.jdt.core.dom.PrefixExpression; //导入方法依赖的package包/类
@Override
public boolean visit(PrefixExpression node) {
  Expression operand = node.getOperand();
  if (!considerBinding(resolveBinding(operand), operand)) return true;

  PrefixExpression.Operator operator = node.getOperator();
  if (operator != PrefixExpression.Operator.INCREMENT
      && operator != PrefixExpression.Operator.DECREMENT) return true;

  checkParent(node);

  fRewriter.replace(
      node,
      createInvocation(node.getAST(), node.getOperand(), node.getOperator().toString()),
      createGroupDescription(PREFIX_ACCESS));
  return false;
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:AccessAnalyzer.java

示例2: isLeftValue

import org.eclipse.jdt.core.dom.PrefixExpression; //导入方法依赖的package包/类
private static boolean isLeftValue(ASTNode node) {
	ASTNode parent= node.getParent();
	if (parent instanceof Assignment) {
		Assignment assignment= (Assignment) parent;
		if (assignment.getLeftHandSide() == node)
			return true;
	}
	if (parent instanceof PostfixExpression)
		return true;
	if (parent instanceof PrefixExpression) {
		PrefixExpression.Operator op= ((PrefixExpression) parent).getOperator();
		if (op.equals(PrefixExpression.Operator.DECREMENT))
			return true;
		if (op.equals(PrefixExpression.Operator.INCREMENT))
			return true;
		return false;
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:ExtractTempRefactoring.java

示例3: visit

import org.eclipse.jdt.core.dom.PrefixExpression; //导入方法依赖的package包/类
@Override
public boolean visit(PrefixExpression node) {
	Expression operand= node.getOperand();
	if (!considerBinding(resolveBinding(operand), operand))
		return true;

	PrefixExpression.Operator operator= node.getOperator();
	if (operator != PrefixExpression.Operator.INCREMENT && operator != PrefixExpression.Operator.DECREMENT)
		return true;

	checkParent(node);

	fRewriter.replace(node,
		createInvocation(node.getAST(), node.getOperand(), node.getOperator().toString()),
		createGroupDescription(PREFIX_ACCESS));
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:AccessAnalyzer.java

示例4: endVisit

import org.eclipse.jdt.core.dom.PrefixExpression; //导入方法依赖的package包/类
@Override
public void endVisit(PrefixExpression node) {
	PrefixExpression.Operator op = node.getOperator();
	if (PrefixExpression.Operator.INCREMENT.equals(op) || PrefixExpression.Operator.DECREMENT.equals(op)) {
		endVisitIncDecOperation(node, node.getOperand());
	} else {
		assignFlowInfo(node, node.getOperand());
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:10,代码来源:FlowAnalyzer.java

示例5: isLeftValue

import org.eclipse.jdt.core.dom.PrefixExpression; //导入方法依赖的package包/类
private static boolean isLeftValue(ASTNode node) {
  ASTNode parent = node.getParent();
  if (parent instanceof Assignment) {
    Assignment assignment = (Assignment) parent;
    if (assignment.getLeftHandSide() == node) return true;
  }
  if (parent instanceof PostfixExpression) return true;
  if (parent instanceof PrefixExpression) {
    PrefixExpression.Operator op = ((PrefixExpression) parent).getOperator();
    if (op.equals(PrefixExpression.Operator.DECREMENT)) return true;
    if (op.equals(PrefixExpression.Operator.INCREMENT)) return true;
    return false;
  }
  return false;
}
 
开发者ID:eclipse,项目名称:che,代码行数:16,代码来源:ExtractTempRefactoring.java

示例6: endVisit

import org.eclipse.jdt.core.dom.PrefixExpression; //导入方法依赖的package包/类
@Override
public void endVisit(PrefixExpression node) {
	PrefixExpression.Operator op= node.getOperator();
	if (PrefixExpression.Operator.INCREMENT.equals(op) || PrefixExpression.Operator.DECREMENT.equals(op)) {
		endVisitIncDecOperation(node, node.getOperand());
	} else {
		assignFlowInfo(node, node.getOperand());
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:FlowAnalyzer.java

示例7: visit

import org.eclipse.jdt.core.dom.PrefixExpression; //导入方法依赖的package包/类
@Override
public boolean visit(PrefixExpression node) {
	PrefixExpression.Operator operator= node.getOperator();
	if (operator == Operator.INCREMENT || operator == Operator.DECREMENT) {
		SimpleName name= getSimpleName(node.getOperand());
		if (name != null)
			addWrite(name, name.resolveBinding());
	}
	return true;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:OccurrencesFinder.java

示例8: isWriteAccess

import org.eclipse.jdt.core.dom.PrefixExpression; //导入方法依赖的package包/类
public static boolean isWriteAccess(Name selectedNode) {
	ASTNode curr= selectedNode;
	ASTNode parent= curr.getParent();
	while (parent != null) {
		switch (parent.getNodeType()) {
			case ASTNode.QUALIFIED_NAME:
				if (((QualifiedName) parent).getQualifier() == curr) {
					return false;
				}
				break;
			case ASTNode.FIELD_ACCESS:
				if (((FieldAccess) parent).getExpression() == curr) {
					return false;
				}
				break;
			case ASTNode.SUPER_FIELD_ACCESS:
				break;
			case ASTNode.ASSIGNMENT:
				return ((Assignment) parent).getLeftHandSide() == curr;
			case ASTNode.VARIABLE_DECLARATION_FRAGMENT:
			case ASTNode.SINGLE_VARIABLE_DECLARATION:
				return ((VariableDeclaration) parent).getName() == curr;
			case ASTNode.POSTFIX_EXPRESSION:
				return true;
			case ASTNode.PREFIX_EXPRESSION:
				PrefixExpression.Operator op= ((PrefixExpression) parent).getOperator();
				return op == PrefixExpression.Operator.DECREMENT || op == PrefixExpression.Operator.INCREMENT;
			default:
				return false;
		}

		curr= parent;
		parent= curr.getParent();
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:37,代码来源:ASTResolving.java


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