public class BoundaryException extends RuntimeException
| Constructor and Description |
|---|
BoundaryException(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 String |
getMessage(double value,
double lower,
double upper)
Returns the message for a boundary exception.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic BoundaryException(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 String getMessage(double value, double lower, double upper)
value - The given valuelower - The lower limitupper - The upper limitCopyright © 2015. All rights reserved.