All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.roguewave.money.currency.v1_0.PrecisionExceededException

java.lang.Object
   |
   +----java.lang.Throwable
           |
           +----java.lang.Exception
                   |
                   +----java.lang.RuntimeException
                           |
                           +----com.roguewave.money.currency.v1_0.MoneyException
                                   |
                                   +----com.roguewave.money.currency.v1_0.PrecisionExceededException

public class PrecisionExceededException
extends MoneyException
A PrecisionExceededException occurs whenever any operation inside Money.h++ causes the precision of a Money to be violated.

Author:
Trevor Misfeldt
See Also:
MoneyException

Variable Index

 o DEFAULT_MESSAGE

Constructor Index

 o PrecisionExceededException(short, Object, Object, Money)
Create a new exception with the type of operation, the two operands, the imprecise answer and the default message.
 o PrecisionExceededException(short, Object, Object, Money, String)
Create a new exception with the type of operation, the two operands, the imprecise answer and a message.

Method Index

 o getAnswer()
Return the answer which exceeded its precision.
 o getOperand1()
Return the first operand in the errant operation.
 o getOperand2()
Return the second operand in the errant operation.
 o toString()
Return a string representation of the exception.

Variables

 o DEFAULT_MESSAGE
 public static String DEFAULT_MESSAGE

Constructors

 o PrecisionExceededException
 public PrecisionExceededException(short operation,
                                   Object operand1,
                                   Object operand2,
                                   Money answer)
Create a new exception with the type of operation, the two operands, the imprecise answer and the default message.

Parameters:
operation - the type of operation
operand1 - the first operand
operand2 - the second operand
answer - the money with the imprecise result
See Also:
DEFAULT_MESSAGE, EXCHANGE, ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION
 o PrecisionExceededException
 public PrecisionExceededException(short operation,
                                   Object operand1,
                                   Object operand2,
                                   Money answer,
                                   String message)
Create a new exception with the type of operation, the two operands, the imprecise answer and a message.

Parameters:
operation - the type of operation
operand1 - the first operand
operand2 - the second operand
answer - the money with the imprecise result
message - a descriptive string describing the error
See Also:
EXCHANGE, ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION

Methods

 o getOperand1
 public Object getOperand1()
Return the first operand in the errant operation.

Returns:
the first operand.
 o getOperand2
 public Object getOperand2()
Return the second operand in the errant operation.

Returns:
the second operand.
 o getAnswer
 public Money getAnswer()
Return the answer which exceeded its precision. Often this answer will be of more than acceptable accuracy.

Returns:
the imprecise answer
 o toString
 public String toString()
Return a string representation of the exception. Includes the message, the operation type, the two operands and the imprecise answer.

Returns:
the string
Overrides:
toString in class MoneyException

All Packages  Class Hierarchy  This Package  Previous  Next  Index