File-By-File
InvalidSpeedException

InvalidSpeedException

This exception is thrown whenever a speed value is invalid. In most cases, speed values should always fit within the range of 0.0 to 1.0. If you're getting this exception during program execution, it's fairly likely the cause is a speed value outside of that range.

Methods

InvalidSpeedException(String s)

Constructs a new InvalidSpeedException with the specified detail message.

  • s: The detail message (a String) explaining the reason for the exception.

throwIfInvalid(String message, double speed)

Static method that throws an InvalidSpeedException if the provided speed is less than 0 or greater than 1.0.

  • message: The message to be used for the exception if it is thrown.
  • speed: The speed value to validate.