本文整理了Java中org.mozilla.javascript.ast.UnaryExpression.setBounds()
方法的一些代码示例,展示了UnaryExpression.setBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UnaryExpression.setBounds()
方法的具体详情如下:
包路径:org.mozilla.javascript.ast.UnaryExpression
类名称:UnaryExpression
方法名:setBounds
暂无
代码示例来源:origin: geogebra/geogebra
/**
* Constructs a new UnaryExpression with the specified operator
* and operand. It sets the parent of the operand, and sets its own bounds
* to encompass the operator and operand.
* @param operator the node type
* @param operatorPosition the absolute position of the operator.
* @param operand the operand expression
* @param postFix true if the operator follows the operand. Int
* @throws IllegalArgumentException} if {@code operand} is {@code null}
*/
public UnaryExpression(int operator, int operatorPosition,
AstNode operand, boolean postFix) {
assertNotNull(operand);
int beg = postFix ? operand.getPosition() : operatorPosition;
// JavaScript only has ++ and -- postfix operators, so length is 2
int end = postFix
? operatorPosition + 2
: operand.getPosition() + operand.getLength();
setBounds(beg, end);
setOperator(operator);
setOperand(operand);
isPostfix = postFix;
}
代码示例来源:origin: io.apigee/rhino
/**
* Constructs a new UnaryExpression with the specified operator
* and operand. It sets the parent of the operand, and sets its own bounds
* to encompass the operator and operand.
* @param operator the node type
* @param operatorPosition the absolute position of the operator.
* @param operand the operand expression
* @param postFix true if the operator follows the operand. Int
* @throws IllegalArgumentException} if {@code operand} is {@code null}
*/
public UnaryExpression(int operator, int operatorPosition,
AstNode operand, boolean postFix) {
assertNotNull(operand);
int beg = postFix ? operand.getPosition() : operatorPosition;
// JavaScript only has ++ and -- postfix operators, so length is 2
int end = postFix
? operatorPosition + 2
: operand.getPosition() + operand.getLength();
setBounds(beg, end);
setOperator(operator);
setOperand(operand);
isPostfix = postFix;
}
代码示例来源:origin: ro.isdc.wro4j/rhino
/**
* Constructs a new UnaryExpression with the specified operator
* and operand. It sets the parent of the operand, and sets its own bounds
* to encompass the operator and operand.
* @param operator the node type
* @param operatorPosition the absolute position of the operator.
* @param operand the operand expression
* @param postFix true if the operator follows the operand. Int
* @throws IllegalArgumentException} if {@code operand} is {@code null}
*/
public UnaryExpression(int operator, int operatorPosition,
AstNode operand, boolean postFix) {
assertNotNull(operand);
int beg = postFix ? operand.getPosition() : operatorPosition;
// JavaScript only has ++ and -- postfix operators, so length is 2
int end = postFix
? operatorPosition + 2
: operand.getPosition() + operand.getLength();
setBounds(beg, end);
setOperator(operator);
setOperand(operand);
isPostfix = postFix;
}
代码示例来源:origin: com.github.tntim96/rhino
/**
* Constructs a new UnaryExpression with the specified operator
* and operand. It sets the parent of the operand, and sets its own bounds
* to encompass the operator and operand.
* @param operator the node type
* @param operatorPosition the absolute position of the operator.
* @param operand the operand expression
* @param postFix true if the operator follows the operand. Int
* @throws IllegalArgumentException} if {@code operand} is {@code null}
*/
public UnaryExpression(int operator, int operatorPosition,
AstNode operand, boolean postFix) {
assertNotNull(operand);
int beg = postFix ? operand.getPosition() : operatorPosition;
// JavaScript only has ++ and -- postfix operators, so length is 2
int end = postFix
? operatorPosition + 2
: operand.getPosition() + operand.getLength();
setBounds(beg, end);
setOperator(operator);
setOperand(operand);
isPostfix = postFix;
}
内容来源于网络,如有侵权,请联系作者删除!