本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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());
}
}
示例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;
}
示例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());
}
}
示例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;
}
示例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;
}