public class BoundaryException extends java.lang.RuntimeException
Constructor and Description |
---|
BoundaryException(java.lang.String message)
Create a new exception with the given message.
|
Modifier and Type | Method and Description |
---|---|
static void |
assertWithinBounds(double value,
double lower,
double upper)
Make sure that the given value is between the upper and lower bounds, and throw an exception if
they are not.
|
static java.lang.String |
getMessage(double value,
double lower,
double upper)
Returns the message for a boundary exception.
|
public BoundaryException(java.lang.String message)
message
- the message to attach to the exceptionpublic static void assertWithinBounds(double value, double lower, double upper)
value
- The value to check.lower
- The minimum acceptable value.upper
- The maximum acceptable value.public static java.lang.String getMessage(double value, double lower, double upper)
value
- The given valuelower
- The lower limitupper
- The upper limit