UnaryOperatorExpressionpublic class UnaryOperatorExpression extends Expression An expression representing one or more unary operators on a
value |
Fields Summary |
---|
UnaryOperator | mOperator | List | mOperators | Expression | mExpression |
Constructors Summary |
---|
public UnaryOperatorExpression(UnaryOperator pOperator, List pOperators, Expression pExpression)Constructor
mOperator = pOperator;
mOperators = pOperators;
mExpression = pExpression;
|
Methods Summary |
---|
public java.lang.Object | evaluate(java.lang.Object pContext, VariableResolver pResolver, java.util.Map functions, java.lang.String defaultPrefix, Logger pLogger)Evaluates to the literal value
Object value = mExpression.evaluate (pContext, pResolver, functions,
defaultPrefix, pLogger);
if (mOperator != null) {
value = mOperator.apply (value, pContext, pLogger);
}
else {
for (int i = mOperators.size () - 1; i >= 0; i--) {
UnaryOperator operator = (UnaryOperator) mOperators.get (i);
value = operator.apply (value, pContext, pLogger);
}
}
return value;
| public Expression | getExpression() return mExpression;
| public java.lang.String | getExpressionString()Returns the expression in the expression language syntax
StringBuffer buf = new StringBuffer ();
buf.append ("(");
if (mOperator != null) {
buf.append (mOperator.getOperatorSymbol ());
buf.append (" ");
}
else {
for (int i = 0; i < mOperators.size (); i++) {
UnaryOperator operator = (UnaryOperator) mOperators.get (i);
buf.append (operator.getOperatorSymbol ());
buf.append (" ");
}
}
buf.append (mExpression.getExpressionString ());
buf.append (")");
return buf.toString ();
| public UnaryOperator | getOperator() return mOperator;
| public java.util.List | getOperators() return mOperators;
| public void | setExpression(Expression pExpression) mExpression = pExpression;
| public void | setOperator(UnaryOperator pOperator) mOperator = pOperator;
| public void | setOperators(java.util.List pOperators) mOperators = pOperators;
|
|