@Override
public void test(Number t) throws ParameterException {
// lower value
if(lowBoundary.equals(IntervalBoundary.CLOSE)) {
if(t.doubleValue() < lowConstraintValue.doubleValue()) {
throw new WrongParameterValueException("Parameter Constraint Error: \n" + "The parameter value specified has to be " + "equal to or greater than " + lowConstraintValue.toString() + ". (current value: " + t.doubleValue() + ")\n");
}
}
else if(lowBoundary.equals(IntervalBoundary.OPEN)) {
if(t.doubleValue() <= lowConstraintValue.doubleValue()) {
throw new WrongParameterValueException("Parameter Constraint Error: \n" + "The parameter value specified has to be " + "greater than " + lowConstraintValue.toString() + ". (current value: " + t.doubleValue() + ")\n");
}
}
// higher value
if(highBoundary.equals(IntervalBoundary.CLOSE)) {
if(t.doubleValue() > highConstraintValue.doubleValue()) {
throw new WrongParameterValueException("Parameter Constraint Error: \n" + "The parameter value specified has to be " + "equal to or less than " + highConstraintValue.toString() + ". (current value: " + t.doubleValue() + ")\n");
}
}
else if(highBoundary.equals(IntervalBoundary.OPEN)) {
if(t.doubleValue() >= highConstraintValue.doubleValue()) {
throw new WrongParameterValueException("Parameter Constraint Error: \n" + "The parameter value specified has to be " + "less than " + highConstraintValue.toString() + ". (current value: " + t.doubleValue() + ")\n");
}
}
}