Class FractionException

  • All Implemented Interfaces:
    java.io.Serializable

    class FractionException
    extends java.lang.ArithmeticException
    Package private exception class with constants for frequently used messages.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static java.lang.String ERROR_CONVERSION
      Error message when iterative conversion fails.
      (package private) static java.lang.String ERROR_CONVERSION_OVERFLOW
      Error message for overflow during conversion.
      (package private) static java.lang.String ERROR_DIVIDE_BY_ZERO
      Error message for divide by zero.
      (package private) static java.lang.String ERROR_ZERO_DENOMINATOR
      Error message for zero-valued denominator.
      private static long serialVersionUID
      Serializable version identifier.
    • Constructor Summary

      Constructors 
      Constructor Description
      FractionException​(java.lang.String message)
      Create an exception with the specified message.
      FractionException​(java.lang.String message, java.lang.Object... formatArguments)
      Create an exception where the message is constructed by applying String.format(String, Object...).
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • ERROR_CONVERSION_OVERFLOW

        static final java.lang.String ERROR_CONVERSION_OVERFLOW
        Error message for overflow during conversion.
        See Also:
        Constant Field Values
      • ERROR_CONVERSION

        static final java.lang.String ERROR_CONVERSION
        Error message when iterative conversion fails.
        See Also:
        Constant Field Values
      • ERROR_ZERO_DENOMINATOR

        static final java.lang.String ERROR_ZERO_DENOMINATOR
        Error message for zero-valued denominator.
        See Also:
        Constant Field Values
      • ERROR_DIVIDE_BY_ZERO

        static final java.lang.String ERROR_DIVIDE_BY_ZERO
        Error message for divide by zero.
        See Also:
        Constant Field Values
      • serialVersionUID

        private static final long serialVersionUID
        Serializable version identifier.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FractionException

        FractionException​(java.lang.String message,
                          java.lang.Object... formatArguments)
        Create an exception where the message is constructed by applying String.format(String, Object...).
        Parameters:
        message - the exception message format string
        formatArguments - the arguments for formatting the message
      • FractionException

        FractionException​(java.lang.String message)
        Create an exception with the specified message.
        Parameters:
        message - the exception message