src/org/ohmage/domain/campaign/prompt/BoundedPrompt.java
@Override
	public void validateConditionValuePair(
			final ConditionValuePair pair)
			throws DomainException {
		
		try {
			DecimalFormat decimalFormat = new DecimalFormat();
			decimalFormat.setParseBigDecimal(true);
			BigDecimal value =
				(BigDecimal) decimalFormat.parse(pair.getValue());
			
			// Verify that the default is not less than the minimum.
			if(value.compareTo(getMin()) < 0) {
				throw new DomainException(
						"The value of the condition is less than the " +
							"minimum allowed value (" + 
							getMin() +
							"): " +
							pair.getValue());
			}
			// Verify that the default is not greater than the maximum.
			else if(value.compareTo(getMax()) > 0) {
				throw new DomainException(
						"The value of the condition is greater than the " +
							"maximum allowed value (" + 
							getMax() +
							"): " +
							pair.getValue());
			}
			// Verify that the condition is a whole number if the response
			// must be a whole number
			else if(getWholeNumber() && ! isWholeNumber(value)) {
				throw
					new DomainException(
						"The value of the condition is a decimal, but the " +
							"flag indicatest that only whole numbers are " +
							"possible.");
			}
		}
		catch(ParseException e) {
			throw new DomainException(
					"The value of the condition is not a number: " + 
						pair.getValue(),
					e);
		}
	}
/**
	 * Verifies that the value of the condition is not outside the bounds of
	 * the prompt.
	 * 
	 * @param pair The condition-value pair to validate.
	 * 
	 * @throws DomainException The value was not a number or was outside the
	 * 						   predefined bounds.
	 */
Verifies that the value of the condition is not outside the bounds of
the prompt.

@param pair The condition-value pair to validate.

@throws DomainException The value was not a number or was outside the
predefined bounds.
Verifies that the value of the condition is not outside the bounds of the prompt . @param pair The condition - value pair to validate . @throws DomainException The value was not a number or was outside the predefined bounds .
@Override
	public void validateConditionValuePair(
			final ConditionValuePair pair)
			throws DomainException {
		try {
			DecimalFormat decimalFormat = new DecimalFormat();
			decimalFormat.setParseBigDecimal(true);
			BigDecimal value =
				(BigDecimal) decimalFormat.parse(pair.getValue());
			if(value.compareTo(getMin()) < 0) {
				throw new DomainException(
						"The value of the condition is less than the " +
							"minimum allowed value (" + 
							getMin() +
							"): " +
							pair.getValue());
			}
			else if(value.compareTo(getMax()) > 0) {
				throw new DomainException(
						"The value of the condition is greater than the " +
							"maximum allowed value (" + 
							getMax() +
							"): " +
							pair.getValue());
			}
			else if(getWholeNumber() && ! isWholeNumber(value)) {
				throw
					new DomainException(
						"The value of the condition is a decimal, but the " +
							"flag indicatest that only whole numbers are " +
							"possible.");
			}
		}
		catch(ParseException e) {
			throw new DomainException(
					"The value of the condition is not a number: " + 
						pair.getValue(),
					e);
		}
	}
@ Override public void validateConditionValuePair ( final ConditionValuePair pair ) throws DomainException { try { DecimalFormat decimalFormat = new DecimalFormat ( ) ; decimalFormat . setParseBigDecimal ( true ) ; BigDecimal value = ( BigDecimal ) decimalFormat . parse ( pair . getValue ( ) ) ; if ( value . compareTo ( getMin ( ) ) < 0 ) { throw new DomainException ( "The value of the condition is less than the " + "minimum allowed value (" + getMin ( ) + "): " + pair . getValue ( ) ) ; } else if ( value . compareTo ( getMax ( ) ) > 0 ) { throw new DomainException ( "The value of the condition is greater than the " + "maximum allowed value (" + getMax ( ) + "): " + pair . getValue ( ) ) ; } else if ( getWholeNumber ( ) && ! isWholeNumber ( value ) ) { throw new DomainException ( "The value of the condition is a decimal, but the " + "flag indicatest that only whole numbers are " + "possible." ) ; } } catch ( ParseException e ) { throw new DomainException ( "The value of the condition is not a number: " + pair . getValue ( ) , e ) ; } }
Verifies that the value of the condition is not outside the bounds of
 the prompt.
Verifies that the value of the condition is not outside the bounds of the prompt .
// Verify that the default is not less than the minimum. // Verify that the default is not greater than the maximum. // Verify that the condition is a whole number if the response // must be a whole number