Class ETrapException

  • All Implemented Interfaces:
    java.io.Serializable

    public final class ETrapException
    extends java.lang.ArithmeticException
    Exception thrown for arithmetic trap errors. (The "E" stands for "extended", and has this prefix to group it with the other classes common to this library, particularly EDecimal, EFloat, and ERational.).
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ETrapException​(int flag, EContext ctx, java.lang.Object result)
      Initializes a new instance of the ETrapException class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      EContext getContext()
      Gets the arithmetic context used during the operation that triggered the trap.
      int getError()
      Gets the flag that specifies the kind of error (EContext.FlagXXX).
      java.lang.Object getResult()
      Gets the defined result of the operation that caused the trap.
      • 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
    • Constructor Detail

      • ETrapException

        public ETrapException​(int flag,
                              EContext ctx,
                              java.lang.Object result)
        Initializes a new instance of the ETrapException class.
        Parameters:
        flag - The parameter flag is a 32-bit signed integer.
        ctx - The parameter ctx is an EContext object.
        result - The parameter result is an arbitrary object.
    • Method Detail

      • getContext

        public final EContext getContext()
        Gets the arithmetic context used during the operation that triggered the trap. May be null.
        Returns:
        The arithmetic context used during the operation that triggered the trap. May be null.
      • getResult

        public final java.lang.Object getResult()
        Gets the defined result of the operation that caused the trap.
        Returns:
        The defined result of the operation that caused the trap.
      • getError

        public final int getError()
        Gets the flag that specifies the kind of error (EContext.FlagXXX). This will only be one flag, such as FlagInexact or FlagSubnormal.
        Returns:
        The flag that specifies the kind of error (EContext.FlagXXX). This will only be one flag, such as. FlagInexact or FlagSubnormal.