All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.roguewave.money.currency.v1_0.MismatchedCurrenciesException

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.MismatchedCurrenciesException

public class MismatchedCurrenciesException
extends MoneyException
A MismatchedCurrenciesException occurs whenever an operation is attempted between two Money objects without using the MoneyCalculator.

Author:
Trevor Misfeldt
See Also:
MoneyException

Variable Index

 o DEFAULT_MESSAGE

Constructor Index

 o MismatchedCurrenciesException(short, String, String)
Creates a new exception with operation type, the two mismatched currencies and a default error message.
 o MismatchedCurrenciesException(short, String, String, String)
Creates a new exception with operation type, the two mismatched currencies and a default error message.

Method Index

 o getCurrency1()
Returns the first currency in the operation.
 o getCurrency2()
Returns the second currency in the operation.
 o toString()
Returns a string representation of this exception including an error message, the operation and the two currencies involved.

Variables

 o DEFAULT_MESSAGE
 public static String DEFAULT_MESSAGE

Constructors

 o MismatchedCurrenciesException
 public MismatchedCurrenciesException(short operation,
                                      String currency1,
                                      String currency2)
Creates a new exception with operation type, the two mismatched currencies and a default error message.

Parameters:
operation - the type of operation attempted
currency1 - the first currency mnemonic
currency2 - the second currency mnemonic
See Also:
DEFAULT_MESSAGE, EXCHANGE, ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION, Currency
 o MismatchedCurrenciesException
 public MismatchedCurrenciesException(short operation,
                                      String currency1,
                                      String currency2,
                                      String message)
Creates a new exception with operation type, the two mismatched currencies and a default error message.

Parameters:
operation - the type of operation attempted
currency1 - the first currency mnemonic
currency2 - the second currency mnemonic
message - an error message
See Also:
EXCHANGE, ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION, Currency

Methods

 o getCurrency1
 public String getCurrency1()
Returns the first currency in the operation.

Returns:
the first currency mnemonic
See Also:
Currency
 o getCurrency2
 public String getCurrency2()
Returns the second currency in the operation.

Returns:
the second currency mnemonic
See Also:
Currency
 o toString
 public String toString()
Returns a string representation of this exception including an error message, the operation and the two currencies involved.

Returns:
a string
Overrides:
toString in class MoneyException

All Packages  Class Hierarchy  This Package  Previous  Next  Index