this.target = target;
this.isMinus = isMinus;
}
TemplateModel _eval(Environment env) throws TemplateException {
TemplateNumberModel targetModel = null;
TemplateModel tm = target.eval(env);
try {
targetModel = (TemplateNumberModel) tm;
} catch (ClassCastException cce) {
throw new NonNumericalException(target, tm, env);
}
if (!isMinus) {
return targetModel;
}
target.assertNonNull(targetModel, env);
Number n = targetModel.getAsNumber();
n = ArithmeticEngine.CONSERVATIVE_ENGINE.multiply(MINUS_ONE, n);
return new SimpleNumber(n);
}