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
-
DEFAULT_MESSAGE
-
-
PrecisionExceededException(short, Object, Object, Money)
- Create a new exception with the type of operation, the two operands, the imprecise
answer and the default message.
-
PrecisionExceededException(short, Object, Object, Money, String)
- Create a new exception with the type of operation, the two operands, the imprecise
answer and a message.
-
getAnswer()
- Return the answer which exceeded its precision.
-
getOperand1()
- Return the first operand in the errant operation.
-
getOperand2()
- Return the second operand in the errant operation.
-
toString()
- Return a string representation of the exception.
DEFAULT_MESSAGE
public static String DEFAULT_MESSAGE
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
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
getOperand1
public Object getOperand1()
- Return the first operand in the errant operation.
- Returns:
- the first operand.
getOperand2
public Object getOperand2()
- Return the second operand in the errant operation.
- Returns:
- the second operand.
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
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