/** * Check if the value is less than or equal to a maximum. * * @param value The value validation is being performed on. * @param max The maximum value. * @return <code>true</code> if the value is less than * or equal to the maximum. */ public boolean maxValue(Number value, Number max) { if (isAllowFractions()) { return (value.doubleValue() <= max.doubleValue()); } return (value.longValue() <= max.longValue()); }
/** * Check if the value is greater than or equal to a minimum. * * @param value The value validation is being performed on. * @param min The minimum value. * @return <code>true</code> if the value is greater than * or equal to the minimum. */ public boolean minValue(Number value, Number min) { if (isAllowFractions()) { return (value.doubleValue() >= min.doubleValue()); } return (value.longValue() >= min.longValue()); }
return -1; if (!isAllowFractions() || format.isParseIntegerOnly()) { return 0;
/** * Check if the value is greater than or equal to a minimum. * * @param value The value validation is being performed on. * @param min The minimum value. * @return <code>true</code> if the value is greater than * or equal to the minimum. */ public boolean minValue(Number value, Number min) { if (isAllowFractions()) { return (value.doubleValue() >= min.doubleValue()); } return (value.longValue() >= min.longValue()); }
/** * Check if the value is less than or equal to a maximum. * * @param value The value validation is being performed on. * @param max The maximum value. * @return <code>true</code> if the value is less than * or equal to the maximum. */ public boolean maxValue(Number value, Number max) { if (isAllowFractions()) { return (value.doubleValue() <= max.doubleValue()); } return (value.longValue() <= max.longValue()); }
/** * Check if the value is less than or equal to a maximum. * * @param value The value validation is being performed on. * @param max The maximum value. * @return <code>true</code> if the value is less than * or equal to the maximum. */ public boolean maxValue(Number value, Number max) { if (isAllowFractions()) { return (value.doubleValue() <= max.doubleValue()); } else { return (value.longValue() <= max.longValue()); } }
/** * Check if the value is greater than or equal to a minimum. * * @param value The value validation is being performed on. * @param min The minimum value. * @return <code>true</code> if the value is greater than * or equal to the minimum. */ public boolean minValue(Number value, Number min) { if (isAllowFractions()) { return (value.doubleValue() >= min.doubleValue()); } else { return (value.longValue() >= min.longValue()); } }
return -1; if (!isAllowFractions() || format.isParseIntegerOnly()) { return 0;
return -1; if (!isAllowFractions() || format.isParseIntegerOnly()) { return 0;