Package com.upokecenter.numbers
Class ETrapException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.ArithmeticException
-
- com.upokecenter.numbers.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 theETrapException
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.
-
-
-
Constructor Detail
-
ETrapException
public ETrapException(int flag, EContext ctx, java.lang.Object result)
Initializes a new instance of theETrapException
class.- Parameters:
flag
- The parameterflag
is a 32-bit signed integer.ctx
- The parameterctx
is an EContext object.result
- The parameterresult
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 asFlagInexact
or FlagSubnormal.- Returns:
- The flag that specifies the kind of error (EContext.FlagXXX). This
will only be one flag, such as.
FlagInexact
or FlagSubnormal.
-
-