public static Double evaluateToDouble(String expression,Map<String,Object> vars){
  Object result=evaluate(expression,vars);
  if (result == null) {
    throw new IllegalStateException("Result must be not null");
  }
  if (!isNumeric(String.valueOf(result))) {
    throw new IllegalStateException("Result must be numeric: " + result + ", "+ result.getClass());
  }
  return Double.valueOf(String.valueOf(result));
}

public static Double evaluateToDouble ( String expression , Map < String , Object > vars ) { Object result = evaluate ( expression , vars ) ; if ( result == null ) { throw new IllegalStateException ( "Result must be not null" ) ; } if ( ! isNumeric ( String . valueOf ( result ) ) ) { throw new IllegalStateException ( "Result must be numeric: " + result + ", " + result . getClass ( ) ) ; } return Double . valueOf ( String . valueOf ( result ) ) ; }
evaluates the given expression . the given variables will be substituted in the expression . converts the result of the evaluation to a double . throws an illegalstateexception if the result could not be converted to a double
