EvalEx is a handy expression evaluator for Java, that allows to evaluate simple mathematical and boolean expressions.