edu.wpi.first.wpilibj.util
Class BoundaryException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by edu.wpi.first.wpilibj.util.BoundaryException
All Implemented Interfaces:
java.io.Serializable

public class BoundaryException
extends java.lang.RuntimeException

This exception represents an error in which a lower limit was set as higher than an upper limit.

Author:
dtjones
See Also:
Serialized Form

Constructor Summary
BoundaryException(java.lang.String message)
          Create a new exception with the given message
 
Method Summary
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.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoundaryException

public BoundaryException(java.lang.String message)
Create a new exception with the given message

Parameters:
message - the message to attach to the exception
Method Detail

assertWithinBounds

public 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.

Parameters:
value - The value to check.
lower - The minimum acceptable value.
upper - The maximum acceptable value.