@Override
  public boolean evaluate(RuleContext ruleContext)
  {
    BigDecimal lhs = new BigDecimal(mValues.get(0).asString(ruleContext));
    BigDecimal lower = new BigDecimal(mValues.get(1).asString(ruleContext));
    BigDecimal upper = new BigDecimal(mValues.get(2).asString(ruleContext));

    // int lowerBound = lhs.compareTo(lower);
    // int upperBound = lhs.compareTo(upper);
    // boolean result = (lowerBound > 0 && upperBound < 0) || 0 == lowerBound || 0 == upperBound;

    boolean result = false;
    switch (upper.compareTo(lower))
    {
    case -1:
      // a_upper < lower
      if (ruleContext.getEvents().isDebugEnabled())
      {
        ruleContext.getEvents().debug(TYPE + ": upper <= lhs <= lower: " + upper + " <= " + lhs + " <= " + lower);
      }
      result = ((lhs.compareTo(lower) <= 0) && (lhs.compareTo(upper) >= 0));
      break;

    case 0:
      // a_upper == lower
      if (ruleContext.getEvents().isDebugEnabled())
      {
        ruleContext.getEvents().debug(TYPE + ": lower == lhs == upper: " + lower + " == " + lhs + " == " + upper);
      }
      result = (0 == lhs.compareTo(lower));
      break;

    case 1:
      // a_upper > lower
      if (ruleContext.getEvents().isDebugEnabled())
      {
        ruleContext.getEvents().debug(TYPE + ": lower <= lhs <= upper: " + lower + " <= " + lhs + " <= " + upper);
      }
      result = ((lhs.compareTo(lower) >= 0) && (lhs.compareTo(upper) <= 0));
      break;

    default:
      throw new RuntimeException(TYPE + ": Unexpected comparisson result of lower='" + lower + "' and upper='" + upper + "'");
    }

    return result ^ mNot;
  }